posterior {bayesdistreg}R Documentation

Posterior distribution

Description

posterior computes the value of the posterior at parameter values pars

Usage

posterior(pars, data, Log = TRUE, mu = 0, sig = 25,
  prior = "Normal")

Arguments

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

Value

val value function of the posterior

Examples

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
posterior(rep(0,3),data,Log = TRUE,mu=0,sig = 10,prior = "Normal") # log
posterior(rep(0,3),data,Log = TRUE) # use default values


[Package bayesdistreg version 0.1.0 Index]