Description Usage Arguments Examples
given a multivariate normal with mean mu and covariance matrix sig, and a vector of observations y, impute the missing values in y and the corresponding conditional covariance matrix
1 | imputeY(y, sig, mu)
|
y |
|
sig |
|
mu |
1 2 3 4 5 6 7 8 9 10 11 12 13 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function( y, sig, mu )
{
n <- length( y ); nm < -is.na( y )
indi <- which( !nm ); v <- matrix( 0, n, n )
cs <- condiStat( sig, mu, y[indi], indi )
y[nm] <- cs$cmean; v[nm,nm] <- cs$cdisp
return( list( yimp = y, vimp = v ) )
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.