On 13 Dec 2011, at 04:52, Taza wrote:
> the following script equation for the model is in matlab,
> % matlab script to generate assetpaths
> S = S0*[ones(1,nsims); ...
> cumprod(exp(nu*dt+sig*sqrt(dt)*randn(steps,nsims)),1)];
> am trying to apply the same concept in octave but it seems that iam having
> a problem with my cumulative product use in octave
why didn't you use exactly the same code in Octave?
that seems to work for me:
S0 = 50;
mu = 0.04;
sig = .1;
dt = 1/365;
steps = 50;
nsims = 15;
nu = mu - (sig^2/2);
S = S0*[ones(1,nsims); cumprod(exp(nu*dt+sig*sqrt(dt)*randn(steps,nsims)),1)];
size(S)
ans =
51 15
you'll have to provide more info if you want someone to understand what's going wrong for you.
Please don't send your code as images as images as it make it impossible to cut and paste to test.
c.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
If you reply to this email, your message will be added to the discussion below:
http://octave.1599824.n4.nabble.com/error-can-t-perform-indexing-operations-for-unknown-type-type-tp1625546p4188868.html
To unsubscribe from error: can't perform indexing operations for <unknown type> type,
click here.
NAML