I have a weather balloon project, in which I intend to use GPS to locate the payload when it finally comes down again.
I will make the computer send coordinates to a server every minute or so, as long as it has connection to cellular towers. I use that data to display the location of the payload in real time on a website by placing markers on a Google Map.
I just thought of a very cool thing that I would like to implement but I am lacking mathematical skills. The idea is to use some X
number of previous locations to try to predict where it will land.
So my question is: How do you estimate the landing of such an object with some X
number of data points. Lets say with 2
previous data points first as I suspect that it is a bit simpler or linear. After that I would like to try to use more data points so if the payload is moving in an arc it will be able to use that to predict landing location.
I have looked into this a bit on Wolfram but I can't seem to find a beginners version for calculating this.
I will use python or Javascript.
P.S. I don't even know what tags to use.
Edit: Thanks for the tags. They help me with the research. At least I know the concepts now. So I want to extrapolate my data series. The data points could look like so in the format x,y,z {(20,20,20),(19,18,16)} I want to find x and y when z reaches 0. Am I correct that the resulting co-ordinates will be (15,10,0)? Since it takes z 5 steps to reach 0 I can multiply that with the change in each axis to find the predicted value of x and y. This might not be accurate in a real situation but at least I am getting somewhere.
Edit: Simulated actual data: (-21.93297,64.13256,10000), (-21.93245,64.13194,9000), (-21.93194,64.13126,8000), (-21.93143,64.13059,7000), (-21.93096,64.12990,6000), (-21.93030,64.12936,5000), (-21.92976,64.12872,4000), (-21.92943,64.12796,3000), (-21.92906,64.12721,2000), (-21.92864,64.12649,1000), (-21.92833,64.12572,0)
I know that this might sound a bit complicated if you are new to the subject, but this is the simplest mathematically sound way that I can think of right now, without introducing gross errors in your estimations.
What you are trying to do has extensively been studied, e.g. in the simultaneous localization and mapping (SLAM and visual SLAM) literature if you are interested. However, what you want to do is this: You have an object which has an unknown state $x$ (in your case it is the position, and I'd add velocity and/or acceleration). But since you do not know its true values, you use observations $y$ (your gps data). Suppose you have the observations $y_1,...,y_{k-1}$ and have estimated the states $x_1,...,x_{k-1}$. Now, you make a new observation (a new GPS position) $y_k$. what you want is to predict the new state $x_k$. Predicting your next state based on previous states and observations comes to estimating the $x_k$ that maximises the density (this is a maximum likelihood problem): $$p(x_k|y_1,...,y_k)$$ Using a simple bayesian reasoning, you have $$p(x_k|y_1,...,y_k)=p(y_k|x_k)p(x_k|y_1,y_2,...,y_{k-1})$$ In your case, we will suppose that this probability is a gaussian (only one place with a high probability to find the object!). That means that what you want is to recursively estimate the mean and covariance of that gaussian (a gaussian is uniquely defined by those). The term $p(x_k|y_1,y_2,...,y_{k-1})$ is the prediction term. That is, you predict the next state based on the previous observations. The terms $p(y_k|x_k)$ is the likelihood of that prediction. Now how do you predict? The answer is quite simple: you have to define a Dynamic system to model the movements of your object. In your case, it can be a simple linear system: $x_k=Vx_{k-1}+w$, where $V$ is the velocity of your object. And $w$ is just gaussian noise. And how do you observe? Well, Again, you can define a simple system: $y_k=Gy_{k-1}+\eta$. In your case, you can set $G=Id$, and suppose $\eta$ is gaussian noise (in practice, it is more difficult, since GPS data are usually biased). Given all that information, it is pretty straight-froward to derive what is known as the kalman filter, but it is not easy and in its most concise form (as far as I know) takes about a page. But that doesn't mean that you can not just basically copy-paste the formulas from wikipedia (the predict-update formulas), since now you know what they do! Kalamn's predict formulas predict the mean and covariance of the Gaussian according to your dynamic model, and the update equations correspond to the $p(y_k|x_k)$ term.
Anyway, there are lots of implementations (I know that there are many in C++ that are freely available (there), and I think that there's a matlab toolbox, not sure about octave though.). Anyway, this answer is supposed to only give you pointers. Hope that helps!
EDIT: here's a python implementation https://pykalman.github.io/
EDIT: The following remark is incorrect, see Michael Seifert's comment.
PS: I think it would be easier to convert you latitude longitude coordinates to some euclidean o