In [1]:
push!(LOAD_PATH, "$(pwd())/../src"); using PyPlot, StatsBase, Distributions, StochasticProcesses;

In [2]:
rms(a) = norm(a) / sqrt(length(a))
rms(process, result) = rms(result .- solution(process, result.t, result.b))


Out[2]:
rms (generic function with 2 methods)

Strong convergence

Brownian motion with drift:


In [11]:
let p=BrownianMotionWithDrift(.1, .2, 100.), q = 1.:20
    loglog(2.^(-q), (s -> rms(p, sim(p, linspace(0,1, 2^s), 1000))).(q))
end;


Geometric brownian motion:


In [9]:
let p=GeometricBrownianMotion(.1, .2, 100.), q = 1.:20
    loglog(2.^(-q), (s -> rms(p, sim(p, linspace(0,1, 2^s), 1000))).(q))
end;



In [5]:
# todo: weak convergence