GQdk: Sparse Gaussian / Gauss-Hermite Quadrature grid

Description Usage Arguments Value Note Examples

View source: R/sparsegrid.R

Description

Generate the sparse multidimensional Gaussian quadrature grids.

Currently unused. See GHrule() for the version currently in use in package lme4.

Usage

1
2
  GQdk(d = 1L, k = 1L)
  GQN

Arguments

d

integer scalar - the dimension of the function to be integrated with respect to the standard d-dimensional Gaussian density.

k

integer scalar - the order of the grid. A grid of order k provides an exact result for a polynomial of total order of 2k - 1 or less.

Value

GQdk() returns a matrix with d + 1 columns. The first column is the weights and the remaining d columns are the node coordinates.

GQN is a list of lists, containing the non-redundant quadrature nodes and weights for integration of a scalar function of a d-dimensional argument with respect to the density function of the d-dimensional Gaussian density function.
The outer list is indexed by the dimension, d, in the range of 1 to 20. The inner list is indexed by k, the order of the quadrature.

Note

GQN contains only the non-redundant nodes. To regenerate the whole array of nodes, all possible permutations of axes and all possible combinations of +/- 1 must be applied to the axes. This entire array of nodes is exactly what GQdk() reproduces.

The number of nodes gets very large very quickly with increasing d and k. See the charts at http://www.sparse-grids.de.

Examples

1
2
3
GQdk(2,5) # 53 x 3

GQN[[3]][[5]] # a 14 x 4 matrix

Example output

Loading required package: Matrix
             [,1]       [,2]       [,3]
 [1,]  1.51111111  0.0000000  0.0000000
 [2,] -0.45412415  0.0000000 -0.7419638
 [3,] -0.33333333  0.0000000 -1.0000000
 [4,]  0.22207592  0.0000000 -1.3556262
 [5,]  0.11111111  0.0000000 -1.7320508
 [6,] -0.04587585  0.0000000 -2.3344142
 [7,]  0.01125741  0.0000000 -2.8569700
 [8,]  0.22706207 -0.7419638 -1.0000000
 [9,] -0.08333333 -1.0000000 -1.7320508
[10,]  0.02293793 -1.0000000 -2.3344142
[11,]  0.02777778 -1.7320508 -1.7320508
[12,] -0.45412415 -0.7419638  0.0000000
[13,] -0.33333333 -1.0000000  0.0000000
[14,]  0.22207592 -1.3556262  0.0000000
[15,]  0.11111111 -1.7320508  0.0000000
[16,] -0.04587585 -2.3344142  0.0000000
[17,]  0.01125741 -2.8569700  0.0000000
[18,]  0.22706207 -1.0000000 -0.7419638
[19,] -0.08333333 -1.7320508 -1.0000000
[20,]  0.02293793 -2.3344142 -1.0000000
[21,]  0.22706207  0.7419638 -1.0000000
[22,] -0.08333333  1.0000000 -1.7320508
[23,]  0.02293793  1.0000000 -2.3344142
[24,]  0.02777778  1.7320508 -1.7320508
[25,] -0.45412415  0.7419638  0.0000000
[26,] -0.33333333  1.0000000  0.0000000
[27,]  0.22207592  1.3556262  0.0000000
[28,]  0.11111111  1.7320508  0.0000000
[29,] -0.04587585  2.3344142  0.0000000
[30,]  0.01125741  2.8569700  0.0000000
[31,]  0.22706207  1.0000000 -0.7419638
[32,] -0.08333333  1.7320508 -1.0000000
[33,]  0.02293793  2.3344142 -1.0000000
[34,] -0.45412415  0.0000000  0.7419638
[35,] -0.33333333  0.0000000  1.0000000
[36,]  0.22207592  0.0000000  1.3556262
[37,]  0.11111111  0.0000000  1.7320508
[38,] -0.04587585  0.0000000  2.3344142
[39,]  0.01125741  0.0000000  2.8569700
[40,]  0.22706207 -0.7419638  1.0000000
[41,] -0.08333333 -1.0000000  1.7320508
[42,]  0.02293793 -1.0000000  2.3344142
[43,]  0.02777778 -1.7320508  1.7320508
[44,]  0.22706207 -1.0000000  0.7419638
[45,] -0.08333333 -1.7320508  1.0000000
[46,]  0.02293793 -2.3344142  1.0000000
[47,]  0.22706207  0.7419638  1.0000000
[48,] -0.08333333  1.0000000  1.7320508
[49,]  0.02293793  1.0000000  2.3344142
[50,]  0.02777778  1.7320508  1.7320508
[51,]  0.22706207  1.0000000  0.7419638
[52,] -0.08333333  1.7320508  1.0000000
[53,]  0.02293793  2.3344142  1.0000000
             [,1] [,2]      [,3]      [,4]
 [1,]  4.93333333    0 0.0000000 0.0000000
 [2,] -0.90824829    0 0.0000000 0.7419638
 [3,] -1.33333333    0 0.0000000 1.0000000
 [4,]  0.22207592    0 0.0000000 1.3556262
 [5,]  0.38888889    0 0.0000000 1.7320508
 [6,] -0.09175171    0 0.0000000 2.3344142
 [7,]  0.01125741    0 0.0000000 2.8569700
 [8,]  0.22706207    0 0.7419638 1.0000000
 [9,]  0.41666667    0 1.0000000 1.0000000
[10,] -0.16666667    0 1.0000000 1.7320508
[11,]  0.02293793    0 1.0000000 2.3344142
[12,]  0.02777778    0 1.7320508 1.7320508
[13,] -0.25000000    1 1.0000000 1.0000000
[14,]  0.04166667    1 1.0000000 1.7320508

lme4 documentation built on June 22, 2021, 9:07 a.m.