I asked a question similar to this previously:


However I think I have a better handle on it now and want to re-ask it:

I simply want to simulate data from a state space model where the state variables follow an AR(1) process (see the code in the first link above).

Given the burn in issues (see link below) I assume it's better to determine empirically how many observations are required until the system reaches its theoretical unconditional variance then ensure that I simulate at least 2 times that amount before using the x(t) generated by the AR(1) process in my state space model.


Q1.) If I want to simulate data from my state space model is it necessary to ensure that the AR(1) process is in it's equilibrium state first?

Q2.) From the simulated data I will be able to estimate the observation and state error variances as well as the AR(1) parameters and the unconditional mean and variance of the process (averaged over many sample runs). Assuming these empirical values all match their corresponding theoretical ones, can I then be fully satisfied that the state space model which is based on the AR(1) process has been implemented correctly?

Q3.) How can I estimate what the likely error bounds should be on the parameters that I propose to estimate in Q2?



1 Answer 1


Q1- for AR(1) only one 1 lag, ie burn in, should be sufficient. However, you could do 50 to feel comfortable.

Q2- Matching the theoretical one is not a possibility

Q3. (update) AIC/BIC tests on the simulated series can help select the best one. You can get the logL values from KF or estimate functions in Matlab.

  • $\begingroup$ Thanks!! 1 lag I will try it. Seems a little weird though> I can simulate the process 50 times (as shown in the first link) and then take the variance of the AR(1) process as different time steps for processes with a high auto-correlation value say 0.99 it cab take a few hundred steps before they settle to their steady state theoretical variance. It would seem that prior to this any estimation process is trying to hit a moving target? $\endgroup$
    – Bazman
    Jun 3, 2014 at 9:55
  • $\begingroup$ Q2. The whole point of simulated the AR(1) process is so I can generate simluated data (i.e.) with known parameter values. Then fit the model shown at the bottom of p34 onwards here: pure.au.dk/portal-asb-student/files/48326397/…. As noted above I can check that the variance and means are correct across samples but any one individual sample will be subject to stochastic variation (and unfortunately in practice I can only use one sample). The idea is to estimate the mean and covariance of the state variable X using a Kalman filter, then to $\endgroup$
    – Bazman
    Jun 3, 2014 at 9:59
  • $\begingroup$ Q2 continued.) then compute the log-likelihood across all parameter values. As a final step the loglikelihood is used as the objective function for an optimization process to find the original variables. Right now I am simulating the AR(1) process and trying to apply the Kalman Filter/optimisation process but the results are not really that good even when i give the optimizer good initial guesses. Should this work? If not why not and how can I test the Kalman Filter/optimization scheme for this model set up? $\endgroup$
    – Bazman
    Jun 3, 2014 at 10:05
  • $\begingroup$ q3.) How do I calculate the p-value? $\endgroup$
    – Bazman
    Jun 3, 2014 at 10:06
  • $\begingroup$ To find the best AR simulated series that best fits the parameters, check the LogL, or AIC/BIC (aicbic Matlab function) from estimate function in Matlab. KF will give you the best estimate implied in the simulated series. p-values wont help you here, you would get them from regression. $\endgroup$
    – user12348
    Jun 3, 2014 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.