initialize_states: State initialization for iterative algorithms (randomly or...

Description Usage Arguments Examples

View source: R/initialize_states.R

Description

Initializes the state/cluster assignment either uniformly at random from K classes, or using initial kmeans++ (kmeanspp) clustering (in several variations on PLCs and/or FLCs).

Usage

1
2
3
initialize_states(num.states = NULL, num.samples = NULL, method = c("random", 
    "KmeansPLC", "KmeansFLC", "KmeansPLCFLC", "KmeansFLCPLC"), LCs = list(PLC = NULL, 
    FLC = NULL))

Arguments

num.states

number of states

num.samples

number of samples.

method

how to choose the labels: either uniformly at random from \lbrace 1, …, K \rbrace or using K-means on PLCs and FLCs or a combination. Default: method = "random". Other options are c("KmeansPLC","KmeansFLC","KmeansPLCFLC","KmeansFLCPLC")

LCs

(optional) a list of PLC (N \times n_p array) and FLC (N \times n_f array)

Examples

1
2
3
4
5
6
7
x1 <- rnorm(1000)
x2 <- rnorm(200, mean = 2)
yy <- c(x1, x2)
ss <- initialize_states(num.states = 2, num.samples = length(yy), method = "KmeansFLC", 
    LCs = list(FLCs = yy))
plot(yy, col = ss, pch = 19)
points(x1, col = "blue")

LICORS documentation built on May 1, 2019, 10:13 p.m.