Markov Models

Fill me in

VLQuantitativeFinancePackage.MyHiddenMarkovModelType
mutable 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 model
  • transition::Dict{Int64, Categorical}: The transition matrix of the model encoded as a dictionary where the key is the state and the value is a Categorical distribution
  • emission::Dict{Int64, Categorical}: The emission matrix of the model encoded as a dictionary where the key is the state and the value is a Categorical distribution
source
VLQuantitativeFinancePackage.buildMethod

function 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 of AbstractMarkovModel.
  • 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.
source