help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error: can't perform indexing operations for <unknown type> type


From: Taza
Subject: Re: error: can't perform indexing operations for <unknown type> type
Date: Tue, 13 Dec 2011 02:02:39 -0800 (PST)

thanx a lot, it worked well for me also, i just had to make a few adjustments. it can give the result well now.


From: c.-2 [via Octave] <[hidden email]>
To: Taza <[hidden email]>
Sent: Monday, December 12, 2011 9:19 PM
Subject: Re: error: can't perform indexing operations for <unknown type> type


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




View this message in context: Re: error: can't perform indexing operations for <unknown type> type
Sent from the Octave - General mailing list archive at Nabble.com.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]