Description Usage Arguments Value Examples
This function can be used to obtain the conditional distribution of any Np.
1 | conditional_np(x, mu, Sigma)
|
x |
is a vector with the values that are known. For example, |
mu |
is the mean vector of the Np. |
Sigma |
is the covariance matrix of the Np. |
a list with the mean and covariance matrix of the conditional distribution.
1 2 3 4 5 6 7 8 9 10 11 | # Consider a N3 normal distribution
mu <- c(3, -1, 1)
Sigma <- matrix(c(3, -1, 1,
-1, 1, 0,
1, 0, 2), ncol=3)
# We want the conditional distribution of X2 given X1=2 and X3=0
conditional_np(x=c(2, NA, 0), mu=mu, Sigma=Sigma)
# We want the conditional distribution of X1 and X3 given X2=2
conditional_np(x=c(NA, 2, NA), mu=mu, Sigma=Sigma)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.