| dfmx | R Documentation |
Density function, distribution function, quantile function and random generation for a finite mixture distribution
with normal or Tukey g-&-h components.
dfmx(
x,
dist,
distname = dist@distname,
K = dim(pars)[1L],
pars = dist@pars,
w = dist@w,
...,
log = FALSE
)
pfmx(
q,
dist,
distname = dist@distname,
K = dim(pars)[1L],
pars = dist@pars,
w = dist@w,
...,
lower.tail = TRUE,
log.p = FALSE
)
qfmx(
p,
dist,
distname = dist@distname,
K = dim(pars)[1L],
pars = dist@pars,
w = dist@w,
interval = qfmx_interval(dist = dist),
...,
lower.tail = TRUE,
log.p = FALSE
)
rfmx(
n,
dist,
distname = dist@distname,
K = dim(pars)[1L],
pars = dist@pars,
w = dist@w
)
x, q |
numeric vector, quantiles, 'NA_real_' value(s) allowed. |
dist |
fmx object, a finite mixture distribution |
distname, K, pars, w |
auxiliary parameters, whose default values are determined by argument 'dist'. The user-specified vector of 'w' does not need to sum up to 1; 'w/sum(w)' will be used internally. |
... |
additional parameters |
log, log.p |
logical scalar.
If 'TRUE', probabilities are given as |
lower.tail |
logical scalar.
If 'TRUE' (default), probabilities are |
p |
numeric vector, probabilities. |
interval |
length-2 numeric vector, interval for root finding, see vuniroot |
n |
integer scalar, number of observations. |
A computational challenge in function [dfmx()] is when mixture density is very close to 0, which happens when the per-component log densities are negative with big absolute values. In such case, we cannot compute the log densities (i.e., '-Inf').
The function [qfmx()] gives the quantile function, by numerically solving [pfmx].
One major challenge when dealing with the finite mixture of Tukey g-&-h family distribution
is that Brent–Dekker's method needs to be performed in both pGH and [qfmx] functions,
i.e. *two layers* of root-finding algorithm.
The function [dfmx()] returns a numeric vector of probability density values of an fmx object at specified quantiles 'x'.
The function [pfmx()] returns a numeric vector of cumulative probability values of an fmx object at specified quantiles 'q'.
The function [qfmx()] returns an unnamed numeric vector of quantiles of an fmx object, based on specified cumulative probabilities 'p'.
The function [rfmx()] generates random deviates of an fmx object.
The function qnorm returns an unnamed vector of quantiles, although quantile returns a named vector of quantiles.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.