Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definition of g #91

Open
ArnoStrouwen opened this issue Nov 13, 2022 · 3 comments
Open

Definition of g #91

ArnoStrouwen opened this issue Nov 13, 2022 · 3 comments

Comments

@ArnoStrouwen
Copy link
Member

From the docstring:
π•Œ = Initial condition space, β„™ = model parameter space
g: π•Œ Γ— β„™ β†’ β„βΏα΅’α΅˜α΅—
But this cannot be true since you can calculate expectation at multiple or even infinite time-points.
It is more like:
g: π•Œ Γ— 𝕋 Γ— β„™ β†’ β„βΏα΅’α΅˜α΅— ,
where 𝕋 is the time-space.
π•Œ Γ— 𝕋 is then the solution space, which is how g is implemented in practice.

and possibly also better to call π•Œ state space rather than initial condition space.

@agerlach
Copy link
Contributor

I think you are correct regarding g and what I called π•Œ. We should change the signature for the observable to be g(u, p, t) to match the eom. I also think we should consider swapping the definitions of π•Œ and and 𝕏 to "𝕏 = states space, π•Œ = uncertainty space."

What I am struggling with is that this doesn't fit directly with what we typically see in the Koopman literature. What you are proposing is more general and is what we should do though. In Koopman you typically consider some map $S_t: \mathbb{R}^n\rightarrow\mathbb{R}^n$, however in general when we solve the ODE we actually get a set of maps $\lbrace S_\tau \mid \tau \in tstops \rbrace$ or a continuum of maps when using interpolation $\lbrace S_t \mid t \in \left[0, t_f\right]\rbrace$.

What about this? Here all the domains and ranges match up for the composition $g\circ S\circ h$ as they should.

Let 𝕏 = states space space, π•Œ = uncertainty space, β„™ = model parameter space, 𝕋 = time-space

  • S: 𝕏 Γ— β„™ β†’ 𝕏 Γ— β„™ Γ— 𝕋
  • g: 𝕏 Γ— β„™ Γ— 𝕋 β†’ β„βΏα΅’α΅˜α΅— also known as the observables or output function.
  • h: π•Œ Γ— β„™ β†’ 𝕏 Γ— β„™, cov(input_func).
  • pdf(d,x): π•Œ β†’ ℝ the uncertainty distribution of the initial states.

@agerlach
Copy link
Contributor

@ArnoStrouwen after thinking about this more, I don't think the signature should be g(u,p,t). Instead it should be g(sol::DESolution, p) (and iip). The DESolution contains both $\mathbb{X}$ and $\mathbb{T}$. With the signature proposed above you can't interpolate the solution.

I also question if the docs need to be so complicated to include the mappings. I probably makes more sense to just explain the function in sentences and with code snippets.

@ArnoStrouwen
Copy link
Member Author

ArnoStrouwen commented Dec 7, 2022

You can also access p by doing sol.prob.p so you only need sol.
I agree that defining these sets is not needed for the documentation, and that an explanation in words is superior.
But I think we need better names for things like g and h because I don't think it currently is very clear what they do.

The current text is:
https://docs.sciml.ai/SciMLExpectations/dev/tutorials/introduction/

ExpectationProblem takes a SystemMap, which contains the ODEProblem that we are working with, and how to solve it. The function of interest g, which maps the solution of the ODEProblem to the quantities you want to take the expectation of, in this case the state after 4 seconds. A GenericDistribution containing all the aspects of the dynamical system you are uncertain about, in this example this is the initial condition. The function h, which maps a realization of the uncertainty space to the initial conditions and parameters of the ODEProblem. Here only the initial conditions are uncertain, while the parameters are deterministic. See further down for an example with both uncertain initial conditions and parameters.

But this should be made even clearer, and also incorporated into the docstrings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants