qnwlogn: Gaussian quadrature nodes and weights for lognormal...

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

View source: R/qnwlogn.R

Description

Generates Gaussian quadrature nodes and probability weights for multivariate Lognormal distribution with parameters mu and var, or, equivalently, for a random vector whose natural logarithm is normally distributed with mean vector mu and variance matrix var

Usage

1
qnwlogn(n, mu = matrix(0, 1, length(n)), var = diag(length(n)))

Arguments

n

1.d number of nodes per dimension

mu

1.d mean vector (default: zeros)

var

d.d positive definite variance matrix (default: identity matrix)

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: qnwequi; qnwlege; qnwnorm; qnwsimp; qnwtrap; qnwunif; quadrature

Examples

1
2
3
4
5
6
7
# To compute Ef(X) when f is real-valued and X is lognormal(mu,var) on R^d,
# write a function f that returns m.1 vector when passed an m.d matrix, and write
q  <- qnwlogn(n,mu,var)
Ef  <- crossprod(q$w, f(q$x))

# Alternatively, use the quadrature function
Ef <- quadrature(f,qnwlogn,n,mu,var)

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