MVN_FConditional {MVNBayesian} | R Documentation |
Function to export parameters of full conditional normal distribution in basis of given MVN distribution, the undecided dimension, as well as all values in the rest dimensions.
# Bayesian posteriori as input data:
# data <- MVN_BayesianPosteriori(dataset1, c(80,16,3))
# inquire parameters of full-conditional distribution based on Bayesian posteriori:
MVN_FConditional(data, variable, z)
data |
A double level list containing all parameters of MVN distribution: mean vector ( |
variable |
A integer to specify the undecided dimension. |
z |
A nd-vector to assign conditions (n = dimensions of given MVN distribution). It should be noted that the value in dimension specified by |
It can be proved that any full conditional distribution from a given MVN will degenerate to an 1d-normal distribution.
return a double level list containing the following parameters of full conditional normal distributions of given MVN in specified dimension:
mean |
a numberic mean of a normal distribution |
var |
a numberic variance of a normal distribution |
MVN_BayesianPosteriori
, MatrixAlternative
head(dataset1)
BPos <- MVN_BayesianPosteriori(dataset1, c(80,16,3))
BPos # Bayesian Posteriori
result <- MVN_FConditional(BPos, variable = 1, z=c(75, 13, 4))
result$mean
class(result$mean)
result$var
class(result$var)
# compare the following results:
MVN_FConditional(BPos, variable = 2, z=c(75, 13, 4))
MVN_FConditional(BPos, variable = 2, z=c(75, 88, 4))
MVN_FConditional(BPos, variable = 1, z=c(75, 88, 4))