Description Usage Arguments Value Examples
View source: R/get_posterior_variance.R
This function is underconstruction. I validate only the example of this function. For MRMC case, I have to write or modify code. 2019 Sept 6
1 | get_posterior_variance(StanS4class, name.of.parameter)
|
StanS4class |
An S4 object of class To be passed to |
name.of.parameter |
An parameter name (given as a character string, should not surround by ""). The name of parameter which user want to extract. Parameters are contained in the parameter block of each Stan file in the path: inst/extdata. |
variance or posterior parameters, if it is an array, then return is also an array.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## Not run:
fit <- fit_Bayesian_FROC(BayesianFROC::dd,ite = 111)
e <- rstan::extract(fit)
# Check the retrun value is the desired one.
# apply(e$z, 2, var) == get_posterior_variance(fit,z)
# apply(e$mu, c(2,3), var) == get_posterior_variance(fit,mu)
# apply(e$v, c(2,3), var) == get_posterior_variance(fit,v)
# apply(e$ppp, c(2,3,4), var) == get_posterior_variance(fit,ppp)
#This code is OK, but R CMD check might say error cuz the object
# z, mu, v, ppp is not found
# apply(e$z, 2, var) == get_posterior_variance(fit,"z")
# apply(e$mu, c(2,3), var) == get_posterior_variance(fit,"mu")
# apply(e$v, c(2,3), var) == get_posterior_variance(fit,"v")
# apply(e$ppp, c(2,3,4), var) == get_posterior_variance(fit,"ppp")
## End(Not run)#dontrun
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.