0
我在R中使用Sim.DiffProc
包来模拟Stratonovich随机积分。使用下面的代码,我可以模拟5个路径随机的从t = 0积分到t = 5:模拟随机积分
fun=expression(w) strat=st.int(fun, type="str", M=5, lower=0, upper=5)
我怎样才能获得随机的值鉴于st.int()
函数T = 5积分不会给出各个t中的值作为输出?
我在R中使用Sim.DiffProc
包来模拟Stratonovich随机积分。使用下面的代码,我可以模拟5个路径随机的从t = 0积分到t = 5:模拟随机积分
fun=expression(w) strat=st.int(fun, type="str", M=5, lower=0, upper=5)
我怎样才能获得随机的值鉴于st.int()
函数T = 5积分不会给出各个t中的值作为输出?
我不确定t = 5是什么意思。在$ X矩阵是次系列:
> str(strat)
List of 8
$ X : mts [1:1001, 1:5] 0.0187 0.0177 0.0506 0.0357 0.0357 ...
..- attr(*, "dimnames")=List of 2
.. ..$ : NULL
.. ..$ : chr [1:5] "X1" "X2" "X3" "X4" ...
..- attr(*, "tsp")= num [1:3] 0 5 200
..- attr(*, "class")= chr [1:3] "mts" "ts" "matrix"
$ fun : symbol w
$ type : chr "str"
$ subdivisions: int 1000
$ M : num 5
$ Dt : num 0.005
$ t0 : num 0
$ T : num 5
- attr(*, "class")= chr "st.int"
如果是价值矩阵的第五行是你的意思,那就是:
> (strat$X[5 , ])
X1 X2 X3 X4 X5
0.0031517578 0.0161278426 0.0003616453 0.0097594992 0.0012617410
大,输出X是我正在寻找。对于t = 5,我打算说不同路径的模拟的最后一个值,因此'(strat $ X [1001,])''。谢谢! – Egodym 2014-11-06 15:13:12