createIntegrationGrid {SparseGrid}R Documentation

Create integration grid with the least number of nodes, either using a sparse grid or a product rule grid.

Description

This function creates nodes and weights that can be used for integration. It is a convenience function that calls createSparseGrid and createProductRuleGrid and returns the grid with the least number of nodes. Typically, a grid created by the product rule will only contain fewer nodes than a sparse grid for very low dimensions.

Usage

createIntegrationGrid(type, dimension, k, sym = FALSE)

Arguments

type

String or function for type of 1D integration rule, can take on values

"KPU"

Nested rule for unweighted integral over [0,1]

"KPN"

Nested rule for integral with Gaussian weight

"GQU"

Gaussian quadrature for unweighted integral over [0,1] (Gauss-Legendre)

"GQN"

Gaussian quadrature for integral with Gaussian weight (Gauss-Hermite)

func

any function. Function must accept level k and return a list with two elements nodes and weights for univariate quadrature rule with polynomial exactness 2k-1.

dimension

Dimension of the integration problem.

k

Accuracy level. The rule will be exact for polynomials up to total order 2k-1.

sym

(optional) only used for own 1D quadrature rule (type not "KPU",...). If sym is supplied and not FALSE, the code will run faster but will produce incorrect results if 1D quadrature rule is asymmetric.

Value

The return value contains a list with nodes and weights

nodes

matrix with a node in each row

weights

vector with corresponding weights

Author(s)

Jelmer Ypma

References

Florian Heiss, Viktor Winschel, Likelihood approximation by numerical integration on sparse grids, Journal of Econometrics, Volume 144, Issue 1, May 2008, Pages 62-80, http://www.sparse-grids.de

See Also

createSparseGrid createProductRuleGrid createMonteCarloGrid integrate pmvnorm

Examples

# load library
library('SparseGrid')

# create integration grid
int.grid <- createIntegrationGrid( 'GQU', dimension=3, k=5 )

[Package SparseGrid version 0.8.2 Index]