as.fmx.Normal | R Documentation |
Normal
fit from mixsmsn to fmxTo convert Normal
object (from package mixsmsn)
to fmx class.
## S3 method for class 'Normal'
as.fmx(x, data, ...)
x |
|
data |
numeric vector |
... |
additional parameters, currently not in use |
Function as.fmx.Normal()
returns an fmx object.
smsn.mix does not offer a parameter to keep the input data, as of 2021-10-06.
library(mixsmsn)
# ?smsn.mix
arg1 = c(mu = 5, sigma2 = 9, lambda = 5, nu = 5)
arg2 = c(mu = 20, sigma2 = 16, lambda = -3, nu = 5)
arg3 = c(mu = 35, sigma2 = 9, lambda = -6, nu = 5)
set.seed(120); x = rmix(n = 1e3L, p=c(.5, .2, .3), family = 'Skew.t',
arg = list(unname(arg1), unname(arg2), unname(arg3)))
# Normal
class(m2 <- smsn.mix(x, nu = 3, g = 3, family = 'Normal', calc.im = FALSE))
mix.hist(y = x, model = m2)
m2a = as.fmx(m2, data = x)
hist(x, freq = FALSE)
curve(dfmx(x, dist = m2a), xlim = range(x), add = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.