Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Help with Wolfram Finance Platform.' topicStudent Support Forum > General > Archives > "Help with Wolfram Finance Platform."

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
05/21/13 6:38pm

In Response To 'Re: Re: Help with Wolfram Finance Platform.'
---------
It appears to me that the slides have an error.

The definition of BrownianMotionPaths in the slides is:

BrownianMotionPaths[period_, steps_Integer: 1000, paths_Integer, init_List]...

That expects
a period
an optional steps which must be an integer
a paths which must be an integer
an init which must be a list equal in length to paths.

You are using this as

BrownianMotionPaths[1, 250, 50]

in your plot that fails.

There is no list as the last argument.

If you evaluate

GOOGPrice* (1 + GOOGExpRet ConstantArray[1, {50, 251}] + BrownianMotionPaths[1, 250, 50]*GOOGVol)

just prior to your plot that doesn't work you will see this filled with BrownianMotionPaths[1, 250, 50] that it doesn't know how to evaluate because there is no list of length 50 for the fourth argument.

If I change that to

GOOGPrice* (1 + GOOGExpRet ConstantArray[1, {50, 251}] + BrownianMotionPaths[1, 250, 50, Table[0, {50}]]*GOOGVol)

(and I have NO idea whether that is the correct thing to do or not) then the result is a long list of lists of numbers.

If I make the same change inside your plot

ListLinePlot[GOOGPrice* (1 + GOOGExpRet ConstantArray[1, {50, 251}] + BrownianMotionPaths[1, 250, 50, Table[0, {50}]]*GOOGVol), AxesLabel -> {"Time", "St"}, PlotLabel -> Style["Simulated Google Price"]]

then I do get a bunch of overlaid listlineplots. Likewise for your next plot that doesn't work.

So, as I said in my previous post, when a function doesn't work then seeing the data will often show why it isn't working.

I'd suggest you contact the author of the slides and ask him if his slides are in error.

URL: ,

Subject (listing for 'Help with Wolfram Finance Platform.')
Author Date Posted
Help with Wolfram Finance Platform. Milan 05/20/13 11:19am
Re: Help with Wolfram Finance Platform. Bill Simpson 05/20/13 1:39pm
Re: Re: Help with Wolfram Finance Platform. Milan 05/21/13 08:51am
Re: Re: Re: Help with Wolfram Finance Platform. Bill Simpson 05/21/13 6:38pm
< Previous CommentHelp | Reply To Comment | Reply To Topic