-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add Gaussian Noise Process submodule #62
Conversation
more on submodules here: https://docs.julialang.org/en/v1/manual/modules/ |
Codecov Report
@@ Coverage Diff @@
## master #62 +/- ##
=========================================
- Coverage 92.3% 79.5% -12.8%
=========================================
Files 15 23 +8
Lines 1165 1679 +514
=========================================
+ Hits 1075 1334 +259
- Misses 90 345 +255
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
src/IonSim.jl
Outdated
@@ -28,6 +28,17 @@ include("hamiltonians.jl") | |||
include("time_evolution.jl") | |||
include("species/include_species.jl") | |||
|
|||
module GaussianNoiseProcess |
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.
I recommend calling the module "noise" so you can use it like "IonSim.noise"
|
||
@inline wiener_randn(rng::AbstractRNG,::Type{T}) where T = randn(rng,T) | ||
|
||
# == Generators of Discrete AR/MA time series == # |
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.
These could be docstrings, correct?
src/noise/ARMA_NoiseProcess.jl
Outdated
|
||
# AR(p) Processes Step | ||
n = length(W.u) | ||
test = X.p >= n |
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.
What is test supposed to mean here?
src/noise/ARMA_NoiseProcess.jl
Outdated
return new_val - W.u[end] | ||
end | ||
|
||
@inline function (X::MA_Process)(dW,W,dt,u,p,t,rng) |
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.
What does this function do that the previous one doesn't do?
src/noise/ARMA_NoiseProcess.jl
Outdated
@inline function sinc_bridge(X,dW,W,W0,Wh,q,h,u,p,t,rng) | ||
|
||
# Brownian bridge correction term (added during interpolation) | ||
# iscontinuous(W) = true <- should fix to false |
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.
what does this mean?
src/noise/CARMA_NoiseProcess.jl
Outdated
using PyCall | ||
so = pyimport("scipy.optimize") | ||
|
||
@inline wiener_randn(rng::AbstractRNG,::Type{T}) where T = randn(rng,T) |
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.
Do you have to define this function every time?
src/noise/CARMA_NoiseProcess.jl
Outdated
|
||
@inline wiener_randn(rng::AbstractRNG,::Type{T}) where T = randn(rng,T) | ||
|
||
# == ARMAProcess: Generates ARMA Coefficients and Sinc-interpolated NoiseProcess == # |
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.
Are there wikipedia or research paper links for how these noise processes are generated? Could we link to them in the code?
src/noise/CARMA_NoiseProcess.jl
Outdated
# end | ||
|
||
function ReImCoeffSolver(x, α, κ, σ) | ||
t = x[1:length(x)÷2] |
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.
What is this doing?
src/noise/CARMA_NoiseProcess.jl
Outdated
acf::Vector | ||
end | ||
|
||
struct CARMAProcess |
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.
Why is CARMA only in one file but ARMA in three files?
src/noise/CARMA_NoiseProcess.jl
Outdated
|
||
# acf_iir = discrete.arma.sigma^2 .* [dot(discrete.arma.psi[1:end-i], discrete.arma.psi[1+i:end]) for i in 0:(length(discrete.arma.psi)-1)] | ||
# ys = discrete.arma.ma_acf[ts .+ 1] | ||
carma_α, _ = so.curve_fit((x,d...)->ReImCoeffSolver(x,collect(d),carma_κ, discrete.arma.sigma), [ts;ts], [ys;zeros(length(ys))], |
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.
what is this doing?
Goal after today: Make non-adaptive time-stepping the default |
Two things from Joe:
|
TODO::