Learn R Programming

LICORS (version 0.2.0)

estimate_state_probs: Estimate conditional/marginal state probabilities

Description

Estimates \(P(S = s_k; \mathbf{W})\), \(k = 1, \ldots, K\), the probability of being in state \(s_k\) using the weight matrix \(\mathbf{W}\).

These probabilites can be marginal (\(P(S = s_k; \mathbf{W})\)) or conditional (\(P(S = s_k \mid \ell^{-}, \ell^{+}; \mathbf{W})\)), depending on the provided information (pdfs$PLC and pdfs$FLC).

  • If both are NULL then estimate_state_probs returns a vector of length \(K\) with marginal probabilities.

  • If either of them is not NULL then it returns an \(N \times K\) matrix, where row \(i\) is the probability mass function of PLC \(i\) being in state \(s_k\), \(k = 1, \ldots, K\).

Usage

estimate_state_probs(weight.matrix = NULL, states = NULL, pdfs = list(FLC = NULL, 
    PLC = NULL), num.states = NULL)

Arguments

weight.matrix

\(N \times K\) weight matrix

states

vector of length \(N\) with entry \(i\) being the label \(k = 1, \ldots, K\) of PLC \(i\)

pdfs

a list with estimated pdfs for PLC and/or FLC evaluated at each PLC, \(i=1, \ldots, N\) and/or FLC, \(i=1, \ldots, N\)

num.states

number of states in total. If NULL (default) then it sets it to max(states) or ncol(weight.matrix) - depending on which one is provided.

Value

A vector of length \(K\) or a \(N \times K\) matrix.

Examples

Run this code
# NOT RUN {
WW <- matrix(runif(10000), ncol = 10)
WW <- normalize(WW)
estimate_state_probs(WW)
# }

Run the code above in your browser using DataLab