powered by
condMom compute moments of conditional distribution of ith element of normal given all others.
condMom
condMom(x, mu, sigi, i)
vector of values to condition on - ith element not used
length(x) mean vector
length(x) dim inverse of covariance matrix
conditional distribution of ith element
a list containing:
cond mean
cond variance
This routine is a utility routine that does not check the input arguments for proper dimensions and type.
\(x\) \(\sim\) \(MVN(mu,sigi^{-1})\).
condMom computes moments of \(x_i\) given \(x_{-i}\).
For further discussion, see Bayesian Statistics and Marketing by Rossi, Allenby and McCulloch. http://www.perossi.org/home/bsm-1
## 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