Skip to content

Commit

Permalink
AR1 parameters in the node creation functions
Browse files Browse the repository at this point in the history
  • Loading branch information
LegrandNico committed Oct 6, 2023
1 parent 93ae226 commit 579a4a6
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions src/pyhgf/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ def add_value_parent(
precision: Union[float, np.ndarray, ArrayLike] = 1.0,
tonic_volatility: Union[float, np.ndarray, ArrayLike] = -4.0,
tonic_drift: Union[float, np.ndarray, ArrayLike] = 0.0,
autoregressive_coefficient: float = 0.0,
autoregressive_intercept: float = 0.0,
additional_parameters: Optional[Dict] = None,
):
"""Add a value parent to a given set of nodes.
Expand All @@ -615,8 +617,9 @@ def add_value_parent(
children_idxs :
The child(s) node index(es).
value_coupling :
The value_coupling between the child and parent node. This is will be
appended to the `psis` parameters in the parent and child node(s).
The value coupling between the child and parent node. This is will be
appended to the `value_coupling_children` parameters in the parent node,
and to the `value_coupling_parents` in the child node(s).
mean :
The mean of the Gaussian distribution. This value is passed both to the
current and expected states.
Expand All @@ -628,6 +631,15 @@ def add_value_parent(
volatility parent(s)).
tonic_drift :
The drift of the random walk. Defaults to `0.0` (no drift).
autoregressive_coefficient :
The autoregressive coefficient is only used to parametrize the AR1 process
and represents the autoregressive coefficient. If
:math:`-1 \\le \\phi \\le 1`, the process is stationary and will revert to
the autoregressive intercept.
autoregressive_intercept :
The parameter `m` is only used to parametrize the AR1 process and represents
the autoregressive intercept. If :math:`-1 \\le \\phi \\le 1`, this is the
value to which the process will revert to.
additional_parameters :
Add more custom parameters to the node.
Expand All @@ -653,6 +665,8 @@ def add_value_parent(
"value_coupling_parents": None,
"tonic_volatility": tonic_volatility,
"tonic_drift": tonic_drift,
"autoregressive_coefficient": autoregressive_coefficient,
"autoregressive_intercept": autoregressive_intercept,
}

# add more parameters (optional)
Expand Down Expand Up @@ -706,6 +720,8 @@ def add_volatility_parent(
precision: Union[float, np.ndarray, ArrayLike] = 1.0,
tonic_volatility: Union[float, np.ndarray, ArrayLike] = -4.0,
tonic_drift: Union[float, np.ndarray, ArrayLike] = 0.0,
autoregressive_coefficient: float = 0.0,
autoregressive_intercept: float = 0.0,
additional_parameters: Optional[Dict] = None,
):
"""Add a volatility parent to a given set of nodes.
Expand All @@ -716,7 +732,8 @@ def add_volatility_parent(
The child(s) node index(es).
volatility_coupling :
The volatility coupling between the child and parent node. This is will be
appended to the `kappas` parameters in the parent and child node(s).
appended to the `volatility_coupling_children` parameters in the parent
node, and to the `volatility_coupling_parents` in the child node(s).
mean :
The mean of the Gaussian distribution. This value is passed both to the
current and expected states.
Expand All @@ -728,6 +745,15 @@ def add_volatility_parent(
volatility parent(s)).
tonic_drift :
The drift of the random walk. Defaults to `0.0` (no drift).
autoregressive_coefficient :
The autoregressive coefficient is only used to parametrize the AR1 process
and represents the autoregressive coefficient. If
:math:`-1 \\le \\phi \\le 1`, the process is stationary and will revert to
the autoregressive intercept.
autoregressive_intercept :
The parameter `m` is only used to parametrize the AR1 process and represents
the autoregressive intercept. If :math:`-1 \\le \\phi \\le 1`, this is the
value to which the process will revert to.
additional_parameters :
Add more custom parameters to the node.
Expand All @@ -753,6 +779,8 @@ def add_volatility_parent(
"value_coupling_parents": None,
"tonic_volatility": tonic_volatility,
"tonic_drift": tonic_drift,
"autoregressive_coefficient": autoregressive_coefficient,
"autoregressive_intercept": autoregressive_intercept,
}

# add more parameters (optional)
Expand Down

0 comments on commit 579a4a6

Please sign in to comment.