Least squares fitting of an iterative function

60 Views Asked by At

I have a set of data which need to be modelled by a function which is defined iteratively. IE $$N(t) = 2*N(t-1)+a*N(t-1)$$

Where a is the parameter to be fitted. This isn't the function, it's just as an example. How do I go about least squares when I have an iterative function? Particularly looking for an answer which I can program in MATLAB. All the toolboxes I've seen just fit a normal function like a polynomial or something.

Anyone done this before??

1

There are 1 best solutions below

0
On BEST ANSWER

Say you observe $N_t$ for $t=1,2,...,T$. Then you may consider the following model:$$N_t=\beta N_{t-1}+e_t$$

where $e_t$ is some error term. Under some assumptions (OLS assumptions) you may estimate $\beta$ by $$\hat{\beta}=\frac{\sum_{t=2}^TN_tN_{t-1}}{\sum_{t=2}^TN_{t-1}^2}$$