Simulation with SDE object

13 次查看(过去 30 天)
Sam
Sam 2011-2-22
I have a 12 month horizon for 3 variables that I m trying to simulate. Here is what my code looks like, can you help fix the F and G function defintions
S = [ 1.2; 1.3; 1.5];
meanpath = [ 0 0.03 0.07 0.10 0.14 0.17 0.20 0.23 0.26 0.29 0.32 0.35; 0 0 0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 0 0 0 0 0 0];
vol = [0.14 ; 0.10 ; 0.12];
corr = [1 0.25 0.25; 0.25 1 0.25; 0.25 0.25 1];
F = @(t,X) diag(X) * meanpath(:,t+1); G = @(t,X) diag(X) * diag(sigma);
SDE = sde(F, G, 'Correlation', corr, 'StartState', S)
nPeriods = size(meanpath,2) NTrials = 10000; NSteps = 12; [siml_results,T] = SDE.simulate(nPeriods,'NTrials',NTrials, 'DeltaTime', dt);
Theres obviously something wrong with F and G but I cant figure out whats wrong here

回答(2 个)

Sam
Sam 2011-2-23
Essentially I m trying to simulate values around a given discrete mean path across 12 months.
Maybe theres a better way to do it. Any ideas ?

Peter Koetzing
Peter Koetzing 2013-3-22
I second this request! The Econometrics Toolbox is poorly documented and it's a pitty that no one offers help ...

类别

Help CenterFile Exchange 中查找有关 Physics 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by