diff --git a/docs/make.jl b/docs/make.jl index 3d0cccf..f6bd8a8 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -61,12 +61,12 @@ makedocs(; ), pages = [ "Introduction to Hierarchical Gaussian Filtering" => "./index.md", - #"Theory" => [ - # "./theory/genmodel.md", - # "./theory/node.md", - # "./theory/vape.md", - # "./theory/vope.md", - #], + "Theory" => [ + "./theory/genmodel.md", + "./theory/node.md", + "./theory/vape.md", + "./theory/vope.md", + ], "Using the package" => [ "The HGF Nodes" => "./generated_markdowns/the_HGF_nodes.md", "Building an HGF" => "./generated_markdowns/building_an_HGF.md", diff --git a/docs/src/Julia_src_files/premade_HGF.jl b/docs/src/Julia_src_files/premade_HGF.jl index 359cdff..8a660c0 100644 --- a/docs/src/Julia_src_files/premade_HGF.jl +++ b/docs/src/Julia_src_files/premade_HGF.jl @@ -9,7 +9,6 @@ # - [Categorical 3-level HGF](#Categorical-3-level-HGF) # - [Categorical 3-level state transition HGF](#Categorical-3-level-state-transition) -# ![continuous 2-level graph](../images/HGF_structures/all_models.png) # #Load data for examples @@ -40,6 +39,11 @@ inputs_binary = CSV.read(hgf_path_binary * "classic_binary_inputs.csv", DataFram # ## Continuous 2-level HGF + + +# ![continuous 2-level graph](../images/HGF_structures/continuous.svg) + + # The continuous 2-level HGF is structured with following nodes: # - input node: continuous @@ -47,6 +51,7 @@ inputs_binary = CSV.read(hgf_path_binary * "classic_binary_inputs.csv", DataFram # - 1st level: continuous (value coupling to input node) # - 2nd level: continous (volatility coupling to 1st level) + #Create HGF and Agent continuous_2_level = premade_hgf("continuous_2level"); agent_continuous_2_level = @@ -93,6 +98,9 @@ plot_trajectory( # ## Binary 2-level HGF +# ![continuous 2-level graph](../images/HGF_structures/binary.svg) + + # - input node: binary # - state nodes: # - 1st level: binary (value coupling to input node) @@ -143,6 +151,9 @@ plot_trajectory(agent_binary_3_level, ("x3", "posterior")) # ## Categorical 3-level HGF +# ![continuous 2-level graph](../images/HGF_structures/categorical.svg) + + # The categorical 3-level HGF model takes an input from one of m categories and learns the probability of a category appearing. # - input node: categorical diff --git a/docs/src/Julia_src_files/the_HGF_nodes.jl b/docs/src/Julia_src_files/the_HGF_nodes.jl index 1ae33b3..cb24584 100644 --- a/docs/src/Julia_src_files/the_HGF_nodes.jl +++ b/docs/src/Julia_src_files/the_HGF_nodes.jl @@ -2,67 +2,13 @@ # In this section we will cover the types of nodes, their parameters and the rules for structuring your own HGF. - # ### Overview -# - [The Node Types In an HGF and their states](#The-Node-Types-In-an-HGF) -# - [Building principles ](#Building-principles ) - -# ### The Node Types In an HGF - -# We have six types of nodes in the HGF: binary (state node and input node), categorical (state node and input node), and continuous (state node and input node). - -# If a node's parameters are configured with a default value, they are stated below as well. - -# We provide an overview of the states in each of the nodes. - -# 1. [Binary Nodes](#Binary-Nodes) -# 1. [State Node: States and parameters](#The-states-of-binary-state-nodes-and-parameters) -# 2. [Input Node: States and parameters](#The-states-of-binary-input-nodes-and-parameters) - -# 3. [Categorical Nodes](#Categorical-Nodes) -# 1. [State Node: States and parameters](#The-states-of-Categorical-state-nodes-and-parameters) -# 2. [Input Node: States and parameters](#The-states-of-Categorical-Input-nodes-and-parameters) - -# 4. [Continuous Nodes](#Continuous-Nodes) -# 1. [State Node: States and parameters](#The-states-of-Continuous-state-nodes-and-parameters) -# 2. [Input Node: States and parameters](#The-states-of-Continuous-Input-nodes-and-parameters) - +# ![states and parameters](../images/states_nodes/all_states.svg) -# ## Binary Nodes - -# ### The states of binary state nodes - -# - posterior_mean -# - posterior_precision -# - value\_prediction\_error -# - prediction_mean -# - prediction_precision - -# ### Parameters - -# - Value coupling - - -# ### The states of binary input nodes and parameters - -# - input value -# - value prediction error - -# ### Parameters - -# - Category means (default is [0,1]) -# - Input precision (default is infinite input precision) - - -# ## Categorical Nodes - -# ### The states of Categorical state nodes and parameters - -# - posterior -# - value prediction error -# - prediction +# ## Building principles +# The following rules apply for connecting nodes, when customizing your own HGF structure: # ### Parameters # - no parameters in the categorical state node @@ -112,10 +58,6 @@ # - input noise (default is 0) # - value coupling # - volatility coupling - - - -# ## Building principles # ### Binary state node rules: @@ -123,6 +65,8 @@ # - Can only have excatly one value child # - Can only have a contionus state node as value parent +# ![states and parameters](../images/states_nodes/binary_nodes.svg) + # ### continuous state node rules: # - Can’t have binary input node as child @@ -132,8 +76,12 @@ # - Can’t have the same value parent as volatility parent # - Can’t have the same value child as volatility child +# ![states and parameters](../images/states_nodes/continuous_nodes.svg) + # ### Categorical state node rules: # - Can only have exactly one value child # - Can only have categorical input node as child # - Can only have binary state node as parents + +# ![states and parameters](../images/states_nodes/categorical_nodes.svg) diff --git a/docs/src/generated_markdowns/dummy.jl b/docs/src/generated_markdowns/dummy.jl deleted file mode 100644 index 89f36cd..0000000 --- a/docs/src/generated_markdowns/dummy.jl +++ /dev/null @@ -1 +0,0 @@ -# For pushing the folder diff --git a/docs/src/images/HGF_structures/Binary_2_level.png b/docs/src/images/HGF_structures/Binary_2_level.png deleted file mode 100644 index 60a1caf..0000000 Binary files a/docs/src/images/HGF_structures/Binary_2_level.png and /dev/null differ diff --git a/docs/src/images/HGF_structures/Binary_3_level.png b/docs/src/images/HGF_structures/Binary_3_level.png deleted file mode 100644 index 113de13..0000000 Binary files a/docs/src/images/HGF_structures/Binary_3_level.png and /dev/null differ diff --git a/docs/src/images/HGF_structures/JGET.png b/docs/src/images/HGF_structures/JGET.png deleted file mode 100644 index 7ad6dbf..0000000 Binary files a/docs/src/images/HGF_structures/JGET.png and /dev/null differ diff --git a/docs/src/images/HGF_structures/all_models.png b/docs/src/images/HGF_structures/all_models.png deleted file mode 100644 index 8ebaea3..0000000 Binary files a/docs/src/images/HGF_structures/all_models.png and /dev/null differ diff --git a/docs/src/images/HGF_structures/binary.svg b/docs/src/images/HGF_structures/binary.svg new file mode 100644 index 0000000..78c02e0 --- /dev/null +++ b/docs/src/images/HGF_structures/binary.svg @@ -0,0 +1,1927 @@ + + + + diff --git a/docs/src/images/HGF_structures/cat_3_level.png b/docs/src/images/HGF_structures/cat_3_level.png deleted file mode 100644 index cddcd1a..0000000 Binary files a/docs/src/images/HGF_structures/cat_3_level.png and /dev/null differ diff --git a/docs/src/images/HGF_structures/cat_3_level_state.png b/docs/src/images/HGF_structures/cat_3_level_state.png deleted file mode 100644 index 685a7a7..0000000 Binary files a/docs/src/images/HGF_structures/cat_3_level_state.png and /dev/null differ diff --git a/docs/src/images/HGF_structures/categorical.svg b/docs/src/images/HGF_structures/categorical.svg new file mode 100644 index 0000000..1a227cc --- /dev/null +++ b/docs/src/images/HGF_structures/categorical.svg @@ -0,0 +1,2974 @@ + + + + diff --git a/docs/src/images/HGF_structures/cont_2_level.png b/docs/src/images/HGF_structures/cont_2_level.png deleted file mode 100644 index 1a5e3ec..0000000 Binary files a/docs/src/images/HGF_structures/cont_2_level.png and /dev/null differ diff --git a/docs/src/images/HGF_structures/continuous.svg b/docs/src/images/HGF_structures/continuous.svg new file mode 100644 index 0000000..b56cffb --- /dev/null +++ b/docs/src/images/HGF_structures/continuous.svg @@ -0,0 +1,1735 @@ + + + + diff --git a/docs/src/images/states_nodes/all_states.svg b/docs/src/images/states_nodes/all_states.svg new file mode 100644 index 0000000..88195e6 --- /dev/null +++ b/docs/src/images/states_nodes/all_states.svg @@ -0,0 +1,3894 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/images/states_nodes/binary_nodes.svg b/docs/src/images/states_nodes/binary_nodes.svg new file mode 100644 index 0000000..311c626 --- /dev/null +++ b/docs/src/images/states_nodes/binary_nodes.svg @@ -0,0 +1,2720 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/images/states_nodes/categorical_nodes.svg b/docs/src/images/states_nodes/categorical_nodes.svg new file mode 100644 index 0000000..7e5940b --- /dev/null +++ b/docs/src/images/states_nodes/categorical_nodes.svg @@ -0,0 +1,1224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/images/states_nodes/continuous_nodes.svg b/docs/src/images/states_nodes/continuous_nodes.svg new file mode 100644 index 0000000..76e920a --- /dev/null +++ b/docs/src/images/states_nodes/continuous_nodes.svg @@ -0,0 +1,3756 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/theory/genmodel.md b/docs/src/theory/genmodel.md index fe29cc5..a696750 100644 --- a/docs/src/theory/genmodel.md +++ b/docs/src/theory/genmodel.md @@ -47,4 +47,5 @@ x_3^{(k)} &\sim \mathcal{N}(x_3^{(k)} | x_3^{(k-1)}, \, \exp(\kappa_3 \end{align} ``` + Note that in this example, all states that are value parents of other states (or outcomes) have their own volatility parent, while states that are volatility parents to other nodes either have a value parent (as state $\check{x}_1$), or no parents (as states $\check{x}_2$ and $\check{x}_3$). This is deliberately so, and we will see these two motifs - every state of a hierarchy has its own volatility estimation, and volatility states only have value parents - reappear in the following chapters.