Learn R Programming

MvBinary (version 1.1)

MvBinaryEstim: Create an instance of the [MvBinaryResult] class

Description

This function performs the model selection and the parameter inference.

Usage

MvBinaryEstim(x, nbcores = 1, algorithm = "HAC", modelslist = NULL, tol.EM = 0.01, nbinit.EM = 40, nbiter.MH = 50, nbchains.MH = 10)

Arguments

x
matrix of the binary observation.
nbcores
number of cores used for the model selection (only for Linux). Default is 1.
algorithm
algorithm used for the model selection ("HAC": deterministic algorithm based on the HAC of the variables, "MH": stochastic algorithm for optimizing the BIC criterion, "List": comparison of the models provided by the users). Default is "HAC".
modelslist
list of models provided by the user (only used when algorithm="List"). Default is NULL
tol.EM
stopping criterion for the EM algorithm. Default is 0.01
nbinit.EM
number of random initializations for the EM algorithm. Default is 40.
nbiter.MH
number of successive iterations without finding a model having a better BIC criterion which involves the stopping of the Metropolis-Hastings algorithm (only used when algorithm="MH"). Default is 50.
nbchains.MH
number of radom initializations for the stochastic algorithm (only used when algorithm="MH"). Default is 10.

Value

Returns an instance of the [MvBinaryResult] class.

Examples

Run this code
# Data loading
data(MvBinaryExample)

# Parameter estimation by the HAC-based algorithm on 2 cores
# where the EM algorithms are initialized 10 times
res.CAH <- MvBinaryEstim(MvBinaryExample, 2, nbinit.EM = 10)

# Parameter estimation for two competing models
res.CAH <- MvBinaryEstim(MvBinaryExample, algorithm="List",
 modelslist=list(c(1,1,2,2,3,4), c(1,1,1,2,2,2)), nbinit.EM = 10)

# Summary of the estimated model
summary(res.CAH)

# Print the parameters of the estimated model
print(res.CAH)

Run the code above in your browser using DataLab