Giter Club home page Giter Club logo

Comments (3)

mschauer avatar mschauer commented on June 19, 2024 1

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.

from bridge.jl.

mschauer avatar mschauer commented on June 19, 2024

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).

from bridge.jl.

taqtiqa-mark avatar taqtiqa-mark commented on June 19, 2024

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.

from bridge.jl.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.