Description Usage Arguments Details Value Note See Also Examples

Function to execute parameter estimation for MVN distribution, under Bayesian analysis framework.

1 2 3 |

`data` |
A data.frame or matrix-like data: obervations should be arrayed in rows while variables should be arrayed in columns. |

`pri_mean` |
A numeric vector to assign priori mean for MVN. Default value applies |

`Gibbs_nums` |
A positive integer. The numbers of random vectors to be generated for each iteration step. Defult value is 5000. |

`pseudo_nums` |
A positive integer. The argument to determine numbers of generated vectors used for each iteration step. Default value keeps the same scale as input data. Notice that a too small value can result in singular matrix. |

`threshold` |
A numeric value to control stoping the iteration loop. Default value used 0.0001. While the Euclidean distance of mean vectors between pseudo-data (the last |

`iteration` |
A positive integer. Argument to assign the maximum steps for iteration. Default value is 100 after which the iteration loop will compulsively exit. |

`...` |
Other arguments to control the process in Gibbs sampling. |

Because that MVN distribution possess conjugated property in Bayesian analysis framework, the convergence of Bayesian iterator for MVN distribution can be ensured, accoumpanied with the shrink of 2nd-norm of Bayesian posteriori covariance matrix. But pay attention to the fact that pseudo-data leads to the randomness, the argument `pseudo_nums`

should be set carefully.

return a double level list containing Bayesian posteriori after iteration process:

`mean` |
Bayesian posteriori mean vector |

`var` |
Bayesian posteriori covariance matrix |

If the parameter values are the only interested thing we concerned, this iterator makes sense. Since it can significantly help us decrease the scale of covariance matrix, to obtain a more reliable estimation for the parameters. However, in more cases, some correlationships of a certain group of pamameters are more valuable, which are usually clued by the covariance matrix.

`MVN_BayesianPosteriori`

, `MVN_GibbsSampler`

, `MVN_FConditional`

, `MatrixAlternative`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
library(mvtnorm)
# Bayesian posteriori before iteration using dataset1 as example,
# c(80, 16, 3) as priori mean:
# View 2-norm of covariance matrix of Bayesian posteriori:
BPos_init <- MVN_BayesianPosteriori(dataset1, c(80,16,3))
BPos_init
norm(as.matrix(BPos_init$var), type = "2")
# Bayesian posteriori after iteration using c(80,16,3) as priori
# Using 30 last samples generated by GibbsSampler for each step:
BPos_fina1 <- MVN_BayesianIterator(dataset1, c(80,16,3), 5000, 30)
BPos_fina1
norm(as.matrix(BPos_fina1$var), type = "2")
# Too small pseudo_nums setting can results in singular system, try:
MVN_BayesianIterator(dataset1, pseudo_nums=3)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.