Closed taqtiqa-mark closed 6 years ago
Thank you for the nice words. If you run into any obstacles, please contact me under my handle @mschauer on Julia's Discourse or Slack channels, see https://julialang.org/community/
LabelledArrays as state space are supported out of the Box:
using LabelledArrays
using ForwardDiff
using Bridge
State = @SLVector (:q, :p)
V(q) = q^2
T(p) = p^2
Hamiltonian(x) = V(x[1]) + T(x[2])
σ(t, x) = [0., 1.]
drift(t, x) = [1.0 0.0; 0.0 -1.0]*ForwardDiff.gradient(Hamiltonian, x)
x0 = State(1., 0.)
t = 0.:.001:1.0
W = sample(t, Wiener())
X = solve(Euler(), x0, W, (drift, σ))
Or do you refer to LabelledArrays
not as the state space but as representation for the trajectories? That would also not create problems in 1D simulations, for example by setting path(W) = (@SLVector (:t, :x))(W.tt, W.yy)
.
Thanks for the detailed response.
I was thinking about the possibility of performance side effects of using LabelledArrays for the trajectories in the context of likely needing to convert (extract?) to DataFrame.
An initial use case would be Multi(variate) 1D simulations, with the single Wiener process driving each 1D simulation possibly correlated with another driving Wiener process.
Eventually, all things working out, a natural simulation would be a Multi(variate) 4D simulation, with the single Wiener process driving each 4D simulation possibly correlated with another driving Wiener process. My nomenclature is possibly misleading, but hope that makes sense?
Still surprised at the Ruby-like convenience/sytnax-sugar Julia brings.... without the performance penalties.
Your neat example of state space using LabelledArrays is interesting - I still need to internalize what is going on.
You can use LabelledArrays for trajectories, it is not a very natural container though, because typically time is 1-dimensional and space is n-dimensional. You can look into https://github.com/mschauer/Trajectories.jl In any case, what ever you take, transformation between different vector based representations of trajectories is no problem at all.
Hi, Thanks for all your work in making Bridge.jl available. I'm new to Julia, and feeling my way in terms of leading/best-of-breed packages and idioms.
It seems to me that Bridge.jl is the best of breed diffusion simulating package - closely followed by the DiffEqNoiseProcess.jl, to my mind the BridgeDiffEq,jl supports that conclusion.
I am planning a package that likely would take as input an array such as that generated by Bridge.jl. In that context I hoped you might share your thoughts on the usefulness of adopting JuliaDiffEq/LabelledArrays.jl.