`DynamicLinearModels.DLMPlot`

— Type`DLMPlot`

Indicator type for plotting recipe.

`DynamicLinearModels.check_dimensions`

— Method`check_dimensions(F, G[; V, W, Y])`

Utility function that checks for dimension mistmatches in the given arguments and returns the dimensions for the observations and for the state-space.

`DynamicLinearModels.compute_prior`

— Method`compute_prior(Y, F, m₀, C₀)`

Utility function for computing a smart prior that's not informative and at the same does not lead to numerical or visualization issues. Only takes effect if one of `m₀`

is `C₀`

is `nothing`

, otherwise it just returns `m₀`

and `C₀`

.

`DynamicLinearModels.estimate`

— Method`estimate(Y, F, G, η, δ[, m₀, C₀; maxit, ϵ])`

Obtains maximum a posteriori estimates for the states and observational covariance matrix for a Dynamic Linear Model (`F`

, `G`

), considering a discount factor `δ`

for the evolutional covariance matrices, and weighted replicates. Prior parameters `m₀`

and `C₀`

may be omitted, in which case `compute_prior`

kicks in to assign a prior. Parameters `maxit`

and `ϵ`

control the maximum number of iterations and the numerical precision for early convergence for the Coordinate Descent algorithm, respectively.

Returns point estimates for the states `θ`

and point estimate for the covariance matrix `V`

. Also returns the number of iterations until convergence. If negative, it means the algorithm stopped from reaching the maximum number of iterations.

`DynamicLinearModels.estimate`

— Method`estimate(Y, F, G, η, δ[, m₀, C₀; maxit, ϵ])`

Obtains maximum a posteriori estimates for the states and observational covariance matrix for a Dynamic Linear Model (`F`

, `G`

), considering a discount factor `δ`

for the evolutional covariance matrices, and dynamically weighted replicates. Prior parameters `m₀`

and `C₀`

may be omitted, in which case `compute_prior`

kicks in to assign a prior. Parameters `maxit`

and `ϵ`

control the maximum number of iterations and the numerical precision for early convergence for the Coordinate Descent algorithm, respectively.

Returns point estimates for the states `θ`

and point estimate for the covariance matrix `V`

. Also returns the number of iterations until convergence. If negative, it means the algorithm stopped from reaching the maximum number of iterations.

`DynamicLinearModels.estimate`

— Method`estimate(Y, F, G, δ[, m₀, C₀; maxit, ϵ])`

Obtains maximum a posteriori estimates for the states and observational covariance matrix for a Dynamic Linear Model (`F`

, `G`

), considering a discount factor `δ`

for the evolutional covariance matrices. Prior parameters `m₀`

and `C₀`

may be omitted, in which case `compute_prior`

kicks in to assign a prior. Parameters `maxit`

and `ϵ`

control the maximum number of iterations and the numerical precision for early convergence for the Coordinate Descent algorithm, respectively.

Returns point estimates for the states `θ`

and point estimate for the covariance matrix `V`

. Also returns the number of iterations until convergence. If negative, it means the algorithm stopped from reaching the maximum number of iterations.

`DynamicLinearModels.evolutional_covariances`

— Method`evolutional_covariances(Y, F, G, V, η, δ[, m₀, C₀])`

Compute the implied values of the evolutional covariances W[1], ..., W[T] when considering a discount factor approach, and weighted replicates.

`DynamicLinearModels.evolutional_covariances`

— Method`evolutional_covariances(Y, F, G, V, δ[, m₀, C₀])`

Compute the implied values of the evolutional covariances W[1], ..., W[T] when considering a discount factor approach, and dynamically weighted replicates.

`DynamicLinearModels.evolutional_covariances`

— Method`evolutional_covariances(Y, F, G, V, δ[, m₀, C₀])`

Compute the implied values of the evolutional covariances W[1], ..., W[T] when considering a discount factor approach.

`DynamicLinearModels.extract`

— Method`extract(x, index)`

Utility function that facilitates fetching the time series as a vector for one the objects used in the package.

If `x`

is a `Vector{Vector{RT}}`

it returns `[x[t][index] for t = 1:T]`

; If `x`

is a `Vector{CovMat{RT}}`

it returns `[x[t][index,index] for t = 1:T]`

.

`DynamicLinearModels.fitted`

— Method`fitted(F, V, m, C)`

Computes the fitted values for the data, for a model with observational matrix `F`

, evolutional covariance matrix `V`

, and state means `m`

and `C`

. Note that this can be done with the one-step ahead priors, online parameters or, more appropriately, smoother results.

Returns observational means and covariances `f`

and `Q`

.

`DynamicLinearModels.forecast`

— Method`forecast(F, G, V, W, μ, Σ, h)`

Filtering routine for the Dynamic Linear Model (`F`

, `G`

) where the observational and evolutional covariance matrices `V`

and `W`

are known and constant. `μ`

and `Σ`

are the mean and covariance matrix for the last state given the most recent information, and `h`

is the forecasting window.

Returns observational means and covariances `f`

and `Q`

.

`DynamicLinearModels.forecast`

— Method`forecast(F, G, V, δ, μ, Σ, h)`

Filtering routine for the Dynamic Linear Model (`F`

, `G`

) where the observational covariance matrix `V`

is known and constants, and evolutional covariance matrices W[1], ..., W[T] are indirectly modeled through a discount factor `δ`

. `μ`

and `Σ`

are the mean and covariance matrix for the last state given the most recent information, and `h`

is the forecasting window.

Returns observational means and covariances `f`

and `Q`

.

`DynamicLinearModels.from_matrix`

— Method`from_matrix(x)`

Converts a matrix to a vector of vector.

`DynamicLinearModels.kfilter`

