cond_expr: 'cond_expr' returns moments of conditional multivariate...

Description Usage Arguments Value Examples

Description

cond_expr returns moments of conditional multivariate normal distribution X|Y (last variable is dependent). Only expression for X|Y. Requires installation of Maxima software.

Usage

1
cond_expr(neq, sdv, mv, nconteq = neq - 1, tex = FALSE)

Arguments

neq

Number of equations/variables.

sdv

Vector of standard deviation of normally distributed variables, e.g. c(NA, NA, NA, 1) NA - unknown, any number - know.

mv

Vector of means of normally distributed variables, e.g. rep(0, 4).

nconteq

Number of continuous equations.

tex

i if TRUE TeX expressions from wxMaxima are returned.

Value

List of strings. First element is an expression of conditional mean and covariance. The second element is a TeX formula.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# this means that E[y3|y1,y2] and V[y3|y1,y2] will be returned
# all continuous w/ unknown means
## Not run: 
# To run this, one needs to install Maxima software
res <- cond_expr(neq=3)
# 3 continuous w/ unknown means and the last one with mean 0 and sd 1, d|c1c2c3
res <- cond_expr(neq=4, sdv=c(NA, NA, NA, 1), mv=c(NA, NA, NA, 0))
# 2 continuous w/ unknown means and 2 discrete with mean 0 and sd 1, d1|c1c2c3d2
res <- cond_expr(neq=4, sdv=c(NA, NA,  1, 1), mv=c(NA, NA,  0, 0), nconteq=2)

## End(Not run)

nmm documentation built on Jan. 7, 2021, 5:10 p.m.

Related to cond_expr in nmm...