# 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