I have a vector stochastic differential equation,
$$\mathrm dq = p\,\mathrm dt\qquad q(0)=0$$ $$\mathrm dp = (-q -p)\mathrm dt+\mathrm dW\qquad p(0)=10$$
This can be entered to give me the process describing either p or q, using
proc = ItoProcess[
{{p[t], -p[t]-q[t]}, {{0}, {1}}, XXX[t]},
{{q, p}, {0, 10}},
{t,0}
]
where XXX
is either q
or p
. The solution can be plotted using the usual method (here for p
) of
ListLinePlot@RandomFunction[proc, {0, 10, .02}, 10]
However, the situation is more difficult if I want to extract both q
and p
, as for each simulation it will give me a list of the type (obtained using Normal
, and by setting XXX[t]
to {q[t], p[t]}
in the ItoProcess
)
{{{t0, {q[t0], p[t0]}}, {t1, {q[t1], p[t1]}}, ...}
i.e. the times aren't properly distributed over the p/q, and as a consequence I'm having a hard time finding a good way of getting this into a plottable form.
So the questions are:
- Is there a nice way of getting all components out of a vector stochastic differential equation to plot them alongside each other?
- If there's none, what's the right hacky approach? Fiddling with
Transpose
andFlatten
?