demvn {esaddle}R Documentation

Evaluate the density of a multivariate Gaussian fit

Description

Given a sample X, it gives a pointwise evaluation of the multivariate normal (MVN) density fit at position y.

Usage

demvn(y, X, log = FALSE, verbose = TRUE, alpha = 2, beta = 1.25)

Arguments

y

points at which the MVN is evaluated. It can be either a d-dimensional vector or an n by d matrix, each row indicating a different position.

X

an n by d matrix containing the data.

log

if TRUE the log-density is returned.

verbose

currently not used.

alpha

tuning parameter of robCov, see ?robCov for details.

beta

tuning parameter of robCov, see ?robCov for details.

Details

The covariance matrix is estimated robustly, using the robCov function.

Value

A vector where the i-th entry is the density corresponding to the i-th row of y.

Author(s)

Matteo Fasiolo <matteo.fasiolo@gmail.com> and Simon N. Wood.

Examples

library(esaddle)
X <- matrix(rnorm(2 * 1e3), 1e3, 2) # Sample used to fit a multivariate Gaussian
demvn(rnorm(2), X, log = TRUE)      # Evaluate the fitted log-density at a random location

[Package esaddle version 0.0.7 Index]