Learn R Programming

QRM (version 0.4-7)

Gauss: Multivariate Gauss Distribution

Description

Functions for evaluating multivariate normal density, generating random variates, fitting and testing.

Usage

dmnorm(x, mu, Sigma, log = FALSE)
fit.norm(data)
rmnorm(n, mu = 0, Sigma)
MardiaTest(data)
jointnormalTest(data, dist = c("chisquare", "beta"), plot = TRUE)

Arguments

data
matrix, data set.
dist
character, chisquare performs test against $\chi^2$ distribution, which is an approximation; beta performs a test against a scaled beta distribution.
log
logical, whether log density values shall be returned.
n
integer, count of random variates.
mu
numeric, location parameters.
plot
logical, whether test result shall be plotted.
Sigma
matrix, covariance matrix.
x
matrix, density is evaluated per row.

Examples

Run this code
BiDensPlot(func = dmnorm, mu = c(0, 0), Sigma = equicorr(2, -0.7))
S <- equicorr(d = 3, rho = 0.7)
data <- rmnorm(1000, Sigma = S)
fit.norm(data)
S <- equicorr(d = 10, rho = 0.6)
data <- rmnorm(1000, Sigma = S) 
MardiaTest(data)
## Dow Jones Data
data(DJ)
r <- returns(DJ) 
stocks <- c("AXP","EK","BA","C","KO","MSFT",
            "HWP","INTC","JPM","DIS")
ss <- window(r[, stocks], "1993-01-01", "2000-12-31")
jointnormalTest(ss)

Run the code above in your browser using DataLab