Last data update: 2014.03.03

R: Utilities for "LICORS" class
mixed_LICORS-utilsR Documentation

Utilities for “LICORS” class

Description

The "mixed_LICORS" class is the objectput from the mixed_LICORS estimator.

plot.mixed_LICORS gives a visual summary of the estimates such as marginal state probabilities, conditional state probabilities (= weight matrix), predictive state densities, trace plots for log-likelihood/loss/penalty.

summary.mixed_LICORS prints object a summary of the estimated LICORS model.

predict.mixed_LICORS predicts FLCs based on PLCs given a fitted mixed LICORS model. This can be done on an iterative basis, or for a selection of future PLCs.

complete_LICORS_control completes the controls for the mixed LICORS estimator. Entries of the list are:

'loss' an R function specifying the loss for cross-validation (CV). Default: mean squared error (MSE), i.e. loss = function(x, xhat) mean((x-xhat)^2)

'method' a list of length 2 with arguments PLC and FLC for the method of density estimation in each (either "normal" or "nonparametric").

'max.iter' maximum number of iterations in the EM

'trace' if > 0 it prints output in the console as the EM is running

'sparsity' what type of sparsity (currently not implemented)

'lambda' penalization parameter; larger lambda gives sparser weights

'alpha' significance level to stop testing. Default: alpha = 0.01

'seed' set seed for reproducibility. Default: NULL. If NULL it sets a random seed and then returns this seed in the output.

'CV.train.ratio' how much of the data should be training data. Default: 0.75, i.e., 75% of data is for training

'CV.split.random' logical; if TRUE training and test data are split randomly; if FALSE (default) it uses the first part (in time) as training, rest as test.

'estimation' a list of length 2 with arguments PLC and FLC for the method of density estimation in each (either "normal" or "nonparametric").

Usage

## S3 method for class 'mixed_LICORS'
plot(x, type = "both", cex.axis = 1.5, cex.lab = 1.5, 
    cex.main = 2, line = 1.5, ...)

## S3 method for class 'mixed_LICORS'
summary(object, ...)

## S3 method for class 'mixed_LICORS'
predict(object, new.LCs = list(PLC = NULL), ...)

complete_LICORS_control(control = list(alpha = 0.01, CV.split.random = FALSE, 
    CV.train.ratio = 0.75, lambda = 0, max.iter = 500, seed = NULL, 
    sparsity = "stochastic", trace = 0, loss = function(x, xhat) mean((x - 
        xhat)^2), estimation.method = list(PLC = "normal", FLC = "nonparametric")))

Arguments

x

object of class "mixed_LICORS"

type

should only "training", "test", or "both" be plotted. Default: "both".

cex.axis

The magnification to be used for axis annotation relative to the current setting of cex.

cex.lab

The magnification to be used for x and y labels relative to the current setting of cex.

cex.main

The magnification to be used for main titles relative to the current setting of cex.

line

on which margin line should the labels be ploted, starting at 0 counting objectwards (see also mtext).

...

optional arguments passed to plot, summary, or predict

object

object of class "mixed_LICORS"

new.LCs

a list with PLC configurations to predict FLCs given these PLCs

control

a list of controls for "mixed_LICORS".

Examples

# see examples of LICORS-package see examples in LICORS-package see examples in
# LICORS-package see examples in LICORS-package

Results