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 Center および File ExchangePhysics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by