— Method`kfilter(Y, F, G, V, δ[, m₀, C₀])`

Filtering routine for a discount factor Dynamic Linear Model (`F`

, `G`

) where the observational covariance matrices `V[1], …, V[T]`

are known and evolutional covariance matrices `W[1], ..., W[T]`

are indirectly modelled through a discount factor `δ`

. See West & Harrison (1996) for further information of the discount factor apporach. `Y`

is the matrix of observations with `T`

rows and `n`

columns. Prior parameters `m₀`

and `C₀`

may be omitted, in which case `compute_prior`

kicks in to assign a prior.

Returns one-step ahead prior means and covariances `a`

and `R`

, and online means and covariances `m`

and `C`

.

`DynamicLinearModels.kfilter`

— Method`kfilter(Y, F, G, V, η, δ[, m₀, C₀])`

Filtering routine for a discount factor Dynamic Linear Model (`F`

, `G`

) where the observational covariance matrix `V`

is known and constants and evolutional covariance matrices `W[1], ..., W[T]`

are indirectly modelled through a discount factor `δ`

and observations have replications. `Y`

is the matrix of observations with `T`

rows and `n * nreps`

columns, each replicate with a weight`η[i]`

. Prior parameters `m₀`

and `C₀`

may be omitted, in which case `compute_prior`

kicks in to assign a prior.

Returns one-step ahead prior means and covariances `a`

and `R`

, and online means and covariances `m`

and `C`

.

`DynamicLinearModels.kfilter`

— Method`kfilter(Y, F, G, V, η, δ[, m₀, C₀])`

Filtering routine for a discount factor Dynamic Linear Model (`F`

, `G`

) where the observational covariance matrix `V`

is known and constants and evolutional covariance matrices `W[1], ..., W[T]`

are indirectly modelled through a discount factor `δ`

and observations have replications. `Y`

is the matrix of observations with `T`

rows and `n * nreps`

columns, each replicate with dynamic weights `η[t,i]`

. Prior parameters `m₀`

and `C₀`

may be omitted, in which case `compute_prior`

kicks in to assign a prior.

Returns one-step ahead prior means and covariances `a`

and `R`

, and online means and covariances `m`

and `C`

.

`DynamicLinearModels.kfilter`

— Method`kfilter(Y, F, G, V, W[, m₀, C₀])`

Filtering routine for the Dynamic Linear Model (`F`

, `G`

) where the observational and evolutional covariance matrices `V`

and `W`

are known and constant. `Y`

is the matrix of observations with `T`

rows and `n`

columns. Prior parameters `m₀`

and `C₀`

may be omitted, in which case `compute_prior`

kicks in to assign a prior.

`a`

and `R`

, and online means and covariances `m`

and `C`

.

`DynamicLinearModels.kfilter`

— Method`kfilter(Y, F, G, V, δ[, m₀, C₀])`

Filtering routine for a discount factor Dynamic Linear Model (`F`

, `G`

) where the observational covariance matrix `V`

is known and constant and evolutional covariance matrices `W[1], ..., W[T]`

are indirectly modelled through a discount factor `δ`

. See West & Harrison (1996) for further information of the discount factor apporach. `Y`

is the matrix of observations with `T`

rows and `n`

columns. Prior parameters `m₀`

and `C₀`

may be omitted, in which case `compute_prior`

kicks in to assign a prior.

`a`

and `R`

, and online means and covariances `m`

and `C`

.

`DynamicLinearModels.ksmoother`

— Method`ksmoother(G, a, R, m, C)`

Filtering routine for a Dynamic Linear Model ( ⋅, `G`

), where `a`

and `R`

are the filtered one-step ahead prior means and covariances, and `m`

and `C`

are the filtered online means and covariances.

Returns the posterior means and covariances `s`

and `S`

.

`DynamicLinearModels.simulate`

— Method`simulate(F, G, V, W, θ₀, T[, nreps])`

Simulates a time-series Dynamic Linear Model specified by the quadruple (`F`

, `G`

, `V`

, `W`

) with a starting state of `θ₁ <- Nₚ(G θ₀, W)`

, with `T`

observations. A parameter `nreps`

may be passed indicating the number of replicates to be generated. Returns the generated `θ`

and `y`

.

Note that the parametrizations being considered in this package is such that `y[t] = F * y[t-1] + ϵ`

and not the notation from West and Harrison (1996) where `y[t] = F' * y[t-1] + ϵ`

.

`DynamicLinearModels.to_matrix`

— Method`to_matrix(x)`

Converts a vector of vectors to a matrix.

`DynamicLinearModels.CovMat`

— Type`CovMat`

Alias for symmetric, real valued, dense matrices.

`DynamicLinearModels.exclude_low_weights`

— Method`exclude_low_weights(Y, η, ϵ)`

Internal function which returns a version of the original `Y`

and `η`

variables, containing only the observations with weights above `ϵ`

.

`DynamicLinearModels.kfilter_core`

— Method`kfilter_core(y, F, G, V, W, a, R)`

Internal function which actually performs the computation step.

`DynamicLinearModels.kfilter_core`

— Method`kfilter_core(y, F, G, V, W, a, R)`

Internal function which actually performs the computation step.

`RecipesBase.apply_recipe`

— Method`plot(::DLMPlot, Y, f, Q[, fh, Qh; factor = 1.64, index = 1])`

Recipe for easily plotting the results obtained by the package routines, where `Y`

is the observations matrix, `f`

and `Q`

are results from `fitted`

, and `fh`

and `Qh`

are the results from `forecast`

. Factor implies the credibility or the credibility intervals interval, e.g. a factor of 1.64 implies a credibility of 90%. Index indicates which observational index is to be plotted.