Learn R Programming

wavefunction (version 1.0.0)

wavefunction_fit: Fit Wave Function

Description

Fit wave function coefficients from a sample

Usage

wavefunction_fit(x, degree)

Arguments

x

a sample from a distribution on the reals

degree

the Hermite polynomial degree to fit

Value

a numeric vector of coefficients of length degree+1

Details

Fits a Hermite wave function density of degree degree. The values will maximize the likelihood under the density specified under dwavefunction. A more accurate representation is obtained for a low degree if the sample is standardized to have mean zero and variance one-half. There are diminishing returns to degree greater than 20 or so due to floating point limitations.

See Also

Madeleine B. Thompson, “Wave function representation of probability distributions,” 2017, https://arxiv.org/abs/1712.07764.

Examples

Run this code
# NOT RUN {
  x <- rt(100, df = 5)
  w <- wavefunction_fit(x, degree = 6)
# }

Run the code above in your browser using DataLab