Skip to content

Commit

Permalink
Add UnobservedComponents (#228)
Browse files Browse the repository at this point in the history
* Add UnobservedComponents

* Added cycles

* remove unecessary mutable in some structs
  • Loading branch information
guilhermebodin authored Dec 23, 2020
1 parent ed221ac commit 1ff14db
Show file tree
Hide file tree
Showing 8 changed files with 485 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/StateSpaceModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ include("models/basicstructural.jl")
include("models/basicstructural_multivariate.jl")
include("models/sarima.jl")
include("models/linear_regression.jl")
include("models/unobserved_components.jl")

include("visualization/forecast.jl")

Expand All @@ -61,6 +62,7 @@ export Optimizer
export ScalarKalmanFilter
export StateSpaceModel
export UnivariateKalmanFilter
export UnobservedComponents

# Exported functions
export constrain_box!
Expand Down
2 changes: 1 addition & 1 deletion src/forecast.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mutable struct Forecast{Fl}
struct Forecast{Fl}
expected_value::Vector{Vector{Fl}}
covariance::Vector{Matrix{Fl}}
end
Expand Down
4 changes: 2 additions & 2 deletions src/kalman_filter_and_smoother.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Structure with the results of the Kalman filter:
* `Ptt`: variance of filtered state
* `Pinf`: diffuse part of the covariance
"""
mutable struct FilterOutput{Fl<:AbstractFloat}
struct FilterOutput{Fl<:AbstractFloat}
v::Vector{Vector{Fl}}
F::Vector{Matrix{Fl}}
a::Vector{Vector{Fl}}
Expand Down Expand Up @@ -186,7 +186,7 @@ Structure with the results of the smoother:
* `alpha`: smoothed state
* `V`: variance of smoothed state
"""
mutable struct SmootherOutput{Fl<:Real}
struct SmootherOutput{Fl<:Real}
alpha::Vector{Vector{Fl}}
V::Vector{Matrix{Fl}}

Expand Down
Loading

2 comments on commit 1ff14db

@guilhermebodin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/26848

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.4 -m "<description of version>" 1ff14db374f5866d054aad0e3fc8c1a942d0fe9a
git push origin v0.5.4

Please sign in to comment.