Lapply-methods: Methods for Function Lapply

Lapply-methodsR Documentation

Methods for Function Lapply

Description

Apply a function to each component of a finite mixture

Usage

## S4 method for signature 'FLXRmstep'
Lapply(object, FUN, model = 1, component = TRUE, ...)

Arguments

object

S4 class object.

FUN

The function to be applied.

model

The model (for a multivariate response) that shall be used.

component

Index vector for selecting the components.

...

Optional arguments to FUN.

Details

FUN is found by a call to match.fun and typically is specified as a function or a symbol (e.g. a backquoted name) or a character string specifying a function to be searched for from the environment of the call to Lapply.

Value

A list of the length equal to the number of components specified is returned, each element of which is the result of applying FUN to the specified component of the refitted mixture model.

Methods

object = FLXRmstep:

Apply a function to each component of a refitted flexmix object using method = "mstep".

Author(s)

Friedrich Leisch and Bettina Gruen

Examples

data("NPreg", package = "flexmix")
ex2 <- flexmix(yn ~ x, data = NPreg, k = 2, model = list(FLXMRglm(yn ~ 
    . + I(x^2)), FLXMRglm(yp ~ ., family = "poisson")))
ex2r <- refit(ex2, method = "mstep")
Lapply(ex2r, "vcov", 2)

flexmix documentation built on March 31, 2023, 8:36 p.m.