qnwequi: Quadrature nodes and weights using equidistributed nodes.

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/qnwequi.R

Description

Generates equidistributed nodes for computing the definite integral of a real-valued function defined on a hypercube [a,b] in R^d.

Usage

1
2
qnwequi(n, a = matrix(0, 1, length(n)), b = matrix(1, 1, length(n)),
  type = "N", equidist_pp = sqrt(primes(7920)))

Arguments

n

total number of nodes

a

1.d left endpoints

b

1.d right endpoints

type

string, type of sequence. Choose from:

  • 'N' - Neiderreiter (default)

  • 'W' - Weyl

  • 'H' - Haber

  • 'R' - pseudo Random

Value

List with fields

Author(s)

Randall Romero-Aguilar, based on Miranda & Fackler's CompEcon toolbox

References

Miranda, Fackler 2002 Applied Computational Economics and Finance

See Also

Other quadrature functions: qnwlege; qnwlogn; qnwnorm; qnwsimp; qnwtrap; qnwunif; quadrature

Examples

1
2
3
4
5
6
7
8
# To compute definte integral of a real-valued function f defined on a hypercube
# [a,b] in R^d, write a function f that returns an m.1 vector when passed an
# m.d matrix, and write
q <- qnwequi(n,a,b,type);
Intf <- crossprod(q$w, f(q$x))

# Alternatively, use the quadrature function
Intf <- quadrature(f,qnwnequi,n,a,b,type)

randall-romero/CompEconR documentation built on May 26, 2019, 10:56 p.m.