| evaluate_expected.polynomial | R Documentation |
Evaluates the expected value of a multivariate polynomial assuming a specified non-central multivariate normal distribution.
evaluate_expected.polynomial(poly, mu, sigma, envir = "symmoments")
poly |
An object of class |
mu |
A vector of real numbers representing the mean vector |
sigma |
A vector giving an upper-triangular matrix, stacked by row, representing the covariance matrix of the multivariate distribution. |
envir |
A character string specifying the environment containing the
central moments needed for the calculation. Defaults to |
This function searches the environment specified in the envir
argument for the central moments required to complete the expected value expansion.
The default is the symmoments environment. The computation will stop
with an error message if any required central moment is missing from envir.
The expected value of the multivariate polynomial evaluated at the specified multivariate normal mean and covariance matrix.
Kem Phillips kemphillips@comcast.net
Phillips2010symmoments
evaluate_noncentral, make.all.moments
## Not run:
library(mpoly)
# Define an mpoly object for a multivariate polynomial and determine
# its expected value at a specified mean and covariance matrix:
# Note: All moments up to c(2,3,2) must exist in the symmoments environment.
# Run make.all.moments(c(2,3,2)) beforehand if necessary.
t0 <- mpoly(list(
c(coef = 3, x1 = 2),
c(coef = 2, x1 = 1, x2 = 3),
c(coef = -4, z = 2),
c(coef = 1, x1 = 1, x2 = 2, z = 1)
))
evaluate_expected.polynomial(t0, c(1, 2, 3), c(1, 0, 0, 1, 0, 1))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.