50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

bayesm (version 3.0-2)

condMom: Computes Conditional Mean/Var of One Element of MVN given All Others

Description

condMom compute moments of conditional distribution of ith element of normal given all others.

Usage

condMom(x, mu, sigi, i)

Arguments

x

vector of values to condition on - ith element not used

mu

length(x) mean vector

sigi

length(x) dim inverse of covariance matrix

i

conditional distribution of ith element

Value

a list containing:

cmean

cond mean

cvar

cond variance

Warning

This routine is a utility routine that does not check the input arguments for proper dimensions and type.

Details

x MVN(mu,sigi1).

condMom computes moments of xi given xi.

References

For further discussion, see Bayesian Statistics and Marketing by Rossi, Allenby and McCulloch. http://www.perossi.org/home/bsm-1

Examples

Run this code
##
sig=matrix(c(1,.5,.5,.5,1,.5,.5,.5,1),ncol=3)
sigi=chol2inv(chol(sig))
mu=c(1,2,3)
x=c(1,1,1)
condMom(x,mu,sigi,2)

Run the code above in your browser using DataLab