Skip to content

Commit

Permalink
simplify binary state node prediction (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
LegrandNico authored Oct 2, 2023
1 parent 66e01e2 commit 95b3a3d
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/pyhgf/updates/prediction/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,8 @@ def predict_binary_state_node(
# List the (unique) value parent of the value parent
value_parent_idx = edges[node_idx].value_parents[0]

# Get the drift rate from the value parent of the value parent
driftrate = attributes[value_parent_idx]["rho"]

# Look at the (optional) value parent's value parents
# and update the drift rate accordingly
if edges[value_parent_idx].value_parents is not None:
for (
value_parent_value_parent_idx,
psi_parent,
) in zip(
edges[value_parent_idx].value_parents,
attributes[value_parent_idx]["psis_parents"],
):
driftrate += psi_parent * attributes[value_parent_value_parent_idx]["mu"]

# Estimate the new expected mean of the value parent and apply the sigmoid transform
muhat = attributes[value_parent_idx]["mu"] + time_step * driftrate
muhat = attributes[value_parent_idx]["muhat"]
muhat = sigmoid(muhat)

# Estimate the new expected precision of the value parent
Expand Down

0 comments on commit 95b3a3d

Please sign in to comment.