estimateDensityBySpline: Estimate the density value from a sample by a spline...

Description Usage Arguments Value Examples

View source: R/circGLM.R

Description

This function estimates the density at x0 by first taking a kernel density estimate of a sample from the probability density x, and then interpolating it by a spline.

Usage

1
estimateDensityBySpline(x, x0 = 0, npow = 15, rangeExtend = 1/4)

Arguments

x

A (large) sample of from the probability density function of interest, such as a posterior.

x0

The value at which to evaluate the density.

npow

The precision used with the density function.

rangeExtend

The number of standard deviations past the range of x to start the density estimate.

Value

Numeric; a scalar of the estimated probability density at x0.

Examples

1
2
3
# Compare the estimate from this function with the analytic result.
estimateDensityBySpline(rnorm(1000), 0.1)
dnorm(.1)

circglmbayes documentation built on Jan. 22, 2021, 5:09 p.m.