Description Usage Arguments Value Author(s) References See Also Examples
Generates Simpson's rule quadrature nodes and weights for computing the definite integral of a real-valued function defined on a hypercube [a,b] in R^d.
1 |
n |
1.d number of nodes per dimension (must be odd positive integers) |
a |
1.d left endpoints |
b |
1.d right endpoints |
List with fields
xpoints
prod(n).d quadrature nodes
weights
prod(n).1 quadrature weights
Randall Romero-Aguilar, based on Miranda & Fackler's CompEcon toolbox
Miranda, Fackler 2002 Applied Computational Economics and Finance
Other quadrature functions: qnwequi
;
qnwlege
; qnwlogn
;
qnwnorm
; qnwtrap
;
qnwunif
; quadrature
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 <- qnwsimp(n,a,b,type);
Intf <- crossprod(q$w, f(q$x))
# Alternatively, use the quadrature function
Intf <- quadrature(f,qnwnsimp,n,a,b)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.