Title: | Estimation for Scale-Shape Mixtures of Skew-Normal Distributions |
---|---|
Description: | Provide data generation and estimation tools for the multivariate scale mixtures of normal presented in Lange and Sinsheimer (1993) <doi:10.2307/1390698>, the multivariate scale mixtures of skew-normal presented in Zeller, Lachos and Vilca (2011) <doi:10.1080/02664760903406504>, the multivariate skew scale mixtures of normal presented in Louredo, Zeller and Ferreira (2021) <doi:10.1007/s13571-021-00257-y> and the multivariate scale mixtures of skew-normal-Cauchy presented in Kahrari et al. (2020) <doi:10.1080/03610918.2020.1804582>. |
Authors: | Clecio Ferreira [aut], Diego Gallardo [aut, cre], Camila Zeller [aut] |
Maintainer: | Diego Gallardo <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.6 |
Built: | 2024-12-11 07:02:28 UTC |
Source: | CRAN |
choose2 select a model inside the multivariate scale mixtures of normal (MSMN), the multivariate scale mixtures of skew-normal (MSMSN), the multivariate skew scale mixtures of normal (MSSMN) or/and the multivariate scale mixtures of skew-normal-Cauchy (MSMSNC) classes. See details for supported distributions within each class. Then, implement the covariates selection based on the significance, the Akaike's information criteria (AIC) or Schwartz's information criteria (BIC).
choose2(y, X = NULL, max.iter = 1000, prec = 1e-04, class = "MSMN", est.var = TRUE, criteria = "AIC", criteria.cov = "AIC", significance = 0.05, cluster = FALSE)
choose2(y, X = NULL, max.iter = 1000, prec = 1e-04, class = "MSMN", est.var = TRUE, criteria = "AIC", criteria.cov = "AIC", significance = 0.05, cluster = FALSE)
y |
The multivariate vector of responses. The univariate case also is supported. |
X |
The regressor matrix. |
max.iter |
The maximum number of iterations. |
prec |
The convergence tolerance for parameters. |
class |
class in which will be performed a distribution: MSMN (default), MSSMN, MSMSN, MSMSNC or ALL (which consider all the mentioned classes). See details. |
est.var |
Logical. If TRUE the standard errors are estimated. |
criteria |
criteria to perform the selection model: AIC (default) or BIC. |
criteria.cov |
criteria to perform the covariates selection: AIC (default), BIC or significance. |
significance |
the level of significance to perform the covariate selection. Only used if criteria.cov="significance". By default is 0.05. |
cluster |
logical. If TRUE, parallel computing is used. FALSE is the default value. |
Supported models are:
In MSMN class: multivariate normal (MN), multivariate Student t (MT), multivariate slash (MSL), multivariate contaminated normal (MCN). See Lange and Sinsheimer (1993) for details.
In MSMSN class: multivariate skew-normal (MSN), multivariate skew-T (MSTT), multivariate skew-slash (MSSL2), multivariate skew-contaminated normal (MSCN2). See Zeller, Lachos and Vilca-Labra (2011) for details.
In MSSMN class: MSN, multivariate skew-t-normal (MSTN), multivariate skew-slash normal (MSSL), multivariate skew-contaminated normal (MSCN). See Louredo, Zeller and Ferreira (2021) for details.
In MSMSNC class: multivariate skew-normal-Cauchy (MSNC), multivariate skew-t-Expected-Cauchy (MSTEC), multivariate skew-slash-Expected-Cauchy (MSSLEC), multivariate skew-contaminated-Expected-Cauchy (MSCEC). See Kahrari et al. (2020) for details.
Note: the MSN distribution belongs to both, MSMSN and MSSMN classes.
an object of class "skewMLRM" is returned. The object returned for this functions is a list containing the following components:
coefficients |
A named vector of coefficients |
se |
A named vector of the standard errors for the estimated coefficients. Valid if est.var is TRUE and the hessian matrix is invertible. |
logLik |
The log-likelihood function evaluated in the estimated parameters for the selected model |
AIC |
Akaike's Information Criterion for the selected model |
BIC |
Bayesian's Information Criterion for the selected model |
iterations |
the number of iterations until convergence (if attached) |
conv |
An integer code for the selected model. 0 indicates successful completion. 1 otherwise. |
dist |
The distribution for which was performed the estimation. |
class |
The class for which was performed the estimation. |
function |
a string with the name of the used function. |
choose.crit |
the specified criteria to choose the distribution. |
choose.crit.cov |
the specified criteria to choose the covariates. |
y |
The multivariate vector of responses. The univariate case also is supported. |
X |
The regressor matrix (in a list form). |
fitted.models |
A vector with the fitted models |
selected.model |
Selected model based on the specified criteria. |
fitted.class |
Selected class based on the specified criteria. |
comment |
A comment indicating how many coefficients were eliminated |
Clecio Ferreira, Diego Gallardo and Camila Zeller
Kahrari, F., Arellano-Valle, R.B., Ferreira, C.S., Gallardo, D.I. (2020) Some Simulation/computation in multivariate linear models of scale mixtures of skew-normal-Cauchy distributions. Communications in Statistics - Simulation and Computation. In press. DOI: 10.1080/03610918.2020.1804582
Lange, K., Sinsheimer, J.S. (1993). Normal/independent distributions and their applications in robust regression. Journal of Computational and Graphical Statistics 2, 175-198.
Louredo, G.M.S., Zeller, C.B., Ferreira, C.S. (2021). Estimation and influence diagnostics for the multivariate linear regression models with skew scale mixtures of normal distributions. Sankhya B. In press. DOI: 10.1007/s13571-021-00257-y
Zeller, C.B., Lachos, V.H., Vilca-Labra, F.E. (2011). Local influence analysis for regression models with scale mixtures of skew-normal distributions. Journal of Applied Statistics 38, 343-368.
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the covariate matrix X ##X ##Select a distribution within the MSMN class. Then, perform covariate ##selection based on the significance fit.MSMN=choose2(y, X, class="MSMN") summary(fit.MSMN) ##Identical process within the MSSMN class. ##may take some time on some systems fit.MSSMN=choose2(y, X, class="MSSMN") summary(fit.MSSMN)
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the covariate matrix X ##X ##Select a distribution within the MSMN class. Then, perform covariate ##selection based on the significance fit.MSMN=choose2(y, X, class="MSMN") summary(fit.MSMN) ##Identical process within the MSSMN class. ##may take some time on some systems fit.MSSMN=choose2(y, X, class="MSSMN") summary(fit.MSSMN)
choose.xxx select a model inside the xxx class, where xxx is the multivariate scale mixtures of normal (MSMN), the multivariate scale mixtures of skew-normal (MSMSN), the multivariate skew scale mixtures of normal (MSSMN) or the multivariate scale mixtures of skew-normal-Cauchy (MSMSNC) classes. See details for supported distributions within each class. choose.models select a model among the MSMN, MSMSN, MSSMN and MSMSNC classes.
choose.MSMN(y, X = NULL, max.iter = 1000, prec = 1e-4, est.var = TRUE, criteria = "AIC", cluster = FALSE) choose.MSMSN(y, X = NULL, max.iter = 1000, prec = 1e-4, est.var = TRUE, criteria = "AIC", cluster = FALSE) choose.MSSMN(y, X = NULL, max.iter = 1000, prec = 1e-4, est.var = TRUE, criteria = "AIC", cluster = FALSE) choose.MSMSNC(y, X = NULL, max.iter = 1000, prec = 1e-4, est.var = TRUE, criteria = "AIC", cluster = FALSE) choose.models(y, X = NULL, max.iter = 1000, prec = 1e-4, est.var = TRUE, criteria = "AIC", cluster = FALSE)
choose.MSMN(y, X = NULL, max.iter = 1000, prec = 1e-4, est.var = TRUE, criteria = "AIC", cluster = FALSE) choose.MSMSN(y, X = NULL, max.iter = 1000, prec = 1e-4, est.var = TRUE, criteria = "AIC", cluster = FALSE) choose.MSSMN(y, X = NULL, max.iter = 1000, prec = 1e-4, est.var = TRUE, criteria = "AIC", cluster = FALSE) choose.MSMSNC(y, X = NULL, max.iter = 1000, prec = 1e-4, est.var = TRUE, criteria = "AIC", cluster = FALSE) choose.models(y, X = NULL, max.iter = 1000, prec = 1e-4, est.var = TRUE, criteria = "AIC", cluster = FALSE)
y |
The multivariate vector of responses. The univariate case also is supported. |
X |
The regressor matrix. |
max.iter |
The maximum number of iterations. |
prec |
The convergence tolerance for parameters. |
est.var |
Logical. If TRUE the standard errors are estimated. |
criteria |
criteria to perform the selection model: AIC (default) or BIC. |
cluster |
logical. If TRUE, parallel computing is used. FALSE is the default value. |
Supported models are:
In MSMN class: multivariate normal (MN), multivariate Student t (MT), multivariate slash (MSL), multivariate contaminated normal (MCN). See Lange and Sinsheimer (1993) for details.
In MSMSN class: multivariate skew-normal (MSN), multivariate skew-T (MSTT), multivariate skew-slash (MSSL2), multivariate skew-contaminated normal (MSCN2). See Zeller, Lachos and Vilca-Labra (2011) for details.
In MSSMN class: MSN, multivariate skew-t-normal (MSTN), multivariate skew-slash normal (MSSL), multivariate skew-contaminated normal (MSCN). See Louredo, Zeller and Ferreira (2021) for details.
In MSMSNC class: multivariate skew-normal-Cauchy (MSNC), multivariate skew-t-Expected-Cauchy (MSTEC), multivariate skew-slash-Expected-Cauchy (MSSLEC), multivariate skew-contaminated-Expected-Cauchy (MSCEC). See Kahrari et al. (2020) for details.
Note: the MSN distribution belongs to both, MSMSN and MSSMN classes.
an object of class "skewMLRM" is returned. The object returned for this functions is a list containing the following components:
coefficients |
A named vector of coefficients |
se |
A named vector of the standard errors for the estimated coefficients. Valid if est.var is TRUE and the hessian matrix is invertible. |
logLik |
The log-likelihood function evaluated in the estimated parameters for the selected model |
AIC |
Akaike's Information Criterion for the selected model |
BIC |
Bayesian's Information Criterion for the selected model |
iterations |
the number of iterations until convergence (if attached) |
conv |
An integer code for the selected model. 0 indicates successful completion. 1 otherwise. |
dist |
The distribution for which was performed the estimation. |
class |
The class for which was performed the estimation. |
function |
a string with the name of the used function. |
choose.crit |
the specified criteria to choose the distribution. |
y |
The multivariate vector of responses. The univariate case also is supported. |
X |
The regressor matrix (in a list form). |
fitted.models |
A vector with the fitted models |
selected.model |
Selected model based on the specified criteria. |
comment |
A comment indicating how many coefficients were eliminated |
This function does not consider selection of covariates.
Clecio Ferreira, Diego Gallardo and Camila Zeller
Kahrari, F., Arellano-Valle, R.B., Ferreira, C.S., Gallardo, D.I. (2020) Some Simulation/computation in multivariate linear models of scale mixtures of skew-normal-Cauchy distributions. Communications in Statistics - Simulation and Computation. In press. DOI: 10.1080/03610918.2020.1804582
Lange, K., Sinsheimer, J.S. (1993). Normal/independent distributions and their applications in robust regression. Journal of Computational and Graphical Statistics 2, 175-198.
Louredo, G.M.S., Zeller, C.B., Ferreira, C.S. (2021). Estimation and influence diagnostics for the multivariate linear regression models with skew scale mixtures of normal distributions. Sankhya B. In press. DOI: 10.1007/s13571-021-00257-y
Zeller, C.B., Lachos, V.H., Vilca-Labra, F.E. (2011). Local influence analysis for regression models with scale mixtures of skew-normal distributions. Journal of Applied Statistics 38, 343-368.
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the covariate matrix X ##X ##Select a distribution within the MSMN class. fit.MSMN=choose.MSMN(y,X) summary(fit.MSMN) ##Identical process within the MSSMN class. ##may take some time on some systems fit.MSSMN=choose.MSSMN(y,X) summary(fit.MSSMN)
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the covariate matrix X ##X ##Select a distribution within the MSMN class. fit.MSMN=choose.MSMN(y,X) summary(fit.MSMN) ##Identical process within the MSSMN class. ##may take some time on some systems fit.MSSMN=choose.MSSMN(y,X) summary(fit.MSSMN)
Compute and plot the Mahalanobis distance for any supported model in the multivariate scale mixtures of normal (MSMN), multivariate scale mixtures of skew-normal (MSMSN), multivariate skew scale mixtures of normal (MSSMN) or multivariate scale mixtures of skew-normal-Cauchy (MSMSNC) classes. See details for supported distributions.
distMahal(object, alpha = 0.95, ...)
distMahal(object, alpha = 0.95, ...)
object |
an object of class "skewMLRM" returned by one of the following functions: estimate.xxx, choose.yyy, choose2, mbackcrit or mbacksign. See details for supported distributions. |
alpha |
significance level (0.05 by default). |
... |
aditional graphical parameters |
Supported models are:
In MSMN class: multivariate normal (MN), multivariate Student t (MT), multivariate slash (MSL), multivariate contaminated normal (MCN). See Lange and Sinsheimer (1993) for details.
In MSMSN class: multivariate skew-normal (MSN), multivariate skew-T (MSTT), multivariate skew-slash (MSSL2), multivariate skew-contaminated normal (MSCN2). See Zeller, Lachos and Vilca-Labra (2011) for details.
In MSSMN class: MSN, multivariate skew-t-normal (MSTN), multivariate skew-slash normal (MSSL), multivariate skew-contaminated normal (MSCN). See Louredo, Zeller and Ferreira (2021) for details.
In MSMSNC class: multivariate skew-normal-Cauchy (MSNC), multivariate skew-t-Expected-Cauchy (MSTEC), multivariate skew-slash-Expected-Cauchy (MSSLEC), multivariate skew-contaminated-Expected-Cauchy (MSCEC). See Kahrari et al. (2020) for details.
Note: the MSN distribution belongs to both, MSMSN and MSSMN classes.
distMahal provides an object of class skewMLRM related to compute the Mahalanobis distance for all the observations and a cut-off to detect possible influent observations based on the specified significance (0.05 by default).
an object of class "skewMLRM" is returned. The object returned for this functions is a list containing the following components:
Mahal |
the Mahalanobis distance for all the observations |
function |
a string with the name of the used function. |
dist |
The distribution for which was performed the estimation. |
class |
The class for which was performed the estimation. |
alpha |
specified level of significance (0.05 by default). |
cut |
the cut-off to detect possible influent observations based on the specified significance. |
y |
The multivariate vector of responses. The univariate case also is supported. |
X |
The regressor matrix (in a list form). |
Clecio Ferreira, Diego Gallardo and Camila Zeller
Kahrari, F., Arellano-Valle, R.B., Ferreira, C.S., Gallardo, D.I. (2020) Some Simulation/computation in multivariate linear models of scale mixtures of skew-normal-Cauchy distributions. Communications in Statistics - Simulation and Computation. In press. DOI: 10.1080/03610918.2020.1804582
Lange, K., Sinsheimer, J.S. (1993). Normal/independent distributions and their applications in robust regression. Journal of Computational and Graphical Statistics 2, 175-198.
Louredo, G.M.S., Zeller, C.B., Ferreira, C.S. (2021). Estimation and influence diagnostics for the multivariate linear regression models with skew scale mixtures of normal distributions. Sankhya B. In press. DOI: 10.1007/s13571-021-00257-y
Zeller, C.B., Lachos, V.H., Vilca-Labra, F.E. (2011). Local influence analysis for regression models with scale mixtures of skew-normal distributions. Journal of Applied Statistics 38, 343-368.
set.seed(2020) n=200 # length of the sample nv<-3 # number of explanatory variables p<-nv+1 # nv + intercept m<-4 # dimension of Y q0=p*m X<-array(0,c(q0,m,n)) for(i in 1:n) { aux=rep(1,p) aux[2:p]<-rMN(1,mu=rnorm(nv),Sigma=diag(nv)) ##simulating covariates mi=matrix(0,q0,m) for (j in 1:m) mi[((j-1)*p+1):(j*p),j]=aux X[,,i]<-mi } ##X is the simulated regressor matrix betas<-matrix(rnorm(q0),ncol=1) ##True betas Sigmas <- clusterGeneration::genPositiveDefMat(m,rangeVar=c(1,3), lambdaLow=1, ratioLambda=3)$Sigma ##True Sigma y=matrix(0,n,m) for(i in 1:n) { mui<-t(X[,,i])%*%betas y[i,]<-rMN(n=1,c(mui),Sigmas) ## simulating the response vector } fit.MN=estimate.MN(y,X) #fit the MN model mahal.MN=distMahal(fit.MN) #compute the Mahalanobis distances for MN model plot(mahal.MN) #plot the Mahalanobis distances for MN model mahal.MN$Mahal #presents the Malahanobis distances
set.seed(2020) n=200 # length of the sample nv<-3 # number of explanatory variables p<-nv+1 # nv + intercept m<-4 # dimension of Y q0=p*m X<-array(0,c(q0,m,n)) for(i in 1:n) { aux=rep(1,p) aux[2:p]<-rMN(1,mu=rnorm(nv),Sigma=diag(nv)) ##simulating covariates mi=matrix(0,q0,m) for (j in 1:m) mi[((j-1)*p+1):(j*p),j]=aux X[,,i]<-mi } ##X is the simulated regressor matrix betas<-matrix(rnorm(q0),ncol=1) ##True betas Sigmas <- clusterGeneration::genPositiveDefMat(m,rangeVar=c(1,3), lambdaLow=1, ratioLambda=3)$Sigma ##True Sigma y=matrix(0,n,m) for(i in 1:n) { mui<-t(X[,,i])%*%betas y[i,]<-rMN(n=1,c(mui),Sigmas) ## simulating the response vector } fit.MN=estimate.MN(y,X) #fit the MN model mahal.MN=distMahal(fit.MN) #compute the Mahalanobis distances for MN model plot(mahal.MN) #plot the Mahalanobis distances for MN model mahal.MN$Mahal #presents the Malahanobis distances
estimate.Mxxx computes the maximum likelihood estimates for the distribution xxx, where xxx is any supported model in the multivariate scale mixtures of normal (MSMN), multivariate scale mixtures of skew-normal (MSMSN), multivariate skew scale mixtures of normal (MSSMN) or multivariate scale mixtures of skew-normal-Cauchy (MSMSNC) classes. See details for supported distributions.
estimate.MN(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE) estimate.MT(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.min = 2.0001) estimate.MSL(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.min = 2.0001) estimate.MCN(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE) estimate.MSN(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE) estimate.MSTN(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.min = 2.0001) estimate.MSSL(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.min = 2.0001) estimate.MSCN(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE) estimate.MSTT(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.fixed = 3, nu.min = 2.0001) estimate.MSSL2(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.fixed = 3, nu.min = 2.0001) estimate.MSCN2(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.fixed = 0.5, gamma.fixed = 0.5) estimate.MSNC(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE) estimate.MSTEC(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.fixed = 3, nu.min = 2.0001) estimate.MSSLEC(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.fixed = 3, nu.min = 2.0001) estimate.MSCEC(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.fixed = 0.5, gamma.fixed = 0.5)
estimate.MN(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE) estimate.MT(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.min = 2.0001) estimate.MSL(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.min = 2.0001) estimate.MCN(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE) estimate.MSN(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE) estimate.MSTN(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.min = 2.0001) estimate.MSSL(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.min = 2.0001) estimate.MSCN(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE) estimate.MSTT(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.fixed = 3, nu.min = 2.0001) estimate.MSSL2(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.fixed = 3, nu.min = 2.0001) estimate.MSCN2(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.fixed = 0.5, gamma.fixed = 0.5) estimate.MSNC(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE) estimate.MSTEC(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.fixed = 3, nu.min = 2.0001) estimate.MSSLEC(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.fixed = 3, nu.min = 2.0001) estimate.MSCEC(y, X, max.iter = 1000, prec = 1e-04, est.var = TRUE, nu.fixed = 0.5, gamma.fixed = 0.5)
y |
The multivariate vector of responses. The univariate case also is supported. |
X |
The regressor matrix. |
max.iter |
The maximum number of iterations. |
prec |
The convergence tolerance for parameters. |
est.var |
Logical. If TRUE the standard errors are estimated. |
nu.fixed |
If a numerical value is provided, the estimation consider nu as fixed. To estimate nu, use nu.fixed=FALSE. Avaliable for MSTT, MSSL2, MSCN2, MSTEC, MSSLEC and MSCEC distributions. For MSTT, MSSL2, MSTEC and MSSLEC, the default value is 3 and nu should be greater than 1. For MSCN2 and MSCEC, the default value is 0.5 and nu should be in the (0,1) interval. |
gamma.fixed |
If a numerical value is provided, the estimation consider gamma as fixed. To estimate gamma, use gamma.fixed=FALSE. Avaliable for MSCN2 and MSCEC distributions. For MSCN2 and MSCEC, the default value is 0.5 and gamma should be in the (0,1) interval. |
nu.min |
Lower value to perform the maximization for nu. For MSTT, MSSL2, MSTEC and MSSLEC is used only when nu.fixed=FALSE. |
Supported models are:
In MSMN class: multivariate normal (MN), multivariate Student t (MT), multivariate slash (MSL), multivariate contaminated normal (MCN). See Lange and Sinsheimer (1993) for details.
In MSMSN class: multivariate skew-normal (MSN), multivariate skew-T (MSTT), multivariate skew-slash (MSSL2), multivariate skew-contaminated normal (MSCN2). See Zeller, Lachos and Vilca-Labra (2011) for details.
In MSSMN class: MSN, multivariate skew-t-normal (MSTN), multivariate skew-slash normal (MSSL), multivariate skew-contaminated normal (MSCN). See Louredo, Zeller and Ferreira (2021) for details.
In MSMSNC class: multivariate skew-normal-Cauchy (MSNC), multivariate skew-t-Expected-Cauchy (MSTEC), multivariate skew-slash-Expected-Cauchy (MSSLEC), multivariate skew-contaminated-Expected-Cauchy (MSCEC). See Kahrari et al. (2020) for details.
Note: the MSN distribution belongs to both, MSMSN and MSSMN classes.
an object of class "skewMLRM" is returned. The object returned for this functions is a list containing the following components:
coefficients |
A named vector of coefficients |
se |
A named vector of the standard errors for the estimated coefficients. Valid if est.var is TRUE and the hessian matrix is invertible. |
nu |
The estimated or fixed nu (only for MSTT, MSSL2, MSCN2, MSTEC, MSSLEC and MSCEC models) |
gamma |
The estimated or fixed gamma (only for MSCN2 and MSCEC models) |
logLik |
The log-likelihood function evaluated in the estimated parameters |
AIC |
Akaike's Information Criterion |
BIC |
Bayesian's Information Criterion |
iterations |
the number of iterations until convergence (if attached) |
time |
execution time in seconds |
conv |
An integer code. 0 indicates successful completion. 1 otherwise. |
dist |
The distribution for which was performed the estimation. |
class |
The class for which was performed the estimation. |
n |
The sample size |
y |
The multivariate vector of responses. The univariate case also is supported. |
X |
The regressor matrix (in a list form). |
function |
a string with the name of the used function. |
In MT, MSL, MSTN, MSSL, MSTT, MSSL2, MSTEC and MSSLEC distributions, nu>2 guarantees that the mean and variance exist, nu>1 guarantees the existence only for the mean and for nu<=1, the mean and variance of the distribution is not finite.
Clecio Ferreira, Diego Gallardo and Camila Zeller
Kahrari, F., Arellano-Valle, R.B., Ferreira, C.S., Gallardo, D.I. (2020) Some Simulation/computation in multivariate linear models of scale mixtures of skew-normal-Cauchy distributions. Communications in Statistics - Simulation and Computation. In press. DOI: 10.1080/03610918.2020.1804582
Lange, K., Sinsheimer, J.S. (1993). Normal/independent distributions and their applications in robust regression. Journal of Computational and Graphical Statistics 2, 175-198.
Louredo, G.M.S., Zeller, C.B., Ferreira, C.S. (2021). Estimation and influence diagnostics for the multivariate linear regression models with skew scale mixtures of normal distributions. Sankhya B. In press. DOI: 10.1007/s13571-021-00257-y
Zeller, C.B., Lachos, V.H., Vilca-Labra, F.E. (2011). Local influence analysis for regression models with scale mixtures of skew-normal distributions. Journal of Applied Statistics 38, 343-368.
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the covariate matrix X ##X fit.MN=estimate.MN(y, X) ##Estimate the parameters for the MN regression model summary(fit.MN) fit.MT=estimate.MT(y, X) ##Estimate the parameters for the MT regression model summary(fit.MT) ##may take some time on some systems fit.MSSL=estimate.MSSL(y, X) ##Estimate the parameters for the MSSL regression model summary(fit.MSSL) fit.MSTT=estimate.MSTT(y, X) ##Estimate the parameters for the MSTT regression model summary(fit.MSTT) fit.MSNC=estimate.MSNC(y, X) ##Estimate the parameters for the MSNC regression model summary(fit.MSNC) fit.MSCEC=estimate.MSCEC(y, X) ##Estimate the parameters for the MSCEC regression model summary(fit.MSCEC)
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the covariate matrix X ##X fit.MN=estimate.MN(y, X) ##Estimate the parameters for the MN regression model summary(fit.MN) fit.MT=estimate.MT(y, X) ##Estimate the parameters for the MT regression model summary(fit.MT) ##may take some time on some systems fit.MSSL=estimate.MSSL(y, X) ##Estimate the parameters for the MSSL regression model summary(fit.MSSL) fit.MSTT=estimate.MSTT(y, X) ##Estimate the parameters for the MSTT regression model summary(fit.MSTT) fit.MSNC=estimate.MSNC(y, X) ##Estimate the parameters for the MSNC regression model summary(fit.MSNC) fit.MSCEC=estimate.MSCEC(y, X) ##Estimate the parameters for the MSCEC regression model summary(fit.MSCEC)
FI.xxx computes the observed Fisher information (FI) matrix for the distribution xxx, where xxx is any supported model in the multivariate scale mixtures of normal (MSMN), multivariate scale mixtures of skew-normal (MSMSN), multivariate skew scale mixtures of normal (MSSMN) or multivariate scale mixtures of skew-normal-Cauchy (MSMSNC) classes. See details for supported distributions.
FI.MN(P, y, X) FI.MT(P, y, X) FI.MSL(P, y, X) FI.MCN(P, y, X) FI.MSN(P, y, X) FI.MSTN(P, y, X) FI.MSSL(P, y, X) FI.MSCN(P, y, X) FI.MSTT(P, y, X, nu) FI.MSSL2(P, y, X, nu) FI.MSCN2(P, y, X, nu, gamma) FI.MSNC(P, y, X) FI.MSTEC(P, y, X, nu) FI.MSSLEC(P, y, X, nu) FI.MSCEC(P, y, X, nu, gamma)
FI.MN(P, y, X) FI.MT(P, y, X) FI.MSL(P, y, X) FI.MCN(P, y, X) FI.MSN(P, y, X) FI.MSTN(P, y, X) FI.MSSL(P, y, X) FI.MSCN(P, y, X) FI.MSTT(P, y, X, nu) FI.MSSL2(P, y, X, nu) FI.MSCN2(P, y, X, nu, gamma) FI.MSNC(P, y, X) FI.MSTEC(P, y, X, nu) FI.MSSLEC(P, y, X, nu) FI.MSCEC(P, y, X, nu, gamma)
P |
the estimated parameters returned by a function of the form estimate.xxx, where xxx is a supported distribution. |
y |
The multivariate vector of responses. The univariate case also is supported. |
X |
The regressor matrix. |
nu |
nu parameter. Only for MSTT, MSSL2, MSTEC, MSSLEC and MSCEC distributions. |
gamma |
gamma parameter. Only for MSCN2 and MSCEC distributions. |
Supported models are:
In MSMN class: multivariate normal (MN), multivariate Student t (MT), multivariate slash (MSL), multivariate contaminated normal (MCN). See Lange and Sinsheimer (1993) for details.
In MSMSN class: multivariate skew-normal (MSN), multivariate skew-T (MSTT), multivariate skew-slash (MSSL2), multivariate skew-contaminated normal (MSCN2). See Zeller, Lachos and Vilca-Labra (2011) for details.
In MSSMN class: MSN, multivariate skew-t-normal (MSTN), multivariate skew-slash normal (MSSL), multivariate skew-contaminated normal (MSCN). See Louredo, Zeller and Ferreira (2021) for details.
In MSMSNC class: multivariate skew-normal-Cauchy (MSNC), multivariate skew-t-Expected-Cauchy (MSTEC), multivariate skew-slash-Expected-Cauchy (MSSLEC), multivariate skew-contaminated-Expected-Cauchy (MSCEC). See Kahrari et al. (2020) for details.
Note: the MSN distribution belongs to both, MSMSN and MSSMN classes.
A matrix with the observed FI matrix for the specified model.
For MSTEC and MSSLEC and distributions, nu>0 is considered as fixed. For MSCEC distribution, 0<nu<1 and 0<gamma<1 are considered as fixed.
Clecio Ferreira, Diego Gallardo and Camila Zeller.
Kahrari, F., Arellano-Valle, R.B., Ferreira, C.S., Gallardo, D.I. (2020) Some Simulation/computation in multivariate linear models of scale mixtures of skew-normal-Cauchy distributions. Communications in Statistics - Simulation and Computation. In press. DOI: 10.1080/03610918.2020.1804582
Lange, K., Sinsheimer, J.S. (1993). Normal/independent distributions and their applications in robust regression. Journal of Computational and Graphical Statistics 2, 175-198.
Louredo, G.M.S., Zeller, C.B., Ferreira, C.S. (2021). Estimation and influence diagnostics for the multivariate linear regression models with skew scale mixtures of normal distributions. Sankhya B. In press. DOI: 10.1007/s13571-021-00257-y
Zeller, C.B., Lachos, V.H., Vilca-Labra, F.E. (2011). Local influence analysis for regression models with scale mixtures of skew-normal distributions. Journal of Applied Statistics 38, 343-368.
set.seed(2020) n=200 # length of the sample nv<-3 # number of explanatory variables p<-nv+1 # nv + intercept m<-4 # dimension of Y q0=p*m X<-array(0,c(q0,m,n)) for(i in 1:n) { aux=rep(1,p) aux[2:p]<-rMN(1,mu=rnorm(nv),Sigma=diag(nv)) mi=matrix(0,q0,m) for (j in 1:m) mi[((j-1)*p+1):(j*p),j]=aux X[,,i]<-mi } #Simulated matrix covariates betas<-matrix(rnorm(q0),ncol=1) ## True betas Sigmas <- clusterGeneration::genPositiveDefMat(m,rangeVar=c(1,3), lambdaLow=1, ratioLambda=3)$Sigma ##True Sigma lambda<-rnorm(m) ##True lambda y=matrix(0,n,m) for(i in 1:n) { mui<-t(X[,,i])%*%betas y[i,]<-rMSN(n=1,c(mui),Sigmas,lambda)} fit.MSN=estimate.MSN(y,X) ##Estimate parameters for MSN model fit.MSN ## Output of estimate.MSN summary(fit.MSN) fit.MSN$se ##Estimated standard errors by the estimate.MSN function ##Estimated standard errors by minus the square root of ##the diagonal from the observed FI matrix of the MSN model sqrt(diag(solve(-FI.MSN(fit.MSN$coefficients, y, X))))
set.seed(2020) n=200 # length of the sample nv<-3 # number of explanatory variables p<-nv+1 # nv + intercept m<-4 # dimension of Y q0=p*m X<-array(0,c(q0,m,n)) for(i in 1:n) { aux=rep(1,p) aux[2:p]<-rMN(1,mu=rnorm(nv),Sigma=diag(nv)) mi=matrix(0,q0,m) for (j in 1:m) mi[((j-1)*p+1):(j*p),j]=aux X[,,i]<-mi } #Simulated matrix covariates betas<-matrix(rnorm(q0),ncol=1) ## True betas Sigmas <- clusterGeneration::genPositiveDefMat(m,rangeVar=c(1,3), lambdaLow=1, ratioLambda=3)$Sigma ##True Sigma lambda<-rnorm(m) ##True lambda y=matrix(0,n,m) for(i in 1:n) { mui<-t(X[,,i])%*%betas y[i,]<-rMSN(n=1,c(mui),Sigmas,lambda)} fit.MSN=estimate.MSN(y,X) ##Estimate parameters for MSN model fit.MSN ## Output of estimate.MSN summary(fit.MSN) fit.MSN$se ##Estimated standard errors by the estimate.MSN function ##Estimated standard errors by minus the square root of ##the diagonal from the observed FI matrix of the MSN model sqrt(diag(solve(-FI.MSN(fit.MSN$coefficients, y, X))))
Compute the square root of a matrix
matrix.sqrt(A)
matrix.sqrt(A)
A |
a symmetric semi-definite positive matrix |
A symmetric matrix, say B, such as B^t*B=A
For internal use.
Clecio Ferreira, Diego Gallardo and Camila Zeller.
A<-matrix(c(1,2,2,5),nrow=2) B<-matrix.sqrt(A) ##Recovering A t(B)%*%B A
A<-matrix(c(1,2,2,5),nrow=2) B<-matrix.sqrt(A) ##Recovering A t(B)%*%B A
mbackcrit implements the covariates selection based on backward and the Akaike's information criteria (AIC) or Schwartz's information criteria (BIC) in a specified multivariate model in the multivariate scale mixtures of normal (MSMN), multivariate scale mixtures of skew-normal (MSMSN), multivariate skew scale mixtures of normal (MSSMN) or multivariate scale mixtures of skew-normal-Cauchy (MSMSNC) classes. See details for avaliable distributions.
mbackcrit(y, X = NULL, max.iter = 1000, prec = 1e-04, dist = "MN", criteria = "AIC", est.var=TRUE, cluster = FALSE, ...)
mbackcrit(y, X = NULL, max.iter = 1000, prec = 1e-04, dist = "MN", criteria = "AIC", est.var=TRUE, cluster = FALSE, ...)
y |
The multivariate vector of responses. The univariate case also is supported. |
X |
The regressor matrix. It should include intercept term for all the variates. |
max.iter |
The maximum number of iterations. |
prec |
The convergence tolerance for parameters. |
dist |
the multivariate distribution in which the covariates selection will be implemented. |
criteria |
criteria used to perform the covariates selection. AIC (default) and BIC avaliable. |
est.var |
Logical. If TRUE the standard errors are estimated. |
cluster |
logical. If TRUE, parallel computing is used. FALSE is the default value. |
... |
Possible aditional arguments. For instance, for MSTT, MSSL2, MSTEC and MSSLEC distributions should be added nu.min and nu.fixed related to specifications for the nu parameter. |
Supported models are:
In MSMN class: multivariate normal (MN), multivariate Student t (MT), multivariate slash (MSL), multivariate contaminated normal (MCN). See Lange and Sinsheimer (1993) for details.
In MSMSN class: multivariate skew-normal (MSN), multivariate skew-T (MSTT), multivariate skew-slash (MSSL2), multivariate skew-contaminated normal (MSCN2). See Zeller, Lachos and Vilca-Labra (2011) for details.
In MSSMN class: MSN, multivariate skew-t-normal (MSTN), multivariate skew-slash normal (MSSL), multivariate skew-contaminated normal (MSCN). See Louredo, Zeller and Ferreira (2021) for details.
In MSMSNC class: multivariate skew-normal-Cauchy (MSNC), multivariate skew-t-Expected-Cauchy (MSTEC), multivariate skew-slash-Expected-Cauchy (MSSLEC), multivariate skew-contaminated-Expected-Cauchy (MSCEC). See Kahrari et al. (2020) for details.
Note: the MSN distribution belongs to both, MSMSN and MSSMN classes.
an object of class "skewMLRM" is returned. The object returned for this functions is a list containing the following components:
coefficients |
A named vector of coefficients |
se |
A named vector of the standard errors for the estimated coefficients. Valid if est.var is TRUE and the hessian matrix is invertible. |
logLik |
The log-likelihood function evaluated in the estimated parameters for the selected model |
AIC |
Akaike's Information Criterion for the selected model |
BIC |
Bayesian's Information Criterion for the selected model |
iterations |
the number of iterations until convergence (if attached) |
conv |
An integer code for the selected model. 0 indicates successful completion. 1 otherwise. |
dist |
The distribution for which was performed the estimation. |
class |
The class for which was performed the estimation. |
choose.crit |
the specified criteria to choose the distribution. |
comment |
A comment indicating how many coefficients were eliminated |
y |
The multivariate vector of responses. The univariate case also is supported. |
X |
The regressor matrix (in a list form). |
function |
a string with the name of the used function. |
Clecio Ferreira, Diego Gallardo and Camila Zeller.
Kahrari, F., Arellano-Valle, R.B., Ferreira, C.S., Gallardo, D.I. (2020) Some Simulation/computation in multivariate linear models of scale mixtures of skew-normal-Cauchy distributions. Communications in Statistics - Simulation and Computation. In press. DOI: 10.1080/03610918.2020.1804582
Lange, K., Sinsheimer, J.S. (1993). Normal/independent distributions and their applications in robust regression. Journal of Computational and Graphical Statistics 2, 175-198.
Louredo, G.M.S., Zeller, C.B., Ferreira, C.S. (2021). Estimation and influence diagnostics for the multivariate linear regression models with skew scale mixtures of normal distributions. Sankhya B. In press. DOI: 10.1007/s13571-021-00257-y
Zeller, C.B., Lachos, V.H., Vilca-Labra, F.E. (2011). Local influence analysis for regression models with scale mixtures of skew-normal distributions. Journal of Applied Statistics 38, 343-368.
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the regressor matrix X ##X ##Perform covariates selection in the MN distribution ##based on the AIC criteria ##may take some time on some systems fit.MN=mbackcrit(y, X, dist="MN") summary(fit.MN) ##Identical process for MT distribution fit.MT=mbackcrit(y, X, dist="MT") summary(fit.MT) ##and for MSN distribution fit.MSN=mbackcrit(y, X, dist="MSN") summary(fit.MSN)
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the regressor matrix X ##X ##Perform covariates selection in the MN distribution ##based on the AIC criteria ##may take some time on some systems fit.MN=mbackcrit(y, X, dist="MN") summary(fit.MN) ##Identical process for MT distribution fit.MT=mbackcrit(y, X, dist="MT") summary(fit.MT) ##and for MSN distribution fit.MSN=mbackcrit(y, X, dist="MSN") summary(fit.MSN)
mbacksign implements the covariates selection based on the significance of the covariates in a specified multivariate model in the multivariate scale mixtures of normal (MSMN), multivariate scale mixtures of skew-normal (MSMSN), multivariate skew scale mixtures of normal (MSSMN) or multivariate scale mixtures of skew-normal-Cauchy (MSMSNC) classes. See details for avaliable distributions.
mbacksign(y, X = NULL, max.iter = 1000, prec = 1e-04, dist = "MN", significance = 0.05, ...)
mbacksign(y, X = NULL, max.iter = 1000, prec = 1e-04, dist = "MN", significance = 0.05, ...)
y |
The multivariate vector of responses. The univariate case also is supported. |
X |
The regressor matrix. It should include intercept term for all the variates. |
max.iter |
The maximum number of iterations. |
prec |
The convergence tolerance for parameters. |
dist |
the multivariate distribution in which the covariates selection will be implemented. |
significance |
the level of significance to perform the covariate selection. By default is 0.05. |
... |
Possible aditional arguments. For instance, for MSTT, MSSL2, MSTEC and MSSLEC distributions should be added nu.min and nu.fixed related to specifications for the nu parameter. |
Supported models are:
In MSMN class: multivariate normal (MN), multivariate Student t (MT), multivariate slash (MSL), multivariate contaminated normal (MCN). See Lange and Sinsheimer (1993) for details.
In MSMSN class: multivariate skew-normal (MSN), multivariate skew-T (MSTT), multivariate skew-slash (MSSL2), multivariate skew-contaminated normal (MSCN2). See Zeller, Lachos and Vilca-Labra (2011) for details.
In MSSMN class: MSN, multivariate skew-t-normal (MSTN), multivariate skew-slash normal (MSSL), multivariate skew-contaminated normal (MSCN). See Louredo, Zeller and Ferreira (2021) for details.
In MSMSNC class: multivariate skew-normal-Cauchy (MSNC), multivariate skew-t-Expected-Cauchy (MSTEC), multivariate skew-slash-Expected-Cauchy (MSSLEC), multivariate skew-contaminated-Expected-Cauchy (MSCEC). See Kahrari et al. (2020) for details.
Note: the MSN distribution belongs to both, MSMSN and MSSMN classes.
an object of class "skewMLRM" is returned. The object returned for this functions is a list containing the following components:
coefficients |
A named vector of coefficients |
se |
A named vector of the standard errors for the estimated coefficients. Valid if est.var is TRUE and the hessian matrix is invertible. |
logLik |
The log-likelihood function evaluated in the estimated parameters for the selected model |
AIC |
Akaike's Information Criterion for the selected model |
BIC |
Bayesian's Information Criterion for the selected model |
iterations |
the number of iterations until convergence (if attached) |
conv |
An integer code for the selected model. 0 indicates successful completion. 1 otherwise. |
dist |
The distribution for which was performed the estimation. |
class |
The class for which was performed the estimation. |
choose.crit |
the specified criteria to choose the distribution. |
comment |
A comment indicating how many coefficients were eliminated |
eliminated |
An string vector with the eliminated betas (in order of elimination). |
y |
The multivariate vector of responses. The univariate case also is supported. |
X |
The regressor matrix (in a list form). |
significance |
The specified level of significance (0.05 by default). |
function |
a string with the name of the used function. |
Clecio Ferreira, Diego Gallardo and Camila Zeller.
Kahrari, F., Arellano-Valle, R.B., Ferreira, C.S., Gallardo, D.I. (2020) Some Simulation/computation in multivariate linear models of scale mixtures of skew-normal-Cauchy distributions. Communications in Statistics - Simulation and Computation. In press. DOI: 10.1080/03610918.2020.1804582
Lange, K., Sinsheimer, J.S. (1993). Normal/independent distributions and their applications in robust regression. Journal of Computational and Graphical Statistics 2, 175-198.
Louredo, G.M.S., Zeller, C.B., Ferreira, C.S. (2021). Estimation and influence diagnostics for the multivariate linear regression models with skew scale mixtures of normal distributions. Sankhya B. In press. DOI: 10.1007/s13571-021-00257-y
Zeller, C.B., Lachos, V.H., Vilca-Labra, F.E. (2011). Local influence analysis for regression models with scale mixtures of skew-normal distributions. Journal of Applied Statistics 38, 343-368.
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the regressor matrix X ##X ##Perform covariates selection in the MN distribution ##based on a significance level of 1%, 5% and 10% ##may take some time on some systems fit.MN.01=mbacksign(y, X, dist="MN", sign=0.01) fit.MN.05=mbacksign(y, X, dist="MN", sign=0.05) fit.MN.10=mbacksign(y, X, dist="MN", sign=0.10) summary(fit.MN.01) summary(fit.MN.05) summary(fit.MN.10) ##identical process in the MCN model with ##significance level of 5% fit.MCN=mbacksign(y, X, dist="MCN") summary(fit.MCN) ##for MSSL model fit.MSSL=mbacksign(y, X, dist="MSSL") summary(fit.MSSL) ##for MSNC model fit.MSNC=mbacksign(y, X, dist="MSNC") summary(fit.MSNC)
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the regressor matrix X ##X ##Perform covariates selection in the MN distribution ##based on a significance level of 1%, 5% and 10% ##may take some time on some systems fit.MN.01=mbacksign(y, X, dist="MN", sign=0.01) fit.MN.05=mbacksign(y, X, dist="MN", sign=0.05) fit.MN.10=mbacksign(y, X, dist="MN", sign=0.10) summary(fit.MN.01) summary(fit.MN.05) summary(fit.MN.10) ##identical process in the MCN model with ##significance level of 5% fit.MCN=mbacksign(y, X, dist="MCN") summary(fit.MCN) ##for MSSL model fit.MSSL=mbacksign(y, X, dist="MSSL") summary(fit.MSSL) ##for MSNC model fit.MSNC=mbacksign(y, X, dist="MSNC") summary(fit.MSNC)
Plot the Mahalanobis distance for a object of the class "skewMLRM" produced by the function distMahal.
## S3 method for class 'skewMLRM' plot(x, ...)
## S3 method for class 'skewMLRM' plot(x, ...)
x |
an object of the class "skewMLRM" produced by the function distMahal. |
... |
for graphical extra arguments |
Supported models are:
In MSMN class: multivariate normal (MN), multivariate Student t (MT), multivariate slash (MSL), multivariate contaminated normal (MCN). See Lange and Sinsheimer (1993) for details.
In MSMSN class: multivariate skew-normal (MSN), multivariate skew-T (MSTT), multivariate skew-slash (MSSL2), multivariate skew-contaminated normal (MSCN2). See Zeller, Lachos and Vilca-Labra (2011) for details.
In MSSMN class: MSN, multivariate skew-t-normal (MSTN), multivariate skew-slash normal (MSSL), multivariate skew-contaminated normal (MSCN). See Louredo, Zeller and Ferreira (2021) for details.
In MSMSNC class: multivariate skew-normal-Cauchy (MSNC), multivariate skew-t-Expected-Cauchy (MSTEC), multivariate skew-slash-Expected-Cauchy (MSSLEC), multivariate skew-contaminated-Expected-Cauchy (MSCEC). See Kahrari et al. (2020) for details.
Note: the MSN distribution belongs to both, MSMSN and MSSMN classes.
The functions which generate an object of the class "skewMLRM" are
estimate.xxx: where xxx can be MN, MT, MSL, MCN, MSN, MSTN, MSSL, MSCN, MSTT, MSSL2, MSCN2, MSNC, MSTEC, MSSLEC or MSCEC.
choose.yyy: where yyy can be MSMN, MSSMN, MSMSN, MSMSNC or models.
chose2, mbackcrit and mbacksign.
A complete summary for the coefficients extracted from a skewMLRM object.
Clecio Ferreira, Diego Gallardo and Camila Zeller
Kahrari, F., Arellano-Valle, R.B., Ferreira, C.S., Gallardo, D.I. (2020) Some Simulation/computation in multivariate linear models of scale mixtures of skew-normal-Cauchy distributions. Communications in Statistics - Simulation and Computation. In press. DOI: 10.1080/03610918.2020.1804582
Lange, K., Sinsheimer, J.S. (1993). Normal/independent distributions and their applications in robust regression. Journal of Computational and Graphical Statistics 2, 175-198.
Louredo, G.M.S., Zeller, C.B., Ferreira, C.S. (2021). Estimation and influence diagnostics for the multivariate linear regression models with skew scale mixtures of normal distributions. Sankhya B. In press. DOI: 10.1007/s13571-021-00257-y
Zeller, C.B., Lachos, V.H., Vilca-Labra, F.E. (2011). Local influence analysis for regression models with scale mixtures of skew-normal distributions. Journal of Applied Statistics 38, 343-368.
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the covariate matrix X ##X fit.MN=estimate.MN(y, X) #Fit the MN distribution res.MN=distMahal(fit.MN) #Compute the Mahalanobis distances plot(res.MN) #Plot the Mahalanobis distances # fit.MSN=estimate.MSN(y, X) #Fit the MSN distribution res.MSN=distMahal(fit.MSN) #Compute the Mahalanobis distances plot(res.MSN) #Plot the Mahalanobis distances
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the covariate matrix X ##X fit.MN=estimate.MN(y, X) #Fit the MN distribution res.MN=distMahal(fit.MN) #Compute the Mahalanobis distances plot(res.MN) #Plot the Mahalanobis distances # fit.MSN=estimate.MSN(y, X) #Fit the MSN distribution res.MSN=distMahal(fit.MSN) #Compute the Mahalanobis distances plot(res.MSN) #Plot the Mahalanobis distances
rxxx generates random values for the distribution xxx, where xxx is any supported model in the multivariate scale mixtures of normal (MSMN), multivariate scale mixtures of skew-normal (MSMSN), multivariate skew scale mixtures of normal (MSSMN) or multivariate scale mixtures of skew-normal-Cauchy (MSMSNC) classes. See details for supported distributions.
rMN(n, mu, Sigma) rMT(n, mu, Sigma, nu = 1) rMSL(n, mu, Sigma, nu = 1) rMCN(n, mu, Sigma, nu = 0.5, gamma = 0.5) rMSN(n, mu, Sigma, lambda) rMSTN(n, mu, Sigma, lambda, nu = 1) rMSSL(n, mu, Sigma, lambda, nu = 1) rMSCN(n, mu, Sigma, lambda, nu = 0.5, gamma = 0.5) rMSTT(n, mu, Sigma, lambda, nu = 1) rMSSL2(n, mu, Sigma, lambda, nu = 1) rMSCN2(n, mu, Sigma, lambda, nu = 0.5, gamma = 0.5) rMSNC(n, mu, Sigma, lambda) rMSTEC(n, mu, Sigma, lambda, nu = 1) rMSSLEC(n, mu, Sigma, lambda, nu = 1) rMSCEC(n, mu, Sigma, lambda, nu = 0.5, gamma = 0.5)
rMN(n, mu, Sigma) rMT(n, mu, Sigma, nu = 1) rMSL(n, mu, Sigma, nu = 1) rMCN(n, mu, Sigma, nu = 0.5, gamma = 0.5) rMSN(n, mu, Sigma, lambda) rMSTN(n, mu, Sigma, lambda, nu = 1) rMSSL(n, mu, Sigma, lambda, nu = 1) rMSCN(n, mu, Sigma, lambda, nu = 0.5, gamma = 0.5) rMSTT(n, mu, Sigma, lambda, nu = 1) rMSSL2(n, mu, Sigma, lambda, nu = 1) rMSCN2(n, mu, Sigma, lambda, nu = 0.5, gamma = 0.5) rMSNC(n, mu, Sigma, lambda) rMSTEC(n, mu, Sigma, lambda, nu = 1) rMSSLEC(n, mu, Sigma, lambda, nu = 1) rMSCEC(n, mu, Sigma, lambda, nu = 0.5, gamma = 0.5)
n |
number of observations to be generated. |
mu |
vector of location parameters. |
Sigma |
covariance matrix (a positive definite matrix). |
lambda |
vector of shape parameters. |
nu |
nu parameter. A positive scalar for MT, MSL, MSTN, MSSL, MSTT, MSSL2, MSTEC and MSSLEC models. A value in the interval (0,1) for MCN, MSCN, MSCN2 and MSCEC models. |
gamma |
gamma parameter. A value in the interval (0,1) for MCN, MSCN, MSCN2 and MSCEC models. |
Supported models are:
In MSMN class: multivariate normal (MN), multivariate Student t (MT), multivariate slash (MSL), multivariate contaminated normal (MCN). See Lange and Sinsheimer (1993) for details.
In MSMSN class: multivariate skew-normal (MSN), multivariate skew-T (MSTT), multivariate skew-slash (MSSL2), multivariate skew-contaminated normal (MSCN2). See Zeller, Lachos and Vilca-Labra (2011) for details.
In MSSMN class: MSN, multivariate skew-t-normal (MSTN), multivariate skew-slash normal (MSSL), multivariate skew-contaminated normal (MSCN). See Louredo, Zeller and Ferreira (2021) for details.
In MSMSNC class: multivariate skew-normal-Cauchy (MSNC), multivariate skew-t-Expected-Cauchy (MSTEC), multivariate skew-slash-Expected-Cauchy (MSSLEC), multivariate skew-contaminated-Expected-Cauchy (MSCEC). See Kahrari et al. (2020) for details.
Note: the MSN distribution belongs to both, MSMSN and MSSMN classes.
MN used mvrnorm
. For MT, MSL and MCN, the generation is based on the MSMN class. See Lange and Sinsheimer (1993) for details.
For MSTN, MSSL and MSCN, the generation is based on the MSSMN class. See Ferreira, Lachos and Bolfarine (2016) for details.
For MSTT, MSSL2 and MSCN2, the generation is based on the multivariate scale mixtures of skew-normal (MSMSN) class.
See Branco and Dey (2001) for details.
For MSNC, the generation is based on the stochastic representation in Proposition 2.1 of
Kahrari et al. (2016). For the MSTEC, MSSLEC and MSCEC models, the generation is based on the
MSMSNC class. See Kahrari et al. (2017) for details.
A matrix with the generated data.
Clecio Ferreira, Diego Gallardo and Camila Zeller.
Branco, M.D., Dey, D.K. (2001). A general class of multivariate skew-elliptical distributions. Journal of Multivariate Analysis 79, 99-113.
Ferreira, C.S., Lachos, V.H., Bolfarine, H. (2016). Likelihood-based inference for multivariate skew scale mixtures of normal distributions. AStA Advances in Statistical Analysis 100, 421-441.
Kahrari, F., Rezaei, M., Yousefzadeh, F., Arellano-Valle, R.B. (2016). On the multivariate skew-normal-Cauchy distribution. Statistics and Probability Letters, 117, 80-88.
Kahrari, F., Arellano-Valle, R.B., Rezaei, M., Yousefzadeh, F. (2017). Scale mixtures of skew-normal-Cauchy distributions. Statistics and Probability Letters, 126, 1-6.
Lange, K., Sinsheimer, J.S. (1993). Normal/independent distributions and their applications in robust regression. Journal of Computational and Graphical Statistics 2, 175-198.
rMSN(10, mu=c(0,0), Sigma=diag(2), lambda=c(1,-1)) ##bivariate MSN model rMSNC(10, mu=0, Sigma=2, lambda=1) ##univariate MSNC model rMSNC(10, mu=1:3, Sigma=2*diag(3), lambda=c(1,-1,0)) ##trivariate MSN model
rMSN(10, mu=c(0,0), Sigma=diag(2), lambda=c(1,-1)) ##bivariate MSN model rMSNC(10, mu=0, Sigma=2, lambda=1) ##univariate MSNC model rMSNC(10, mu=1:3, Sigma=2*diag(3), lambda=c(1,-1,0)) ##trivariate MSN model
Computes the inverse of a matrix using the LU decomposition.
solve2(A)
solve2(A)
A |
an invertible square matrix. |
Use the LU decomposition to compute the inverse of a matrix. In some cases, solve produces error to invert a matrix whereas this decomposition provide a valid solution.
A square matrix corresponding to the inverse of A.
Clecio Ferreira, Diego Gallardo and Camila Zeller
Bellman, R. (1987). Matrix Analysis, Second edition, Classics in Applied Mathematics, Society for Industrial and Applied Mathematics.
Horn, R. A. and C. R. Johnson (1985). Matrix Analysis, Cambridge University Press.
A=matrix(c(1,2,5,6),ncol=2) solve2(A)
A=matrix(c(1,2,5,6),ncol=2) solve2(A)
Summarizes the results for a object of the class "skewMLRM".
## S3 method for class 'skewMLRM' summary(object, ...)
## S3 method for class 'skewMLRM' summary(object, ...)
object |
an object of the class "skewMLRM". See details for supported models. |
... |
for extra arguments |
Supported models are:
In MSMN class: multivariate normal (MN), multivariate Student t (MT), multivariate slash (MSL), multivariate contaminated normal (MCN). See Lange and Sinsheimer (1993) for details.
In MSMSN class: multivariate skew-normal (MSN), multivariate skew-T (MSTT), multivariate skew-slash (MSSL2), multivariate skew-contaminated normal (MSCN2). See Zeller, Lachos and Vilca-Labra (2011) for details.
In MSSMN class: MSN, multivariate skew-t-normal (MSTN), multivariate skew-slash normal (MSSL), multivariate skew-contaminated normal (MSCN). See Louredo, Zeller and Ferreira (2021) for details.
In MSMSNC class: multivariate skew-normal-Cauchy (MSNC), multivariate skew-t-Expected-Cauchy (MSTEC), multivariate skew-slash-Expected-Cauchy (MSSLEC), multivariate skew-contaminated-Expected-Cauchy (MSCEC). See Kahrari et al. (2020) for details.
Note: the MSN distribution belongs to both, MSMSN and MSSMN classes.
The functions which generate an object of the class "skewMLRM" are
estimate.xxx: where xxx can be MN, MT, MSL, MCN, MSN, MSTN, MSSL, MSCN, MSTT, MSSL2, MSCN2, MSNC, MSTEC, MSSLEC or MSCEC.
choose.yyy: where yyy can be MSMN, MSSMN, MSMSN, MSMSNC or models.
choose2, mbackcrit, mbacksign and distMahal.
A complete summary for the coefficients extracted from a skewMLRM object. If the object was generated by function distMahal, the summary is related to the Mahalanobis distances.
Clecio Ferreira, Diego Gallardo and Camila Zeller
Kahrari, F., Arellano-Valle, R.B., Ferreira, C.S., Gallardo, D.I. (2020) Some Simulation/computation in multivariate linear models of scale mixtures of skew-normal-Cauchy distributions. Communications in Statistics - Simulation and Computation. In press. DOI: 10.1080/03610918.2020.1804582
Lange, K., Sinsheimer, J.S. (1993). Normal/independent distributions and their applications in robust regression. Journal of Computational and Graphical Statistics 2, 175-198.
Louredo, G.M.S., Zeller, C.B., Ferreira, C.S. (2021). Estimation and influence diagnostics for the multivariate linear regression models with skew scale mixtures of normal distributions. Sankhya B. In press. DOI: 10.1007/s13571-021-00257-y
Zeller, C.B., Lachos, V.H., Vilca-Labra, F.E. (2011). Local influence analysis for regression models with scale mixtures of skew-normal distributions. Journal of Applied Statistics 38, 343-368.
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the covariate matrix X ##X fit.MN=estimate.MN(y, X) #fit the MN distribution summary(fit.MN) #summary for the fit # fit.MSN=estimate.MSN(y, X) #fit the MSN distribution summary(fit.MSN) #summary for the fit
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the covariate matrix X ##X fit.MN=estimate.MN(y, X) #fit the MN distribution summary(fit.MN) #summary for the fit # fit.MSN=estimate.MSN(y, X) #fit the MSN distribution summary(fit.MSN) #summary for the fit
Compute the probability density and quantile functions for the truncated gamma distribution with shape and scale parameters, restricted to the interval (a,b).
dtgamma(x, shape, scale = 1, a = 0, b = Inf) qtgamma(p, shape, scale = 1, a = 0, b = Inf)
dtgamma(x, shape, scale = 1, a = 0, b = Inf) qtgamma(p, shape, scale = 1, a = 0, b = Inf)
x |
vector of quantiles |
p |
vector of probabilities |
shape |
shape parameter |
scale |
scale parameter |
a |
lower limit of range |
b |
upper limit of range |
dtgamma gives the density function for the truncated gamma distribution. qtgamma gives the quantile function for the truncated gamma distribution.
Auxiliary function to compute the E step for the Slash and Skew-slash models.
Clecio Ferreira, Diego Gallardo and Camila Zeller
##probability density and quantile function of the truncated gamma ##model with shape and scale parameters equal to 1 ##evaluated in 2 and 0.75, respectively dtgamma(2, shape=1, a=1) qtgamma(0.75, shape=1, a=1) ##standard gamma distribution with shape parameter 2 evaluated in 1 dtgamma(1, shape=2) dgamma(1, shape=2)
##probability density and quantile function of the truncated gamma ##model with shape and scale parameters equal to 1 ##evaluated in 2 and 0.75, respectively dtgamma(2, shape=1, a=1) qtgamma(0.75, shape=1, a=1) ##standard gamma distribution with shape parameter 2 evaluated in 1 dtgamma(1, shape=2) dgamma(1, shape=2)
Returns the variance-covariance matrix of the parameters of a fitted model object of the class "skewMLRM".
## S3 method for class 'skewMLRM' vcov(object, ...)
## S3 method for class 'skewMLRM' vcov(object, ...)
object |
an object of the class "skewMLRM". See details for supported models. |
... |
for extra arguments |
Supported models are:
In MSMN class: multivariate normal (MN), multivariate Student t (MT), multivariate slash (MSL), multivariate contaminated normal (MCN). See Lange and Sinsheimer (1993) for details.
In MSMSN class: multivariate skew-normal (MSN), multivariate skew-T (MSTT), multivariate skew-slash (MSSL2), multivariate skew-contaminated normal (MSCN2). See Zeller, Lachos and Vilca-Labra (2011) for details.
In MSSMN class: MSN, multivariate skew-t-normal (MSTN), multivariate skew-slash normal (MSSL), multivariate skew-contaminated normal (MSCN). See Louredo, Zeller and Ferreira (2021) for details.
In MSMSNC class: multivariate skew-normal-Cauchy (MSNC), multivariate skew-t-Expected-Cauchy (MSTEC), multivariate skew-slash-Expected-Cauchy (MSSLEC), multivariate skew-contaminated-Expected-Cauchy (MSCEC). See Kahrari et al. (2020) for details.
Note: the MSN distribution belongs to both, MSMSN and MSSMN classes.
The functions which generate an object of the class "skewMLRM" compatible with vcov are
estimate.xxx: where xxx can be MN, MT, MSL, MCN, MSN, MSTN, MSSL, MSCN, MSTT, MSSL2, MSCN2, MSNC, MSTEC, MSSLEC or MSCEC.
choose.yyy: where yyy can be MSMN, MSSMN, MSMSN, MSMSNC or models.
choose2, mbackcrit and mbacksign.
A matrix of the estimated covariances between the parameter estimates in the linear or non-linear predictor of the model. This should have row and column names corresponding to the parameter names given by the coef method.
Clecio Ferreira, Diego Gallardo and Camila Zeller
Kahrari, F., Arellano-Valle, R.B., Ferreira, C.S., Gallardo, D.I. (2020) Some Simulation/computation in multivariate linear models of scale mixtures of skew-normal-Cauchy distributions. Communications in Statistics - Simulation and Computation. In press. DOI: 10.1080/03610918.2020.1804582
Lange, K., Sinsheimer, J.S. (1993). Normal/independent distributions and their applications in robust regression. Journal of Computational and Graphical Statistics 2, 175-198.
Louredo, G.M.S., Zeller, C.B., Ferreira, C.S. (2021). Estimation and influence diagnostics for the multivariate linear regression models with skew scale mixtures of normal distributions. Sankhya B. In press. DOI: 10.1007/s13571-021-00257-y
Zeller, C.B., Lachos, V.H., Vilca-Labra, F.E. (2011). Local influence analysis for regression models with scale mixtures of skew-normal distributions. Journal of Applied Statistics 38, 343-368.
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the covariate matrix X ##X fit.MN=estimate.MN(y, X) #fit the MN distribution vcov(fit.MN) #variance-covariance matrix fit.MSN=estimate.MSN(y, X) #fit the MSN distribution vcov(fit.MSN) #variance-covariance matrix
data(ais, package="sn") ##Australian Institute of Sport data set attach(ais) ##It is considered a bivariate regression model ##with Hg and SSF as response variables and ##Hc, Fe, Bfat and LBM as covariates y<-cbind(Hg,SSF) n<-nrow(y); m<-ncol(y) X.aux=model.matrix(~Hc+Fe+Bfat+LBM) p<-ncol(X.aux) X<-array(0,dim=c(2*p,m,n)) for(i in 1:n) { X[1:p,1,i]=X.aux[i,,drop=FALSE] X[p+1:p,2,i]=X.aux[i,,drop=FALSE] } ##See the covariate matrix X ##X fit.MN=estimate.MN(y, X) #fit the MN distribution vcov(fit.MN) #variance-covariance matrix fit.MSN=estimate.MSN(y, X) #fit the MSN distribution vcov(fit.MSN) #variance-covariance matrix
vech takes the upper diagonal from a symmetric matrix and vectorizes it.
vech(x)
vech(x)
x |
a symmetric matrix. |
A vector with the components of the upper diagonal from the matrix, listed by row.
For internal use.
Clecio Ferreira, Diego Gallardo and Camila Zeller.
A<-matrix(c(1,2,2,5),nrow=2) ##vectorized A matrix B<-vech(A) B ##reconstitute matrix A using B xpnd(B,2)
A<-matrix(c(1,2,2,5),nrow=2) ##vectorized A matrix B<-vech(A) B ##reconstitute matrix A using B xpnd(B,2)
xpnd reconstitutes a symmetric matrix from a vector obtained with the vech function.
xpnd(x, nrow = NULL)
xpnd(x, nrow = NULL)
x |
vector with the components of the upper diagonal of the matrix |
nrow |
dimension of the matrix to be reconstitute. |
A symmetric matrix.
For internal use.
Clecio Ferreira, Diego Gallardo and Camila Zeller.
A<-matrix(c(1,2,2,5),nrow=2) ##vectorized A matrix B<-vech(A) B ##reconstitute matrix A using B xpnd(B,2)
A<-matrix(c(1,2,2,5),nrow=2) ##vectorized A matrix B<-vech(A) B ##reconstitute matrix A using B xpnd(B,2)