Simulation with SDE object

조회 수: 12 (최근 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