« first day (1 day earlier)    last day (15 days later) » 

1:47 PM
Hi
are you there?
 
Hey
I'm here
 
thanks for coming
I have edited the code, but I am a little bit curious
could you please run this:
Remove["Global`*"]

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];
processesposition =
Flatten[Position[
Min[processes[[#]]] & /@
Range@Length[assets], _?(# > watermark &)]];
processesposition2 =
Flatten[Position[
Min[processes[[#]]] & /@
Range@Length[assets], _?(# > watermark2 &)]];
watermarkedassets = assets[[#]] & /@ processesposition;
First I am not sure if it is calculating the processes beyond or below the watermark correctly
 
It's calculating the number of processes below the watermarks...
 
Ok it's fine, that is the goal, but e.g. when I look at the chart, i only see one process at the end of the period below the watermark and according to the displayed value its 2
 
If you want to calculate the number of processes above the watermarks just use Length[assets]-Length[watermark]...
 
1:53 PM
Ok...however, its an visual problem. I made an update and still, according to the displayed value there are four processes below the watermark but I can see only one
do you also see it?
 
Give me all your defined values, pls
 
ok..here is the code:
 
Initial stock value = ?, Drift = ?, SD = ?, Paths = ?
That's the only think I need... I've run the code already
thing*
 
initial stock value=100; drift=0.08;SD=0.2;Path=6;Time=0;w=75;w2=70
I just used the initial values
 
Time can't be zero...
 
1:58 PM
t=10
 
ok
So, both watermarks have the same number of processes above it: 4
the total number of processes is 6
so, 4 divided by 6 equals 0.6666667
and that's what I get from the computation
Actually I've done a minor modification
and I'm getting correct values now
 
yes..but when you look at the chart, I see only one process below the watermark
 
No... that's wrong...
listen
 
yes?
 
when the minimum value of the process is below the watermark, it's not considered anymore in the calculation
I think what you want is:
when the final value of the process is below the watermark, it must be disconsidered from the calculation
it's completely different;;;
got it?
 
2:03 PM
yes...I got it...thank you a lot :)
 
so the calculation is based on minimum values
by the way
 
ok...thank you
 
do not use ToString[Length[processesposition]/Length[assets]]
use instead
ToString[N[Length[processesposition]/Length[assets]]
so that you can get a numerical value
from the division
 
Thank you a lot
 
It was a pleasure
 
2:07 PM
I would have just one more question if you have time
 
sure
 
but not so important if you are in hurry
 
go ahead
 
I posted today this question
0
Q: Manipulating and plotting two interdependent functions:

Milan IvicaI want to plot two functions. Function G8 and G9. Both should be manipulable. Function G9 should dependent on Function G8. Function G8 has a bigger starting value. If function G8 increases by δ function G9 should also increase by δ. And I want to manipulate δ. Manipulate[G8 := Plot[a, {x, 0, 8...

so given that I wat watermark2 to be dependent on watermark and that the difference between the watermarks which is delta can be manipulated. can i do it this way?
 
what exactly do you mean?
 
2:11 PM
I have watermakr and watermark2 lets sey that the difference between the two is delta
so if i increase the watermark by 1 than watermark2 also increases by 1
 
ok
oh I see
 
since the difference is delta I want to manipulate delat
 
you want actually a fixed interval between the two watermarks
 
so if I increase delta to 1,5
yes kind of
 
that's easy
imagine the follwing
 
2:12 PM
:)
yes?
 
given x and given y
 
you can set y to be equal to x + a
so you only need to manipulate a
let me see it really fast
1 sec
 
yes..in my case its delta
a=delta
do you mean it like this way?
Manipulate[G8 := Plot[a, {x, 0, 8}];
G9 := Plot[a - \[Delta], {x, 0, 8}, PlotStyle -> Red];
Show[G8, G9], {a, 4, 20, Appearance -> "Labeled"}, {\[Delta], 1, 20,
0.1, Appearance -> "Labeled"}]
 
Try this
Manipulate[x := y + delta;
Dynamic[x], {y, 1, 20, 1, Appearance -> "Labeled"}, {delta, 1, 20, 1,
Appearance -> "Labeled"}]
 
2:19 PM
thanks
 
got it ?
 
think so, is the code i sent to you also correct?
i mean this one?
Manipulate[G8 := Plot[a, {x, 0, 8}];
G9 := Plot[a - \[Delta], {x, 0, 8}, PlotStyle -> Red];
Show[G8, G9], {a, 4, 20, Appearance -> "Labeled"}, {\[Delta], 1, 20,
0.1, Appearance -> "Labeled"}]
 
I think so... I would improve it this way
Manipulate[G8 := Plot[a, {x, 0, 8}];
G9 := Plot[a - \[Delta], {x, 0, 8}, PlotStyle -> Red,
AxesOrigin -> {0, 0}];
Show[G8, G9], {a, 4, 20, Appearance -> "Labeled"}, {\[Delta], 1, 20,
0.1, Appearance -> "Labeled"}]
Just fix the AxesOrigin to better see your Plot
 
Thanks...I will try this not with the watermarks :-)
Thank you a lot for your help
 
ok! Good luck !
 
2:24 PM
thanks...I wish you a pleasant day
 
thank you! Tell me if you need anything else...
I'll be here for the next one hour or so...
 

« first day (1 day earlier)    last day (15 days later) »