dens: Estimates the probability density at one or more x values

Description Usage Arguments Details Value Examples

View source: R/hermite_estimator.R

Description

This method calculates the probability density values at a vector of x values in the univariate case. In the bivariate case, the method calculates the probability density values for a matrix of x values, each row of which represents a 2-d point.

Usage

1
dens(this, x, clipped, accelerate_series = TRUE)

Arguments

this

A hermite_estimator_univar or hermite_estimator_bivar object.

x

A numeric vector (univariate) or a numeric matrix (bivariate) of values at which to calculate the probability density.

clipped

A boolean value. This value determines whether probability densities are clipped to be bigger than zero.

accelerate_series

A boolean value. This value determines whether Hermite series acceleration is applied.

Details

The object must be updated with observations prior to the use of the method.

Value

A numeric vector of probability density values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
hermite_est <- hermite_estimator(N = 10, standardize = TRUE, 
est_type="univariate")
hermite_est <- update_batch(hermite_est, rnorm(30))
pdf_est <- dens(hermite_est, c(0, 0.5, 1))
hermite_est <- hermite_estimator(N = 10, standardize = TRUE, 
est_type="bivariate")
hermite_est <- update_batch(hermite_est, x = matrix(rnorm(60), 
nrow=30, ncol=2,byrow=TRUE))
pdf_est <- dens(hermite_est, matrix(c(0,0,0.5,0.5,1,1),nrow=3,
ncol=2,byrow=TRUE))

hermiter documentation built on Nov. 17, 2021, 1:07 a.m.