integratemvn {brmsmargins}R Documentation

Integrate over Multivariate Normal Random Effects

Description

Used in the process of Monte Carlo integration over multivariate normal random effects. This generates the random draws from the multivariate normal distribution and multiplies these by the data. Not intended to be called directly by most users.

Usage

integratemvn(X, k, sd, chol)

integratemvnR(X, k, sd, chol)

Arguments

X

A numeric matrix of the data to be multiplied by the random effects

k

An integer, the number of random samples to be used for numerical integration

sd

A numeric vector of the standard deviations

chol

A numeric matrix, which should be the Cholesky decomposition of the correlation matrix of the multivariate normal distribution.

Value

A numeric matrix with random values

Functions

Examples

integratemvn(
  X = matrix(1, 1, 2),
  k = 100L,
  sd = c(10, 5),
  chol = chol(matrix(c(1, .5, .5, 1), 2)))

integratemvn(matrix(1, 1, 1), 100L, c(5), matrix(1))

[Package brmsmargins version 0.2.0 Index]