Description Usage Arguments Value Examples
View source: R/compak_fitpmf.R
The function estimates the p.m.f. using the Conway-Maxwell-Poisson associated kernels (compak) smoother. Bandwidth can be specified as h
or nu
where nu
= 1/h
. If none is specified, one can be provided by using cross-validation or minimising Kullback-Leibler divergence.
1 2 3 4 5 6 7 8 9 | compak_fitpmf(
a.sample,
x = NULL,
h = NULL,
nu = NULL,
workers = 1L,
bandwidth_optim = "KL",
...
)
|
a.sample |
numeric vector: the data sample from which estimate is to be computed. |
x |
Either |
h, nu |
numeric: the bandwidth or smoothing parameter. Only one is needed and they are related by |
workers |
numeric; a positive integer to represent the number of cores used for parallel processing to evaluate the kde |
bandwidth_optim |
character; the type of bandwidth selection to be used. Possible values are "KL" (Kullback-Leibler divergence) and "CV" (cross-validation). |
... |
other arguments passed to bandwidth selection, such as |
An object class 'compak' is a list containing the following components:
f.cmp |
the estimated p.m.f. values |
data |
The data - same as input |
h |
The bandwidth used to compute the density estimate |
nu |
The dispersion used to compute the density estimate |
x |
The coordinates of the points where the density is estimated |
bandwidth_optim |
the type of bandwidth selection used - same as input |
kernel.est |
a list that contains the estimated kernel at each grid point |
1 2 3 4 5 6 7 8 9 | ### Huang et, al (2020) Page 10
data(days)
fit.compak2 <- compak_fitpmf(days, 10:40, bandwidth_optim = "CV")
fit.compak2
### Huang et, al (2020) Page 9
data(somites)
fit.compak <- compak_fitpmf(somites, 60:180, bandwidth_optim = "CV")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.