Title: | Modelling Multivariate Binary Data with Blocks of Specific One-Factor Distribution |
---|---|
Description: | Modelling Multivariate Binary Data with Blocks of Specific One-Factor Distribution. Variables are grouped into independent blocks. Each variable is described by two continuous parameters (its marginal probability and its dependency strength with the other block variables), and one binary parameter (positive or negative dependency). Model selection consists in the estimation of the repartition of the variables into blocks. It is carried out by the maximization of the BIC criterion by a deterministic (faster) algorithm or by a stochastic (more time consuming but optimal) algorithm. Tool functions facilitate the model interpretation. |
Authors: | Matthieu Marbac and Mohammed Sedki |
Maintainer: | Mohammed Sedki <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.1 |
Built: | 2025-02-09 03:13:43 UTC |
Source: | https://github.com/cran/MvBinary |
MvBinary is a tool for fitting the distribution of correlated multivariate binary data.
Package: | MvBinary |
Type: | Package |
Version: | 1.0.0 |
Date: | 2015-11-03 |
License: | GPL-2 |
LazyLoad: | yes |
Author: Marbac M., and Sedki S.
Matthieu Marbac, Mohammed Sedki (2015). A Family of Blockwise One-Factor Distributions for Modelling High-Dimensional Binary Data. arXiv:1511.01343
# Package loading rm(list=ls()) require(MvBinary) # 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) # Summary of the estimated model summary(res.CAH) # Print the parameters of the estimated model print(res.CAH)
# Package loading rm(list=ls()) require(MvBinary) # 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) # Summary of the estimated model summary(res.CAH) # Print the parameters of the estimated model print(res.CAH)
This function computes the Empiric Cramer's V for a binary data set.
ComputeEmpiricCramer(x)
ComputeEmpiricCramer(x)
x |
a binary matrix. |
Return the matrix of the Empiric Cramer's V.
This function computes the model Cramer's V for a binary data set.
ComputeMvBinaryCramer(results)
ComputeMvBinaryCramer(results)
results |
an instance of S4 class MvBinaryResult (provided by the function MvBinaryEstim) |
Return the matrix of the Empiric Cramer's V.
MvBinaryResult
] classThis function performs the model selection and the parameter inference.
MvBinaryEstim(x, nbcores = 1, algorithm = "HAC", modelslist = NULL, tol.EM = 0.01, nbinit.EM = 40, nbiter.MH = 50, nbchains.MH = 10)
MvBinaryEstim(x, nbcores = 1, algorithm = "HAC", modelslist = NULL, tol.EM = 0.01, nbinit.EM = 40, nbiter.MH = 50, nbchains.MH = 10)
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. |
Returns an instance of the [MvBinaryResult
] class.
# 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)
# 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)
The file MvBinaryExample.rda describes 400 individuals by 6 binary variables.
A matrix with 400 observations on the 6 variables.
This data set has been simulated from the MvBinary model. The first three variables are dependent. The last three variables are dependent.
data(MvBinaryExample)
data(MvBinaryExample)
This function computes the model Cramer's V for a binary data set.
MvBinaryProbaPost(x, param)
MvBinaryProbaPost(x, param)
x |
a binary matrix. |
param |
an instance of S4 class MvBinaryResult (provided by the function MvBinaryEstim) |
Return the logprobability for each row of matrix x conditionally on the model defined by param.
MvBinaryResult
] classThis S4 class contains the results from the function MvBinaryEstim.
numeric. It indicates the marginal probability of that each variables are equal to 1.
numeric. It indicates the dependency strength of each variables (between 0 and 1) with the other block variables.
binary. It indicates the kind of dependency: two variables affiliated into the same block are positively correlated if their delta are equal and they are negatively correlated otherwise.
numeric. It indicates the block of each variable.
numeric. It indicates the number of continuous parameters.
numeric. The model likelihood.
numeric. The model BIC.
getSlots("MvBinaryResult")
getSlots("MvBinaryResult")
The file plants.rda describes 35583 plants by indicating if they occur (1) or not (2) in 69 states of the Norht America.
A matrix with 35583 observations on the 69 variables.
This data set been extracted from the USA plants database, July 29, 2015.
data(plants)
data(plants)
This function prints the parameters resulting from MvBinaryEstim
.
## S4 method for signature 'MvBinaryResult' print(x)
## S4 method for signature 'MvBinaryResult' print(x)
x |
output object from |
This function gives the summary of output from MvBinaryEstim
.
## S4 method for signature 'MvBinaryResult' summary(object)
## S4 method for signature 'MvBinaryResult' summary(object)
object |
output object from |