View source: R/fmx_constraint.R
fmx_constraint | R Documentation |
Determine the parameter constraint(s) of a finite mixture distribution fmx, either by the value of parameters of such mixture distribution, or by a user-specified string.
fmx_constraint(
dist,
distname = dist@distname,
K = dim(dist@pars)[1L],
pars = dist@pars
)
dist |
(optional) fmx object |
distname |
character scalar, name of distribution (see fmx),
default value determined by |
K |
integer scalar, number of components,
default value determined by |
pars |
double matrix,
distribution parameters of a finite mixture distribution (see fmx),
default value determined by |
Function fmx_constraint()
returns the indices of internal parameters
(only applicable to Tukey g
-&-h
mixture distribution, yet) to be constrained,
based on the input fmx object dist
.
(d0 = fmx('GH', A = c(1,4), g = c(.2,.1), h = c(.05,.1), w = c(1,1)))
(c0 = fmx_constraint(d0))
user_constraint(character(), distname = 'GH', K = 2L) # equivalent
(d1 = fmx('GH', A = c(1,4), g = c(.2,0), h = c(0,.1), w = c(1,1)))
(c1 = fmx_constraint(d1))
user_constraint(c('g2', 'h1'), distname = 'GH', K = 2L) # equivalent
(d2 = fmx('GH', A = c(1,4), g = c(.2,0), h = c(.15,.1), w = c(1,1)))
(c2 = fmx_constraint(d2))
user_constraint('g2', distname = 'GH', K = 2L) # equivalent
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.