posterior.Rd
posterior
computes the value of the posterior at parameter values pars
posterior(pars, data, Log = TRUE, mu = 0, sig = 25, prior = "Normal")
pars | parameter values |
---|---|
data | dataframe. The first column must be the binary dependent variable |
Log | logical to take the log of the posterior.(defaults to TRUE) |
mu | mean of prior of each parameter value in case the prior is Normal (default: 0) |
sig | standard deviation of prior of each parameter in case the prior is Normal (default: 25) |
prior | string input of "Normal" or "Uniform" prior distribution to use |
val value function of the posterior
y = indicat(faithful$waiting,mean(faithful$waiting)) x = scale(cbind(faithful$eruptions,faithful$eruptions^2)) data = data.frame(y,x) posterior(rep(0,3),data,Log = FALSE,mu=0,sig = 10,prior = "Normal") # no log#> [1] 8.367031e-87#> [1] -198.2006#> [1] -200.9495