| Bmchoice | R Documentation | 
Model choice criteria calculation for univariate normal model for both known and unknown sigma^2
Bmchoice(
  case = "Exact.sigma2.known",
  y = ydata,
  mu0 = mean(y),
  sigma2 = 22,
  kprior = 1,
  prior.M = 1,
  prior.sigma2 = c(2, 1),
  N = 10000,
  rseed = 44
)
case | 
 One of the three cases: 
  | 
y | 
 A vector of data values. Default is 28 ydata values from the package bmstdr  | 
mu0 | 
 The value of the prior mean if kprior=0. Default is the data mean.  | 
sigma2 | 
 Value of the known data variance; defaults to sample variance of the data. This is ignored in the third case when sigma2 is assumed to be unknown.  | 
kprior | 
 A scalar providing how many data standard deviation the prior mean is from the data mean. Default value is 0.  | 
prior.M | 
 Prior sample size, defaults to 10^(-4).  | 
prior.sigma2 | 
 Shape and scale parameter value for the gamma prior on 1/sigma^2, the precision.  | 
N | 
 The number of samples to generate.  | 
rseed | 
 The random number seed. Defaults to 44 to reproduce the results in the book \insertCiteSahubook;textualbmstdr.  | 
A list containing the exact values of pdic, dic, pdicalt, dicalt, pwaic1, waic1, pwaic2, waic2, gof, penalty and pmcc. Also prints out the posterior mean and variance. @references \insertAllCited
Bmchoice()
b1 <- Bmchoice(case="Exact.sigma2.known")
b2 <- Bmchoice(case="MC.sigma2.known")
d1 <- Bmchoice(case="MC.sigma2.unknown")
d2 <- Bmchoice(y=rt(100, df=8),  kprior=1, prior.M=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.