evaluate_expected.polynomial: Evaluate the Expected Value of a Multivariate Polynomial

evaluate_expected.polynomialR Documentation

Evaluate the Expected Value of a Multivariate Polynomial

Description

Evaluates the expected value of a multivariate polynomial assuming a specified non-central multivariate normal distribution.

Usage

evaluate_expected.polynomial(poly, mu, sigma, envir = "symmoments")

Arguments

poly

An object of class 'mpoly' or 'multipol', or a simple list containing coefficients and powers defining the polynomial.

mu

A vector of real numbers representing the mean vector \mu of the multivariate normal distribution.

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 'symmoments'.

Details

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.

Value

The expected value of the multivariate polynomial evaluated at the specified multivariate normal mean and covariance matrix.

Author(s)

Kem Phillips kemphillips@comcast.net

References

\insertRef

Phillips2010symmoments

See Also

evaluate_noncentral, make.all.moments

Examples

## 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)


symmoments documentation built on May 27, 2026, 9:06 a.m.