Hi Rstudio community,
I am a student of the university of Leuven, and I’m new to this community and Rstudio in general. I am struggling to implement the function smsn.mix from the package mixsmsn, Fitting Finite Mixture of Scale Mixture of Skew-Normal Distributions. In my research I measure particles and the result is a long list (3059 observations) of diameters, data set is called Diameter1. I will give the code and the result in order to clarify my problem.
Code:
hist(Diameter1, breaks = 100, main = "Histogram of caps", xlab = "diameter")
Result:
See figure below, only the histogram, not the red curve. I obtain a distribution curve with two distinct modes (bimodal estimated means 1.5 and 17). The curves are not normal distribution, it shows large tailing. Now I would like to know the mean and the sigma value for each distribution around each mode.
Code:
Skew.map2 <- smsn.mix(Diameter1, nu =23, g =2, mu=c(1.5,17), sigma2=c(2,100), family = "Skew.t", calc.im = FALSE)
mix.hist(Diameter1, Skew.map2, breaks = 100)
Result:
Seemingly, only one mode was found (red curve). Details of the analysis by smsn.mix show indeed two modes, but they are unexpected.
Code:
mix.print(Skew.map2)
Result:
Number of observations: 3059
Hyperparameter(nu): 8.022694
group 1 group 2
mu 18.578 19.297
sigma2 241.148 62.370
shape 1.671 -1.135
AIC: 22361.43
BIC: 22403.61
EDC: 22424.86
ICL: 23013.31
EM iterations: 11
The first mode around 1.5, is not seen by the function. When I ask to look for 3 modes, g = 3 in the function I do get a nice fit (red curve) and the first mode is observed, however still two modes are seen in the second part of the curve which seems strange.
Code:
Skew.map2 <- smsn.mix(Diameter1, nu =23, g =3, mu=c(1.5,17), sigma2=c(2,100),family = "Skew.t", calc.im = FALSE)
mix.hist(Diameter1, Snorm.map2, breaks = 100)
Result:
mix.print(Snorm.map2)
Number of observations: 3059
Hyperparameter(nu): 3.30653
group 1 group 2 group 3
mu 21.634 1.539 12.499
sigma2 202.873 2.207 34.779
shape 3.454 24.159 2.480
AIC: 20687.02
BIC: 20753.3
EDC: 20786.7
ICL: 21232.43
EM iterations: 101
So my question is, how do I get a fit of the two peaks of my distribution, together with the info of means and sigma with this function smsn.mix. Why does it see 3 modes and I do not?
Thank you all in advance