last day (17 days later) » 

3:38 PM
1
A: Displaying Values of Fuction at end of Period by Grid

Rod LmMilan, the easiest way to do it is by using Dynamic[]. Manipulate[SeedRandom[seed]; meanvector := Mean[assets]; assets = Table[RandomFunction[GeometricBrownianMotionProcess[\[Mu], \[Sigma], S0], {0, time, 0.1}]["Path"], {P}]; processes = Transpose[assets[[#]]][[2]] & /@ Range@Length[assets]; pro...

 
Two thumbs up for you! :D
@ Rod Lm thank you again. I have just tried to modify your code slightly by just introducing a second watermark and a third mean process. I think there is one error in my code, or I am maybe not considering here. can I post my code somewhere here without asking a new question? because its just a slight chante?
 
@MilanIvica What exactly do you want to do? Maybe I can help you...
 
@ Rod Lm Just introduce a second watermark which is lower than the first one. and also calculate the mean of all processes which remain beyond the second watermark. so exactly the same but just one watermark more which is lower than the first one
 
@MilanIvica Maybe you could try to define watermark2 and compute it's mean exactly as for the original watermark variable.
 
@ Rod Lm I did it. I think I am not considering sth. I fact I copied everything and just added "2" so e.g.: processesposition =
Flatten[Position[
Min[processes[[#]]] & /@
Range@Length[assets], _?(# > watermark &)]]; processesposition2 =
Flatten[Position[
Min[processes[[#]]] & /@
Range@Length[assets], _?(# > watermark2 &)]];...etc. However, I get the following error: "Part::partw: Part {3} of {{0.,10.},{3.4834,6.56693}} does not exist. >>"
@ Rod Lm could the error be here?: G1 := ListLogPlot[assets,
GridLines -> {{}, {watermark}, {watermark2}},
GridLinesStyle -> {Directive[Green, Thick],
Directive[Orange, Thick]}, Joined -> True,
AxesLabel -> {"Time", "St"},
PlotLabel ->
Style["Forecasted Stock Price\n (Brownian Motion)", Bold],
PlotRange -> All, PlotStyle -> Directive[{Thin, Lighter@Gray}]];
or here: G2 := ListLogPlot[{meanvector, watermarkedmeanvector,
watermarkedmeanvector2}, Joined -> True,
PlotStyle -> {Directive[{Thick, Darker@Red}],
Directive[{Thick, Darker@Blue}],
Directive[{Thick, Darker@Pink}]}];
 
3:38 PM
@MilanIvica You can't use GridLines -> {{}, {watermark}, {watermark2}}... I think this is the error. You could try to insert GridLines -> {{}, {watermark} for the G1 plot and GridLines -> {{}, {watermark2} for the G2 plot...
 
@ Rod Lm Thanks: I will try to figure it out :)
@ Rod Lm Its better now, but I still get the error:Part::partw: Part {3} of {{0.,10.},{3.4834,6.56693}} does not exist. >>; I did: G2 := ListLogPlot[{meanvector, watermarkedmeanvector,
watermarkedmeanvector2, GridLines -> {{}, {watermark2}},
GridLinesStyle -> {Directive[Orange, Thick]},}, Joined -> True,
PlotStyle -> {Directive[{Thick, Darker@Red}],
Directive[{Thick, Darker@Blue}],
Directive[{Thick, Darker@Pink}]}]; But maybe the mistake is here: watermarkedassets2 =
assets[[#]] & /@ processesposition2; watermarkedmeanvector2 =
 
Hello Ivan
Are you still there?
 

  last day (17 days later) »