-
Notifications
You must be signed in to change notification settings - Fork 388
Add Ornstein–Uhlenbeck noise generator #3541
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
I have a minor change for the docs, and a question if there is a good use case we can use an example for this generator?
models/ou_noise_generator.h
Outdated
The correlation time constant :math:`\tau` of the process (ms). | ||
|
||
dt | ||
The interval :math:`\delta` between updates of the noise current (ms). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interval :math:`\delta` between updates of the noise current (ms). | |
The time interval between updates of the noise current (ms). |
@FinnBurkhardt Would you be able to address the open issues within a few days? I also added two minor suggestions. Please merge master into your branch for this PR to ensure that the testsuite works properly. |
Thanks, I’ve applied the suggested changes. For examples, I’d have two candidates at hand:
Would one (or both) be useful for the docs? |
@FinnBurkhardt if they are ready then we could take both. And you can add it to the doc/htmldoc/examples/index.rst page:
It also needs to be added to the I can also help with this if it's confusing! |
Add Ornstein–Uhlenbeck Noise Generator
This pull request adds a new
ou_noise_generator
device and corresponding pytest-based tests. The device generates temporally correlated current following an Ornstein–Uhlenbeck (OU). The tests verify both parameter handling and statistical properties.Model Implementation
Files added
models/ou_noise_generator.h
models/ou_noise_generator.cpp
pytests/sli2py_stimulating/test_ou_noise_generator.py
Process equation
The state variable (x) evolves as
where
($\mu$ ) (
mean
parameter) is the long-term mean of the process,($\sigma$ ) (
std
parameter) its stationary standard deviation,($\tau$ ) (
tau
parameter) is the time constant,dt
is the internal integration step.Integration and output
dt
.Tests (
test_ou_noise_generator.py
)Parameter setting and defaults
set()
andSetDefaults()
both correctly configure all parameters (mean
,std
,tau
,dt
).Error conditions
dt
not divisible bynest.resolution
raisesStepMultipleRequired
.Mean and variance
Autocorrelation
Cross-correlation