Simulation with SDE object

13 Ansichten (letzte 30 Tage)
Sam
Sam am 22 Feb. 2011
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

Antworten (2)

Sam
Sam am 23 Feb. 2011
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 am 22 Mär. 2013
I second this request! The Econometrics Toolbox is poorly documented and it's a pitty that no one offers help ...

Kategorien

Mehr zu Physics finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by