Markov Models
Fill me in
VLQuantitativeFinancePackage.MyHiddenMarkovModel
— Typemutable struct MyHiddenMarkovModel <: AbstractMarkovModel
The MyHiddenMarkovModel
mutable struct represents a hidden Markov model (HMM) with discrete states.
Required fields
states::Array{Int64,1}
: The states of the modeltransition::Dict{Int64, Categorical}
: The transition matrix of the model encoded as a dictionary where thekey
is the state and thevalue
is aCategorical
distributionemission::Dict{Int64, Categorical}
: The emission matrix of the model encoded as a dictionary where thekey
is the state and thevalue
is aCategorical
distribution
VLQuantitativeFinancePackage.build
— Methodfunction build(model::Type{M}, data::NamedTuple) -> AbstractMarkovModel where {M <: AbstractMarkovModel}
This build
method constructs a concrete instance of type M
where M
is a subtype of AbstractMarkovModel
type using the data in a NamedTuple.
Arguments
model::Type{M}
: The type of model to build. This type must be a subtype ofAbstractMarkovModel
.data::NamedTuple
: The data to use to build the model.
The data::NamedTuple
argument must contain the following keys
:
states::Array{Int64,1}
: The states of the model.T::Array{Float64,2}
: The transition matrix of the model.E::Array{Float64,2}
: The emission matrix of the model.