screenbean99

0 Reputation

2 Badges

14 years, 100 days

MaplePrimes Activity


These are questions asked by screenbean99

I have looked at the maple help for the ErrorPlot function, but i can't make it work for my plot. 

I have the following procedure:

K := 1.; Xrng := [seq(dt*i, i = 0 .. ntime)];

value := array(1 .. ntime+1);

ave := array(1 .. ntime+1);

for j to ntime+1 do:

discountfactor := exp(-r*j*dt);

Stot := 0.;

Stot1 := 0.;

for i to npath do:

Spath := max(Spot[i][j]-K, 0);

Stot := Stot+Spath;

I have an array of 2 vectors in a do loop, the vectors being i (path number) and j (time).

i goes from 0 to ntime, and j goes from 1 to ntime+1.

The array is called Spot[i][j] and i need to find the average of this array but dont know how.

Any help would be appreciated!

Thanks!

Page 1 of 1