Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

weight_matrix2states

Returns unique state assignment from a (row-wise) weight matrix


Description

Converts a probabilistic cluster assignment to a unique cluster assignment using the

'argmax' rule:

state of row i is assigned as the position of the maximum in that row (ties are broken at random).

'sample' rule

state of row i is sampled from the discrete distribution where probabilities equal the weight vector in row i

Usage

weight_matrix2states(weight.matrix, rule = c("argmax", "sample"))

Arguments

weight.matrix

an N \times K matrix

rule

how do we choose the state given the weight matrix. c("argmax", "sample").

See Also

Examples

WW <- matrix(runif(12), ncol = 3)
WW <- normalize(WW)
WW
weight_matrix2states(WW)
weight_matrix2states(WW, "sample")
# another 'sample' is in general different from previous conversion unless WW is
# a 0/1 matrix
weight_matrix2states(WW, "sample")

LICORS

Light Cone Reconstruction of States - Predictive State Estimation From Spatio-Temporal Data

v0.2.0
GPL-2
Authors
Georg M. Goerg <gmg@stat.cmu.edu>
Initial release
2013-11-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.