Description Usage Arguments Value Author(s) References See Also Examples
View source: R/createIntegrationGrid.R
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.
1 | createIntegrationGrid(type, dimension, k, sym = FALSE)
|
type |
String or function for type of 1D integration rule, can take on values
|
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. |
The return value contains a list with nodes and weights
nodes |
matrix with a node in each row |
weights |
vector with corresponding weights |
Jelmer Ypma
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
createSparseGrid
createProductRuleGrid
createMonteCarloGrid
integrate
pmvnorm
1 2 3 4 5 | # load library
library('SparseGrid')
# create integration grid
int.grid <- createIntegrationGrid( 'GQU', dimension=3, k=5 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.