We will use a product rule based on Gauss-Hermite quadrature to integrate test functions over the multivariate real numbers \(R^n = (-\infty,\infty)^n\). Due to the exponential increase of node points in the number of dimensions, product rules are not recommended for high dimensional integration. They are however easy to compute benchmarks and we will use them for this reason. We start by creating the product rule nodes and weights.

`require(multIntTestFunc)`

`## Loading required package: multIntTestFunc`

`require(statmod)`

`## Loading required package: statmod`

```
as.integer(2)
n <-
gauss.quad(10,"hermite")
hermite <- pIntRule(hermite,n)
multHermite <- multHermite$nodes
nodes <- multHermite$weights
weights <-
new("Rn_Gauss",dim=n)
f <-
evaluate(f,nodes)
eval <- sum(weights*eval)
approx <-print(approx)
```

`## [1] 1.570726`

```
#print exact integral
print(exactIntegral(f))
```

`## [1] 3.141593`