Overview of all functions in the Hierarchical Gaussian Filtering package
HierarchicalGaussianFiltering.BinaryInputNode
— TypeHierarchicalGaussianFiltering.BinaryInputNodeHistory
— TypeConfiguration of history of binary input node
HierarchicalGaussianFiltering.BinaryInputNodeParameters
— TypeConfiguration of parameters in binary input node. Default category mean set to [0,1]
HierarchicalGaussianFiltering.BinaryInputNodeState
— TypeConfiguration of states of binary input node
HierarchicalGaussianFiltering.BinaryStateNode
— TypeOverview of edge posibilities
HierarchicalGaussianFiltering.BinaryStateNodeHistory
— TypeOverview of the history of the binary state node
HierarchicalGaussianFiltering.BinaryStateNodeParameters
— TypeConfigure parameters of binary state node
HierarchicalGaussianFiltering.BinaryStateNodeState
— TypeOverview of the states of the binary state node
HierarchicalGaussianFiltering.CategoricalInputNode
— TypeHierarchicalGaussianFiltering.CategoricalInputNodeHistory
— TypeHistory of categorical input node
HierarchicalGaussianFiltering.CategoricalInputNodeState
— TypeConfiguration of states of categorical input node
HierarchicalGaussianFiltering.CategoricalStateNode
— TypeConfiguration of edges in categorical state node
HierarchicalGaussianFiltering.CategoricalStateNodeHistory
— TypeConfiguration of history in categorical state node
HierarchicalGaussianFiltering.CategoricalStateNodeState
— TypeConfiguration of states in categorical state node
HierarchicalGaussianFiltering.ContinuousInputNode
— TypeHierarchicalGaussianFiltering.ContinuousInputNodeHistory
— TypeConfiguration of continuous input node history
HierarchicalGaussianFiltering.ContinuousInputNodeParameters
— TypeConfiguration of continuous input node parameters
HierarchicalGaussianFiltering.ContinuousInputNodeState
— TypeConfiguration of continuous input node states
HierarchicalGaussianFiltering.ContinuousStateNode
— TypeHierarchicalGaussianFiltering.ContinuousStateNodeHistory
— TypeConfiguration of continuous state node history
HierarchicalGaussianFiltering.ContinuousStateNodeParameters
— TypeConfiguration of continuous state nodes' parameters
HierarchicalGaussianFiltering.ContinuousStateNodeState
— TypeConfigurations of the continuous state node states
HierarchicalGaussianFiltering.HGF
— TypeHierarchicalGaussianFiltering.OrderedNodes
— TypeActionModels.reset!
— Methodreset!(hgf::HGF)
Reset an HGF to its initial state.
HierarchicalGaussianFiltering.calculate_posterior
— Methodcalculate_posterior(node::CategoricalStateNode)
Calculate the posterior for a categorical state node.
HierarchicalGaussianFiltering.calculate_posterior_mean
— Methodcalculate_posterior_mean(node::BinaryStateNode)
Calculates a node's posterior mean.
HierarchicalGaussianFiltering.calculate_posterior_mean
— Methodcalculate_posterior_mean(node::AbstractNode)
Calculates a node's posterior mean.
HierarchicalGaussianFiltering.calculate_posterior_precision
— Methodcalculate_posterior_precision(node::BinaryStateNode)
Calculates a binary node's posterior precision.
HierarchicalGaussianFiltering.calculate_posterior_precision
— Methodcalculate_posterior_precision(node::AbstractNode)
Calculates a node's posterior precision.
HierarchicalGaussianFiltering.calculate_posterior_precision_increment
— Methodcalculate_posterior_precision_vope(node::AbstractNode, child::AbstractNode)
Calculates the posterior precision update term for a single continuous volatility child to a state node.
HierarchicalGaussianFiltering.calculate_precision_prediction_error
— Methodcalculate_precision_prediction_error(node::ContinuousInputNode)
Calculates an input node's volatility prediction error.
HierarchicalGaussianFiltering.calculate_precision_prediction_error
— Methodcalculate_precision_prediction_error(node::AbstractNode)
Calculates a state node's volatility prediction error.
HierarchicalGaussianFiltering.calculate_prediction
— Methodfunction calculate_prediction(node::CategoricalStateNode)
Calculate the prediction for a categorical state node.
HierarchicalGaussianFiltering.calculate_prediction_mean
— Methodcalculate_prediction_mean(node::BinaryStateNode)
Calculates a binary state node's prediction mean.
HierarchicalGaussianFiltering.calculate_prediction_mean
— Methodcalculate_prediction_mean(node::AbstractNode)
Calculates a node's prediction mean.
HierarchicalGaussianFiltering.calculate_prediction_precision
— Methodcalculate_prediction_precision(node::BinaryStateNode)
Calculates a binary state node's prediction precision.
HierarchicalGaussianFiltering.calculate_prediction_precision
— Methodcalculate_prediction_precision(node::AbstractInputNode)
Calculates an input node's prediction precision.
HierarchicalGaussianFiltering.calculate_prediction_precision
— Methodcalculate_prediction_precision(node::AbstractNode)
Calculates a node's prediction precision.
HierarchicalGaussianFiltering.calculate_value_prediction_error
— Methodcalculate_value_prediction_error(node::AbstractNode)
Calculate's a state node's value prediction error.
HierarchicalGaussianFiltering.calculate_value_prediction_error
— Methodcalculate_value_prediction_error(node::CategoricalStateNode)
Calculate the value prediction error for a categorical state node.
HierarchicalGaussianFiltering.calculate_value_prediction_error
— Methodcalculate_value_prediction_error(node::ContinuousInputNode)
Calculate's an input node's value prediction error.
HierarchicalGaussianFiltering.calculate_value_prediction_error
— Methodcalculate_value_prediction_error(node::AbstractNode)
Calculate's a state node's value prediction error.
HierarchicalGaussianFiltering.check_hgf
— Methodcheck_hgf(hgf::HGF)
Check whether an HGF has specified correctly. A single node can also be passed.
HierarchicalGaussianFiltering.enter_node_inputs!
— Methodenter_node_inputs!(hgf::HGF, input)
Set input values in input nodes. Can either take a single value, a vector of values, or a dictionary of input node names and corresponding values.
HierarchicalGaussianFiltering.get_prediction
— Functionget_prediction(hgf::HGF, node_name::String)
Get the prediction for the next timestep for a specified node in an HGF. If an agent is passed instead of an HGF, the HGF is extracted from the substruct in the agent. A single node can also be passed.
HierarchicalGaussianFiltering.get_surprise
— Functiongetsurprise(hgf::HGF, nodename::String = "u")
Calculates the surprisal at the last input of a specified input node in an HGF. If an agent is passed instead of an HGF, the HGF is extracted from the substruct in the agent. If no node is specified, the surprisal of all input nodes is summed.
HierarchicalGaussianFiltering.get_surprise
— Methodget_surprise(node::CategoricalInputNode)
Calculate the surprise of a categorical input node on seeing the last input.
HierarchicalGaussianFiltering.get_surprise
— Methodget_surprise(node::ContinuousInputNode)
Calculate the surprise of an input node on seeing the last input.
HierarchicalGaussianFiltering.premade_JGET
— Methodpremade_JGET(config::Dict; verbose::Bool = true)
The HGF used in the JGET model. It has a single continuous input node u, with a value parent x, and a volatility parent xnoise. x has volatility parent xvol, and xnoise has a volatility parent xnoise_vol.
Config defaults:
- ("u", "input_noise"): -2
- ("x", "volatility"): -2
- ("xvol", "volatility"): -2
- ("xnoise", "volatility"): -2
- ("xnoise_vol", "volatility"): -2
- ("u", "x", "coupling_strength"): 1
- ("u", "xnoise", "coupling_strength"): 1
- ("x", "xvol", "coupling_strength"): 1
- ("xnoise", "xnoisevol", "couplingstrength"): 1
- ("x", "initial_mean"): 0
- ("x", "initial_precision"): 1
- ("xvol", "initial_mean"): 0
- ("xvol", "initial_precision"): 1
- ("xnoise", "initial_mean"): 0
- ("xnoise", "initial_precision"): 1
- ("xnoisevol", "initialmean"): 0
- ("xnoisevol", "initialprecision"): 1
HierarchicalGaussianFiltering.premade_binary_2level
— Methodpremade_binary_2level(config::Dict; verbose::Bool = true)
The standard binary 2 level HGF model, which takes a binary input, and learns the probability of either outcome. It has one binary input node u, with a binary value parent xbin, which in turn has a continuous value parent xprob.
Config defaults:
HierarchicalGaussianFiltering.premade_binary_3level
— Methodpremade_binary_3level(config::Dict; verbose::Bool = true)
The standard binary 3 level HGF model, which takes a binary input, and learns the probability of either outcome. It has one binary input node u, with a binary value parent xbin, which in turn has a continuous value parent xprob. This then has a continunous volatility parent xvol.
This HGF has five shared parameters: "xprobvolatility" "xprobinitialprecisions" "xprobinitialmeans" "couplingstrengthsxbinxprob" "couplingstrengthsxprob_xvol"
Config defaults:
- ("xprob", "volatility"): -2
- ("xvol", "volatility"): -2
- ("xbin", "xprob", "coupling_strength"): 1
- ("xprob", "xvol", "coupling_strength"): 1
- ("xprob", "initial_mean"): 0
- ("xprob", "initial_precision"): 1
- ("xvol", "initial_mean"): 0
- ("xvol", "initial_precision"): 1
HierarchicalGaussianFiltering.premade_categorical_3level
— Methodpremade_categorical_3level(config::Dict; verbose::Bool = true)
The categorical 3 level HGF model, which takes an input from one of n categories and learns the probability of a category appearing. It has one categorical input node u, with a categorical value parent xcat. The categorical node has a binary value parent xbinn for each category n, each of which has a continuous value parent xprobn. Finally, all of these continuous nodes share a continuous volatility parent xvol. Setting parameter values for xbin and xprob sets that parameter value for each of the xbinn and xprobn nodes.
Config defaults:
- "n_categories": 4
- ("xprob", "volatility"): -2
- ("xvol", "volatility"): -2
- ("xbin", "xprob", "coupling_strength"): 1
- ("xprob", "xvol", "coupling_strength"): 1
- ("xprob", "initial_mean"): 0
- ("xprob", "initial_precision"): 1
- ("xvol", "initial_mean"): 0
- ("xvol", "initial_precision"): 1
HierarchicalGaussianFiltering.premade_categorical_state_transitions
— Methodpremade_categorical_state_transitions(config::Dict; verbose::Bool = true)
The categorical state transition 3 level HGF model, learns state transition probabilities between a set of n categorical states. It has one categorical input node u, with a categorical value parent xcatn for each of the n categories, representing which category was transitioned from. Each categorical node then has a binary parent xbinnm, representing the category m which the transition was towards. Each binary node xbinnm has a continuous parent xprobnm. Finally, all of these continuous nodes share a continuous volatility parent xvol. Setting parameter values for xbin and xprob sets that parameter value for each of the xbinnm and xprobn_m nodes.
This HGF has five shared parameters: "xprobvolatility" "xprobinitialprecisions" "xprobinitialmeans" "couplingstrengthsxbinxprob" "couplingstrengthsxprob_xvol"
Config defaults:
- "n_categories": 4
- ("xprob", "volatility"): -2
- ("xvol", "volatility"): -2
- ("xbin", "xprob", "coupling_strength"): 1
- ("xprob", "xvol", "coupling_strength"): 1
- ("xprob", "initial_mean"): 0
- ("xprob", "initial_precision"): 1
- ("xvol", "initial_mean"): 0
- ("xvol", "initial_precision"): 1
HierarchicalGaussianFiltering.premade_continuous_2level
— Methodpremade_continuous_2level(config::Dict; verbose::Bool = true)
The standard 2 level continuous HGF, which filters a continuous input. It has a continous input node u, with a single value parent x, which in turn has a single volatility parent xvol.
Config defaults:
- ("u", "input_noise"): -2
- ("x", "volatility"): -2
- ("xvol", "volatility"): -2
- ("u", "x", "coupling_strength"): 1
- ("x", "xvol", "coupling_strength"): 1
- ("x", "initial_mean"): 0
- ("x", "initial_precision"): 1
- ("xvol", "initial_mean"): 0
- ("xvol", "initial_precision"): 1
HierarchicalGaussianFiltering.premade_hgf
— Functionpremade_hgf(model_name::String, config::Dict = Dict(); verbose = true)
Create an HGF from the list of premade HGFs.
Arguments
- 'model_name::String': Name of the premade HGF. Returns a list of possible model names if set to 'help'.
- 'config::Dict = Dict()': A dictionary with configurations for the HGF, like parameters and settings.
- 'verbose::Bool = true': If set to false, warnings are hidden.
HierarchicalGaussianFiltering.update_hgf!
— Methodupdate_hgf!(
hgf::HGF,
inputs::Union{
Real,
Missing,
Vector{<:Union{Real,Missing}},
Dict{String,<:Union{Real,Missing}},
},
)
Update all nodes in an HGF based on an input. The input can either be missing, a single value, a vector of values, or a dictionary of input node names and corresponding values.
HierarchicalGaussianFiltering.update_node_input!
— Methodupdate_node_input!(node::AbstractInputNode, input::Union{Real,Missing})
Update the prediction of a single input node.
HierarchicalGaussianFiltering.update_node_posterior!
— Methodupdate_node_posterior!(node::AbstractStateNode; update_type::HGFUpdateType)
Update the posterior of a single continuous state node. This is the classic HGF update.
HierarchicalGaussianFiltering.update_node_posterior!
— Methodupdate_node_posterior!(node::CategoricalStateNode)
Update the posterior of a single categorical state node.
HierarchicalGaussianFiltering.update_node_posterior!
— Methodupdate_node_posterior!(node::AbstractStateNode; update_type::HGFUpdateType)
Update the posterior of a single continuous state node. This is the classic HGF update.
HierarchicalGaussianFiltering.update_node_posterior!
— Methodupdate_node_posterior!(node::AbstractStateNode)
Update the posterior of a single continuous state node. This is the enahnced HGF update.
HierarchicalGaussianFiltering.update_node_precision_prediction_error!
— Methodupdate_node_precision_prediction_error!(node::BinaryInputNode)
There is no volatility prediction error update for binary input nodes.
HierarchicalGaussianFiltering.update_node_precision_prediction_error!
— Methodupdate_node_precision_prediction_error!(node::BinaryStateNode)
There is no volatility prediction error update for binary state nodes.
HierarchicalGaussianFiltering.update_node_precision_prediction_error!
— Methodupdate_node_precision_prediction_error!(node::CategoricalInputNode)
There is no volatility prediction error update for categorical input nodes.
HierarchicalGaussianFiltering.update_node_precision_prediction_error!
— Methodupdate_node_precision_prediction_error!(node::CategoricalStateNode)
There is no volatility prediction error update for categorical state nodes.
HierarchicalGaussianFiltering.update_node_precision_prediction_error!
— Methodupdate_node_precision_prediction_error!(node::AbstractInputNode)
Update the value prediction error of a single input node.
HierarchicalGaussianFiltering.update_node_precision_prediction_error!
— Methodupdate_node_precision_prediction_error!(node::AbstractStateNode)
Update the volatility prediction error of a single state node.
HierarchicalGaussianFiltering.update_node_prediction!
— Methodupdate_node_prediction!(node::BinaryInputNode)
There is no prediction update for binary input nodes, as the prediction precision is constant.
HierarchicalGaussianFiltering.update_node_prediction!
— Methodupdate_node_prediction!(node::BinaryStateNode)
Update the prediction of a single binary state node.
HierarchicalGaussianFiltering.update_node_prediction!
— Methodupdate_node_prediction!(node::CategoricalInputNode)
There is no prediction update for categorical input nodes, as the prediction precision is constant.
HierarchicalGaussianFiltering.update_node_prediction!
— Methodupdate_node_prediction!(node::CategoricalStateNode)
Update the prediction of a single categorical state node.
HierarchicalGaussianFiltering.update_node_prediction!
— Methodupdate_node_prediction!(node::AbstractInputNode)
Update the posterior of a single input node.
HierarchicalGaussianFiltering.update_node_prediction!
— Methodupdate_node_prediction!(node::ContinuousStateNode)
Update the prediction of a single state node.
HierarchicalGaussianFiltering.update_node_value_prediction_error!
— Methodupdate_node_value_prediction_error!(node::BinaryInputNode)
Update the value prediction error of a single binary input node.
HierarchicalGaussianFiltering.update_node_value_prediction_error!
— Methodupdate_node_value_prediction_error!(node::AbstractStateNode)
Update the value prediction error of a single state node.
HierarchicalGaussianFiltering.update_node_value_prediction_error!
— Methodupdate_node_value_prediction_error!(node::CategoricalInputNode)
There is no value prediction error update for categorical input nodes.
HierarchicalGaussianFiltering.update_node_value_prediction_error!
— Methodupdate_node_value_prediction_error!(node::AbstractStateNode)
Update the value prediction error of a single state node.
HierarchicalGaussianFiltering.update_node_value_prediction_error!
— Methodupdate_node_value_prediction_error!(node::AbstractInputNode)
Update the value prediction error of a single input node.
HierarchicalGaussianFiltering.update_node_value_prediction_error!
— Methodupdate_node_value_prediction_error!(node::AbstractStateNode)
Update the value prediction error of a single state node.
This page was generated using Literate.jl.