Description Usage Arguments Value
View source: R/counts_to_probability.R
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.
1 2 3 4 5 | counts_to_probability(
successor_values,
value_col_name = NULL,
gamma_value = NULL
)
|
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. |
Returns the input.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.