Convert states to vector of probabilities of any given state

Description

Converts states (either as a size N array of labels or an N \times K weight matrix) into N probabilities per state.

If states is a matrix - representing the state space in the dimensions of the original data - then the probabilities will be formatted automatically to an array of the same shape and dimension.

Usage

1
states2probs(weight.matrix = NULL, states = NULL, type = "MLE")

Arguments

states

array of size N with entry i being the label k = 1, …, K of PLC i

weight.matrix

N \times K weight matrix

type

estimation type for the probabilities: c("MLE")

See Also

weight_matrix2states

Examples

1
2
3
4
5
6
state.sim <- sample.int(5, 100, replace = TRUE)
prob.state <- states2probs(states = state.sim)
layout(matrix(1:2, ncol = 2))
plot(state.sim, xlab = "", ylab = "state")
plot(prob.state, xlab = "", ylab = "probability")
plot(state.sim, prob.state, xlab = "state", ylab = "probability", type = "h")