Extractor functions {flexCWM} | R Documentation |
Extractors for cwm
class objects.
Description
These functions extract values from cwm
class objects.
Usage
getBestModel(object, criterion = "BIC", k = NULL, modelXnorm = NULL, familyY = NULL)
getPosterior(object, ...)
getSize(object, ...)
getCluster(object, ...)
getParGLM(object, ...)
getParConcomitant(object, name = NULL, ...)
getPar(object, ...)
getParPrior(object, ...)
getParXnorm(object, ...)
getParXbin(object, ...)
getParXpois(object, ...)
getParXmult(object, ...)
getIC(object,criteria)
whichBest(object, criteria = NULL, k = NULL, modelXnorm = NULL, familyY = NULL)
## S3 method for class 'cwm'
summary(object, criterion = "BIC", concomitant = FALSE,
digits = getOption("digits")-2, ...)
## S3 method for class 'cwm'
print(x, ...)
Arguments
object , x |
a class |
criterion |
a string with the information criterion to consider; supported values are: |
criteria |
a vector of strings with the names of information criteria to consider. If |
k |
an optional vector containing the numbers of mixture components to consider. If not specified, all the estimated models are considered. |
modelXnorm |
an optional vector of character strings indicating the parsimonious models to consider for |
familyY |
an optional vector of character strings indicating the conditional distribution of |
name |
an optional vector of strings specifing the names of distribution families of concomitant variables; if |
concomitant |
When |
digits |
integer used for number formatting. |
... |
additional arguments to be passed to |
Details
When several models have been estimated, these functions consider the best model according to the information criterion in criterion
, among the estimated models having a number of components among those in k
an error distribution among those in familyY
and a parsimonious model among those in modelXnorm
.
getIC
provides values for the information criteria in criteria
.
The getBestModel
method returns a cwm
object containing the best model only, selected as described above.
Examples
#res <- cwm(Y=Y,Xcont=X,k=1:4,seed=1)
#summary(res)
#plot(res)