0
$\begingroup$

I have simulated a VAR process with this

simData = 
  RandomFunction[ARProcess[a, Sigma], {1, 20001}];

Where the coefficients for a VAR[2] process:

a1 = {{1.6, 0, 0}, {0.3, 1.5, 0}, {0, 0.5, 1.7}};
a2 = {{-0.8, 0, 0}, {0, -0.8, 0}, {0, 0, -0.8}};
a = {a1, a2};

And

Sigma = {{1.0, 0, 0}, {0, 1.0, 0}, {0, 0, 1.0}};

simData is then a TemporalData with 1 path and have 3 Output dimension.

How do I plot (or have a list of values corresponding to) the individual paths for the 3 processes of the VAR simulation?

ListLinePlot can be used to plot different paths. But the way TemporalData is structured, I need to plot the three different processes I've simulated. Please let me know if my question isn't clear enough.

Edit: Performing:

ListLinePlot[simData]

gives me

enter image description here

Which looks like there may be three different paths there. But I would like to only pick them out one by one to be analysed individually.

$\endgroup$
3
  • $\begingroup$ What is your Sigma? $\endgroup$ May 20, 2020 at 20:20
  • $\begingroup$ I think I've got it to work with the code below for ONE process, but please do suggest something easier if there is an option: ListLinePlot[Transpose[simData[[2]][[1]][[1]][[1 ;;]]][[1]]] $\endgroup$
    – reemodels
    May 20, 2020 at 20:21
  • $\begingroup$ @SjoerdSmit It is: Sigma = {{1.0, 0, 0}, {0, 1.0, 0}, {0, 0, 1.0}}; $\endgroup$
    – reemodels
    May 20, 2020 at 20:22

1 Answer 1

1
$\begingroup$

I think you should be able to slice the different output dimensions with TimeSeriesMap. For example, to get the first component:

TimeSeriesMap[#[[1]]&, simData]

Similarly for the other two components.

$\endgroup$
1
  • $\begingroup$ It works. Thanks. $\endgroup$
    – reemodels
    May 20, 2020 at 20:27

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.