0
$\begingroup$

I am trying to simulate 10 paths of an AR(2) system with 75 time steps in each path. It is only a system in a loose sense: the variables are connected by nothing more than the correlation in their disturbance terms.

The system has ten variables, but three should show how I am trying to run it.

intercepts={0.038871, 0.062392, 0.10672}
initialValues={0.0213326, 0.00916164, 0.149474}
firstLag={{0.87523, 0., 0.}, {0., -0.26885, 0.}, {0., 0., 0.087234}}
secondLag= {{-0.31856, 0., 0.}, {0., -0.12441, 0.}, {0., 0., 0.020767}}
covariance={{0.0000499966, 0.000121522, -0.0002496}, {0.000121522, 

0.00264912, -0.00128539}, {-0.0002496, -0.00128539, 0.00416527}}

The following code returns no simulated values and no error message. Can anyone tell me what I am doing wrong?

RandomFunction[
   ARProcess[intercepts,{firstLag,secondLag},covariance,initialValues],{0,75},10]
$\endgroup$
  • $\begingroup$ You need to use {initialValues} - 1 inital point consisting of 3 values. $\endgroup$ – b.gates.you.know.what May 19 '17 at 11:45
  • $\begingroup$ Thanks for taking a look at it. Solution didn't work though... $\endgroup$ – Luke May 19 '17 at 21:39
  • $\begingroup$ Do you get an error message ? $\endgroup$ – b.gates.you.know.what May 20 '17 at 6:44
  • $\begingroup$ italic bold `Nope' $\endgroup$ – Luke May 21 '17 at 0:54
  • $\begingroup$ I voted to close, but I am not sure should this question be closed as something that can be found in the documentation. From the function page of ARProcess it is not immediately clear that the initial values for an $n$-dimensional process should be given in a matrix. $\endgroup$ – Anton Antonov May 23 '17 at 16:07
2
$\begingroup$

Too long for a comment:

intercepts = {0.038871, 0.062392, 0.10672};
initialValues = {0.0213326, 0.00916164, 0.149474};
firstLag = {{0.87523, 0., 0.}, {0., -0.26885, 0.}, {0., 0., 0.087234}};
secondLag = {{-0.31856, 0., 0.}, {0., -0.12441, 0.}, {0., 0., 
    0.020767}};
covariance = {{0.0000499966, 0.000121522, -0.0002496}, {0.000121522, 
    0.00264912, -0.00128539}, {-0.0002496, -0.00128539, 0.00416527}};
paths = RandomFunction[
  ARProcess[intercepts, {firstLag, secondLag}, 
   covariance, {initialValues}], {0, 75}, 10]

ListLinePlot@
 Transpose[Thread[{#[[1]], #[[2]]}] & /@ paths["Paths"][[1]]]

example

|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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