Simulation with SDE object

14 vues (au cours des 30 derniers jours)
Sam
Sam le 22 Fév 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

Réponses (2)

Sam
Sam le 23 Fév 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 le 22 Mar 2013
I second this request! The Econometrics Toolbox is poorly documented and it's a pitty that no one offers help ...

Catégories

En savoir plus sur Physics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by