as.fmx.Skew.normal {fmx}R Documentation

Convert Skew.normal Object to fmx

Description

To convert Skew.normal object (from package mixsmsn) to fmx class.

Usage

## S3 method for class 'Skew.normal'
as.fmx(x, data, ...)

Arguments

x

'Skew.normal' object, returned from smsn.mix with parameter family = 'Skew.normal'.

data

numeric vector

...

additional parameters, currently not in use

Value

Function as.fmx.Skew.normal returns an fmx object.

Note

smsn.mix does not offer a parameter to keep the input data, as of 2021-10-06.

Examples

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)))

# Skew Normal
class(m1 <- smsn.mix(x, nu = 3, g = 3, family = 'Skew.normal', calc.im = FALSE))
mix.hist(y = x, model = m1)
m1a = as.fmx(m1, data = x)
(l1a = logLik(m1a))
hist(x, freq = FALSE)
curve(dfmx(x, dist = m1a), xlim = range(x), add = TRUE)


[Package fmx version 0.1.2 Index]