estimate_LC_pdfs: Estimate PLC/FLC distributions for all states

Description Usage Arguments Value Examples

View source: R/estimate_LC_pdfs.R

Description

estimate_LC_pdfs estimates the PLC and FLC distributions for each state k = 1, …, K. It iteratively applies estimate_LC.pdf.state.

estimate_LC.pdf.state estimates the PLC and FLC distributions using weighted maximum likelihood (cov.wt) and nonparametric kernel density estimation (wKDE) for one (!) state.

Usage

1
2
3
4
5
estimate_LC_pdfs(LCs, weight.matrix = NULL, method = c("nonparametric", "normal", 
    "huge"), eval.LCs = NULL)

estimate_LC_pdf_state(state, states = NULL, weights = NULL, LCs = NULL, eval.LCs = NULL, 
    method = c("nonparametric", "normal", "huge"))

Arguments

LCs

matrix of PLCs/FLCs. This matrix has N rows and n_p or n_f columns (depending on the PLC/FLC dimensionality)

weight.matrix

N \times K weight matrix

states

vector of length N with entry i being the label k = 1, …, K of PLC i

method

type of estimation: either a (multivariate) Normal distribution ("normal") or nonparametric with a kernel density estimator (method = "nonparametric"). For multivariate distributions (as usual for PLCs) only 'normal' should be used due to computational efficiency and statistical accuracy.

eval.LCs

on what LCs should the estimate be evaluated? If NULL then densities will be evaluated on the training data LCs

state

integer; which state-conditional density should be estimated

weights

weights of the samples. Either a i) length N vector with the weights for each observation; ii) N \times K matrix, where the state column of that matrix is used as a weight-vector.

Value

estimate_LC_pdfs returns an N \times K matrix.

estimate_LC.pdf.state returns a vector of length N with the state-conditional density evaluated at eval.LCs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
set.seed(10)
WW <- matrix(runif(10000), ncol = 10)
WW <- normalize(WW)
temp_flcs <- cbind(sort(rnorm(nrow(WW))))
temp_flc_pdfs <- estimate_LC_pdfs(temp_flcs, WW)
matplot(temp_flcs, temp_flc_pdfs, col = 1:ncol(WW), type = "l", xlab = "FLCs", 
    ylab = "pdf", lty = 1)
###################### one state only ###
temp_flcs <- temp_flcs[order(temp_flcs)]
temp_flc_pdf <- estimate_LC_pdf_state(state = 3, LCs = temp_flcs, weights = WW)

plot(temp_flcs, temp_flc_pdf, type = "l", xlab = "FLC", ylab = "pdf")

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