Learn R Programming

bssn (version 1.0)

FMshnReg: Linear regression models using finite mixture of Sinh-normal distribution

Description

Performs the EM-type algorithm with conditonal maximation to perform maximum likelihood inference of the parameters of the proposed model based on the assumption that the error term follows a finite mixture of Sinh-normal distributions.

Usage

FMshnReg(y, x1, alpha = NULL, Abetas = NULL, medj=NULL,
pii = NULL, g = NULL, get.init = TRUE,algorithm = "K-means",
accuracy = 10^-6, show.envelope="FALSE", iter.max = 100)

Arguments

y

the response matrix (dimension nx1).

x1

Matrix or vector of covariates.

alpha

Value of the shape parameter for the EM algorithm. Each of them must be a vector of length g. (the algorithm considers the number of components to be adjusted based on the size of these vectors).

Abetas

Parameters of vector regression dimension \((p + 1)\) include intercept.

medj

a list of g arguments of vectors of values (dimension p) for the location parameters.

pii

Value for the EM algorithm. Each of them must be a vector of length g. (the algorithm considers the number of components to be adjusted based on the size of these vectors).

g

The number of cluster to be considered in fitting.

get.init

if TRUE, the initial values are generated via k-means.

algorithm

clustering procedure of a series of vectors according to a criterion. The clustering algorithms may classified in 4 main categories: exclusive, overlapping, hierarchical and probabilistic.

accuracy

The convergence maximum error.

show.envelope

Logical; if TRUE, show the simulated envelope for the fitted model.

iter.max

The maximum number of iterations of the EM algorithm

Value

The function returns a list with 10 elements detailed as

iter

Number of iterations.

criteria

Attained criteria value.

convergence

Convergence reached or not.

SE

Standard Error estimates, if the output shows NA the function does not provide the standard error for this parameter.

table

Table containing the inference for the estimated parameters.

LK

log-likelihood.

AIC

Akaike information criterion.

BIC

Bayesian information criterion.

EDC

Efficient Determination criterion.

time

Processing time.

References

Maehara, R. and Benites, L. (2020). Linear regression models using finite mixture of Sinh-normal distribution. In Progress.

Bartolucci, F. and Scaccia, L. (2005). The use of mixtures for dealing with non-normal regression errors, Computational Statistics & Data Analysis 48(4): 821-834.

Examples

Run this code
# NOT RUN {
#Using the AIS data

library(FMsmsnReg)
data(ais)

#################################
#The model
x1    <- cbind(1,ais$SSF,ais$Ht)
y     <- ais$Bfat

library(ClusterR) #This library is useful for using the k-medoids algorithm.

FMshnReg(y, x1, get.init = TRUE, g=2, algorithm="k-medoids",
accuracy = 10^-6, show.envelope="FALSE", iter.max = 1000)

#########################################
#A simple output example

------------------------------------------------------------
Finite Mixture of Sinh Normal Regression Model
------------------------------------------------------------

Observations = 202

-----------
Estimates
-----------

       Estimate      SE
alpha1  0.81346 0.10013
alpha2  3.04894 0.32140
beta0  15.08998 1.70024
beta1   0.17708 0.00242
beta2  -0.07687 0.00934
mu1    -0.25422 0.18069
mu2     0.37944 0.38802
pii1    0.59881 0.41006

------------------------
Model selection criteria
------------------------

        Loglik    AIC     BIC     EDC
Value -355.625 721.25 737.791 725.463

-------
Details
-------

Convergence reached? = TRUE
EM iterations = 39 / 1000
Criteria = 6.58e-07
Processing time = 0.725559 secs
# }

Run the code above in your browser using DataLab