probability_to_counts: Convert probabilities into successor counts

Description Usage Arguments Value

View source: R/probability_to_counts.R

Description

De-Normalizes the successor matrix. Technically, the successor values are (this is a mouthful) discounted expected counts of future state occupancies, given a starting state. More simply: they're counts of how often you'd expect to end up in a particular state, given that you started out in a particular state.

Much of the time, we're not particularly interested in the exact counts, but rather probabilities. Interestingly enough, there's a tight coupling between γ, the number of lookahead steps, and the normalization constant.

The value of γ dictates how many "time steps" are considered when encoding successor states into the current state. The exact equation is lookahead = 1 / (1 - γ). In the case of γ = 0.8, the successor algorithm looks five steps into the future.

We can convert counts into probabilities by scalar-multiplying the matrix M by the normalization factor 1 - γ. We can inversely convert probabilities into counts: M * (1 / 1 - γ). Yes, it's that easy, but beware that your probabilities might not sum to one (!!), due to computational limits on numeric precision or a non-converged (non-asymptotic) matrix.

Usage

1
2
3
4
5
probability_to_counts(
  successor_values,
  value_col_name = NULL,
  gamma_value = NULL
)

Arguments

successor_values

The learned successor values. If your input is a dataframe, there must be a column named "gamma".

value_col_name

If your input is a dataframe, specify the column name.

gamma_value

If your input is a matrix, specify the gamma.

Value

Returns the input.


psychNerdJae/successr documentation built on Dec. 22, 2021, 9:56 a.m.