-
Notifications
You must be signed in to change notification settings - Fork 25
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
Expectation and Variance #18
Labels
Comments
With the exception of some very simple systems, the mean and variance would just be estimated from a sample, after simulating multiple sample paths. |
Dear Matt,
I thought, mean and variance of the solution of a stochastic differential
equation could also be obtained by a integration - but of course, I am not
sure.
(Would the mean not simply be the integration of the deterministic part of
the system, that is without the „dW“ part?)
Of course, they way you propose makes sense and certainly would be fast and
simple!
Take care, Peter
On Sun 13. Feb 2022 at 08:12 Matthew Aburn ***@***.***> wrote:
With the exception of some very simple systems, the mean and variance
would just be estimated from a sample, after simulating multiple sample
paths.
It is quite quick to do that using numpy after simulation (or during
iterated simulation), so I think not necessary to add this to sdeint itself.
—
Reply to this email directly, view it on GitHub
<#18 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT5MQUXDZGJ4LTVW7HJ23GDU25KWRANCNFSM5CR4YXNA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Best regards,
Peter Stahlecker
|
Dear Matt,
I checked around my book on stochastic calculus a bit ( I am just a semi
retired sales man, not a scientist or mathematician)
The SDE your program solves looks like this:
dX = f(F, t) * dt + G(X, t) * dW
Now, what I think I found is this:
1.
m(t) := E[X(t)] is the solution of: dm/dt = f(m, t)
2.
Var(t) : = E[X(t)*X(t).T] is the solution of: dVar/dt = G(X, t) * G(X, t).T
I feel quite sure about point 1, but not very sure about point 2. Unless
G(X, t) has some special form, how does one get a ODE of the form) dVar/dt
= F(Var, t) ?
Any help is highly appreciated!
Thanks, Peter
On Sun 13. Feb 2022 at 10:37 Peter Stahlecker ***@***.***>
wrote:
Dear Matt,
I thought, mean and variance of the solution of a stochastic differential
equation could also be obtained by a integration - but of course, I am not
sure.
(Would the mean not simply be the integration of the deterministic part
of the system, that is without the „dW“ part?)
Of course, they way you propose makes sense and certainly would be fast
and simple!
Take care, Peter
On Sun 13. Feb 2022 at 08:12 Matthew Aburn ***@***.***>
wrote:
> With the exception of some very simple systems, the mean and variance
> would just be estimated from a sample, after simulating multiple sample
> paths.
> It is quite quick to do that using numpy after simulation (or during
> iterated simulation), so I think not necessary to add this to sdeint itself.
>
> —
> Reply to this email directly, view it on GitHub
> <#18 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AT5MQUXDZGJ4LTVW7HJ23GDU25KWRANCNFSM5CR4YXNA>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
--
Best regards,
Peter Stahlecker
--
Best regards,
Peter Stahlecker
|
Hi Peter, |
Dear Matt,
Thanks for your prompt reply, even if disappointing! :-))
I thought, Expectation[ integral (f(X, t) * dW) ] = 0 , for any
'reasonable' f(X, t), and W ...white noise ?
Anyway, I have to accept that no closed formula is available.
Thanks & take care!
Peter
Am Mo., 14. Feb. 2022 um 01:29 Uhr schrieb Matthew Aburn <
***@***.***>:
… Hi Peter,
Both 1. and 2. are false in general.
—
Reply to this email directly, view it on GitHub
<#18 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT5MQUSCR3HA7HLFIIZUQTTU3BEHNANCNFSM5CR4YXNA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Dear Matt,
I think, I finally understood: I guess the reason is that E [ f(x(t) ] not
equal to f ( E[ x(t) ] ) in general.
Is my thinking on the right track?
Thanks, Peter
Am Mo., 14. Feb. 2022 um 07:30 Uhr schrieb Peter Stahlecker <
***@***.***>:
… Dear Matt,
Thanks for your prompt reply, even if disappointing! :-))
I thought, Expectation[ integral (f(X, t) * dW) ] = 0 , for any
'reasonable' f(X, t), and W ...white noise ?
Anyway, I have to accept that no closed formula is available.
Thanks & take care!
Peter
Am Mo., 14. Feb. 2022 um 01:29 Uhr schrieb Matthew Aburn <
***@***.***>:
> Hi Peter,
> Both 1. and 2. are false in general.
>
> —
> Reply to this email directly, view it on GitHub
> <#18 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AT5MQUSCR3HA7HLFIIZUQTTU3BEHNANCNFSM5CR4YXNA>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Dear Matt,
I obviously like to play around with your sdeint program, hence my question:
I have created an equation of motion of some mechanical system, as I do it
with sympy.phisics.mechanics, it is of the form
dX(t) = rhs(X(t), t, F), where F are external forces, which I want to
model as white noise. Say dim(X) = n, dim(F) = m
1. I create: G(X, t) = rhs.jacobian(F) ( dim(G) = (n x m )
2. I create: f(X, t) = rhs(X, t, F).substitue(F_i = 0., i = 1, .., m)
3. I integrate dX(t) = f(X, t) dt + G(X, t) dW
using your program sdeint.
Is this the proper approach?
Thanks a lot, Peter
On Fri 18. Feb 2022 at 15:03 Peter Stahlecker ***@***.***> wrote:
Dear Matt,
I think, I finally understood: I guess the reason is that E [ f(x(t) ]
not equal to f ( E[ x(t) ] ) in general.
Is my thinking on the right track?
Thanks, Peter
Am Mo., 14. Feb. 2022 um 07:30 Uhr schrieb Peter Stahlecker <
***@***.***>:
> Dear Matt,
>
> Thanks for your prompt reply, even if disappointing! :-))
> I thought, Expectation[ integral (f(X, t) * dW) ] = 0 , for any
> 'reasonable' f(X, t), and W ...white noise ?
> Anyway, I have to accept that no closed formula is available.
> Thanks & take care!
>
> Peter
>
>
>
>
> Am Mo., 14. Feb. 2022 um 01:29 Uhr schrieb Matthew Aburn <
> ***@***.***>:
>
>> Hi Peter,
>> Both 1. and 2. are false in general.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#18 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AT5MQUSCR3HA7HLFIIZUQTTU3BEHNANCNFSM5CR4YXNA>
>> .
>> Triage notifications on the go with GitHub Mobile for iOS
>> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
>> or Android
>> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>>
>> You are receiving this because you authored the thread.Message ID:
>> ***@***.***>
>>
> --
Best regards,
Peter Stahlecker
|
Dear Matt,
Is there a way to pass arguments to the itoint routine of your package?
The examples do not seem to show it - but I might very well be wrong!
Thanks!
Peter
On Fri 18. Feb 2022 at 17:19 Peter Stahlecker ***@***.***>
wrote:
Dear Matt,
I obviously like to play around with your sdeint program, hence my
question:
I have created an equation of motion of some mechanical system, as I do it
with sympy.phisics.mechanics, it is of the form
dX(t) = rhs(X(t), t, F), where F are external forces, which I want to
model as white noise. Say dim(X) = n, dim(F) = m
1. I create: G(X, t) = rhs.jacobian(F) ( dim(G) = (n x m )
2. I create: f(X, t) = rhs(X, t, F).substitue(F_i = 0., i = 1, .., m)
3. I integrate dX(t) = f(X, t) dt + G(X, t) dW
using your program sdeint.
Is this the proper approach?
Thanks a lot, Peter
On Fri 18. Feb 2022 at 15:03 Peter Stahlecker ***@***.***>
wrote:
> Dear Matt,
>
> I think, I finally understood: I guess the reason is that E [ f(x(t) ]
> not equal to f ( E[ x(t) ] ) in general.
> Is my thinking on the right track?
> Thanks, Peter
>
> Am Mo., 14. Feb. 2022 um 07:30 Uhr schrieb Peter Stahlecker <
> ***@***.***>:
>
>> Dear Matt,
>>
>> Thanks for your prompt reply, even if disappointing! :-))
>> I thought, Expectation[ integral (f(X, t) * dW) ] = 0 , for any
>> 'reasonable' f(X, t), and W ...white noise ?
>> Anyway, I have to accept that no closed formula is available.
>> Thanks & take care!
>>
>> Peter
>>
>>
>>
>>
>> Am Mo., 14. Feb. 2022 um 01:29 Uhr schrieb Matthew Aburn <
>> ***@***.***>:
>>
>>> Hi Peter,
>>> Both 1. and 2. are false in general.
>>>
>>> —
>>> Reply to this email directly, view it on GitHub
>>> <#18 (comment)>,
>>> or unsubscribe
>>> <https://github.com/notifications/unsubscribe-auth/AT5MQUSCR3HA7HLFIIZUQTTU3BEHNANCNFSM5CR4YXNA>
>>> .
>>> Triage notifications on the go with GitHub Mobile for iOS
>>> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
>>> or Android
>>> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>>>
>>> You are receiving this because you authored the thread.Message ID:
>>> ***@***.***>
>>>
>> --
Best regards,
Peter Stahlecker
--
Best regards,
Peter Stahlecker
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I love to play around (that is all I am doing, I am semi retired) with SDEINT.
It gives possible realizations of the stochastic system. ( I usually use sympy.physics.mechanics to get equations of motion for some mechanical system, and then ‚exite it‘ with white noise forces).
It would be nice, if in addition, one could get the expectation and the variance of the solution.
Something like:
R, E, V = itoint(f, G, times, all=True) giving everything
R = itoint(f, G, times, all=False) giving only a realisation
Just a thought.
The text was updated successfully, but these errors were encountered: