compak_evalpmf: Fits CMP_mu discrete kernel smoother for a sample of counts

Description Usage Arguments Value Examples

View source: R/compak_evalpmf.R

Description

This function computes the density using the CMP_mu discrete kernel smooth over a grid of points using the given bandwidth h or dispersion parameter nu.

Usage

1
compak_evalpmf(a.sample, x = NULL, h = NULL, nu = NULL, workers = 1L)

Arguments

a.sample

numeric vector: the data sample from which estimate is to be computed.

x

Either NULL or a numeric vector: the points of the grid at which the density is to be estimated. If none is provided, the range of a.sample will be used.

h, nu

numeric: the bandwidth or smoothing parameter. Only one is needed and they are related by nu = 1/h.

workers

numeric; a positive integer to represent the number of cores used for parallel processing to evaluate the kde

Value

A list containing the following components:

f.cmp

the estimated p.m.f. values

kernel.est

a list that contains the estimated kernel at each grid point

Examples

1
2
3
4
data(days)
# The bandwidth h can be the one obtained by cross validation.
(h.CV <- compak_CVbandwidth(days))
compak_evalpmf(days, 20:40, h = h.CV, workers = 1)

thomas-fung/compak documentation built on Dec. 23, 2021, 9:57 a.m.