MVN_FConditional: Calculate full conditional normal ditribution of MVN

Description Usage Arguments Details Value See Also Examples

Description

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.

Usage

1
2
3
4
5
# 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)

Arguments

data

A double level list containing all parameters of MVN distribution: mean vector (data$mean) and covariance matrix (data$var).

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 variable doesn't participate in the calculation.

Details

It can be proved that any full conditional distribution from a given MVN will degenerate to an 1d-normal distribution.

Value

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

See Also

MVN_BayesianPosteriori, MatrixAlternative

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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))

CubicZebra/MVNBayesian documentation built on May 17, 2019, 2:14 a.m.