Comments (7)
Thanks a lot for having a look,
I just went through the code that generates the moving average noise, but I Don't find the mistake... :(
function generate_noise(rng, N, σ, θ::Nothing)
noise = randn(rng, N)
if σ == 1.0
return noise
else
return σ .* noise
end
end
function generate_noise(rng, N, σ, θ::SVector{Q}) where {Q} # MA
ε = generate_noise(rng, N+Q, σ, nothing)
noise = zeros(N)
θ = -θ # this change is necessary due to the defining equation
# simply now do the average process
@inbounds for i in (Q+1):N
noise[i-Q] = bdp(θ, ε, i) + ε[i]
end
return noise
end
from arfima.jl.
version 0.3.1 will throw a warning anytime a non-nothing θ is given. Would be nice however if someone does a PR here (I'll review, but I won't fix this myself, as I don't know the problem).
from arfima.jl.
I have very limited time now, but I will try to find time to look into this. Great with a warning.
from arfima.jl.
Hi. I've tried to rewrite the noise and the auto regressive function in ARFIMA, but the result is the same (i.e. less noise in arma). So I tried to generate an AR and an ARMA series to compare.
let N = 1000,
σ = 1f0,
φ = SVector(1.625, -0.284, -0.355),
θ = SVector(0.96)
Random.seed!(1)
s1 = arma(N, σ, φ)
s1 = s1 ./ std(s1)
Random.seed!(1)
s2 = arma(N, σ, φ, θ)
s2 = s2 ./ std(s2)
p = plot()
plot!(p, s1; label = "AR(3)")
plot!(p, s2; label = "ARMA(3, 1)")
end
I suspect something is wrong with MA(q) sampling. Still, I'm no time series expert, just suggesting.
from arfima.jl.
Yes, something is off with MA part. Can you please put a warning on the front page? Lost quite a bit of time here trying to debug my code that used used your package to simulate data. But thanks for doing this, hope that you can get it to work properly soon.
Here is my check that AR(1) works, but MA(1) does not give the right autocorrelations:
`using ARFIMA, StatsBase
AR(1)
N = 10000
σ = 1
ϕ = 0.8
x = arfima(N, σ, nothing, SVector(ϕ))
estACF = autocor(x, 1:2) # First and second autocorrelation
theoreticalACF = [ϕ,ϕ^2]
estACF-theoreticalACF # Estimated Autocorrelation and theoretical are close. OK!
MA(1)
N = 10000
σ = 1
θ = -0.8
x = arfima(N, σ, nothing, nothing, SVector(θ))
estACF = autocor(x, 1:2) # First and second autocorrelation
theoreticalACF = [-θ/(1+θ^2),0]
estACF-theoreticalACF # Estimated Autocorrelation and theoretical are not close. Not OK!`
from arfima.jl.
The source code is really small, can you have a look and perhaps you find the mistake? I won't have time to fix this myself at the moment.
The moving average noise is generated here: https://github.com/JuliaDynamics/ARFIMA.jl/blob/master/src/ARFIMA.jl#L120-L129
but sure i'll put a warning
from arfima.jl.
If someone else has a go at this, here is a simulator for ARTFIMA (ARFIMA is the special case with \lambda = 0) using RCall that can be useful for testing:
using RCall
R"library(artfima)"
function artsim(n, d, λ, ϕ, θ, μ, σ²)
R"""
x = artsim(n = $n, d =
"""
@rget x
return x
end
from arfima.jl.
Related Issues (5)
- Stranbo integration HOT 12
- TagBot trigger issue HOT 3
- SARIMAX HOT 4
- Math image in README is hard to read in dark mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arfima.jl.