optimal_points: Calculate optimal collocation points from (sample) moments of...

Description Usage Arguments Details Value

Description

Calculates optimal collocation points from (sample) moments of the approximating distribution using the Golub-Welsch algorithm

Usage

1
optimal_points(N, moment_fun = NULL, sample = NULL)

Arguments

N

The number of collocation points to calculate

moment_fun

A function which takes one (unsigned) integer k and return the k-th moment of the distribution to use for collocation. Only 2*N moments are needed.

sample

If moment_fun not specified, the sample from which to calculate the collocation points using the 2*N sample moments.

Details

Note: Using sample moments for a large sample from the approximating random variable gives similar results as using theoretical. For example, using sample = rnorm(1e6) gives similar points as using moment_fun = scmc::normal_moment_fun.

Value

The N optimal collocation points for interpolation used in SCMC.


Blaza/scmc documentation built on May 29, 2019, 6:41 a.m.