I intend to do the following: I want to forecast future stock price under the following assumptions: The stock price is governed by the stochastic differential equation:
dS = μSdt + σSdWt
whereas dW_t~N(0,√dt)
In the first step I want to define the Brownian Motion for one path and for multiple paths, which is done by:
1Path:
BrownianMotion[period_, steps_Integer: 1000, init_: 0] := Accumulate[
Prepend[RandomVariate[NormalDistribution[0, Sqrt[period/steps]],
steps], init]]
ListLinePlot[BrownianMotion[1,1000], AxesLabel->{"Time",B_t},
PlotLabel -> Style["Stochastic Brownian Motion",Bold]]
Multiple Paths:
BrownianMotionPaths[period_, steps_Integer: 1000, paths_Integer, init_List]
/; (Length[init] == paths) := Transpose[
Accumulate[
Prepend[RandomVariate[NormalDistribution[0, Sqrt[period/ steps ]],
{steps, paths}], init]]]
ListLinePlot[BrownianMotionPaths[1, 1000, 50,
ConstantArray[0.5, 50]],
AxesLabel->{"Time",B_t},
PlotLabel -> Style["Stochastic Brownian Motion",Bold]]
So I get the following, which works perfectly for one path:
μ2 = 0.01; σ2 = 0.3; S2 = 100;
ListLinePlot[S2*(1+μ2ConstantArray[1,251] + BrownianMotion[1, 250]*σ2),
AxesLabel→{"Time","St"},
PlotLabel -> Style["Price by proxy data"],
PlotRange -> All]
NOW I want to manipulate S2,μ2, and σ2. In order to do so, I entered the following code:
Manipulate[
ListLinePlot[S1*(1 + μ1 ConstantArray[1, 251] + BrownianMotion[1, 250] * σ2),
AxesLabel -> {"Time", "St"},
PlotLabel -> Style["Price by proxy data"],
PlotRange -> All],
{S1, 100, 500, Appearance -> "Labeled"},
{μ1, 0, 1, Appearance -> "Labeled"},
{σ1, 0, 1, Appearance -> "Labeled"}]
It works, but the results must be wrong, because when I choose Sigma to be small and increase Mu drastically, I should get something which looks like an exponentially increasing function, because the function is driven heavily by the drift. However, according to my code this is not the case. So something must be wrong.
Does anybody have a solution when I want to manipulate the start value (S1), Sigma, and Mu, for one and for multiple paths?

\[Mu], and you're calling a functionBrownianMotion1that isn't there, and your Manipulate is varying a\[Sigma]1that I can't see. Keep editing! :) – cormullion May 24 '13 at 17:54