dnormgamma: The Normal-Gamma distribution

Description Usage Arguments Note Examples

View source: R/distns.R

Description

Density and random generation for the normal-gamma distribution with parameters b, c, g and h. Also contours and confidence regions.

Usage

1
2
3
4
5
dnormgamma(mu, tau, b, c, g, h)

rnormgamma(n, b, c, g, h)

NGacontour(mu, tau, b, c, g, h, p = NULL, ...)

Arguments

mu

vector of quantities.

tau

vector of quantities.

b

mean.

c

must be strictly positive.

g

must be strictly positive.

h

must be strictly positive.

n

sample size.

p

probability.

...

arguments to be passed to the plot function when plotting contours.

Note

If (mu,tau)^T~NGa(b,c,g,h) then mu|tau~N(b,1/(c*tau)) and tau~Ga(g,h). Also mu~t_(2g)(b,h/(gc)).

Examples

1
2
3
4
5
6
dnormgamma(1, 2, 1, 2, 5, 3)
rnormgamma(1, 1, 2, 5, 3)
mu=seq(2,4,len=1000)
tau=seq(0,30,len=1000)
NGacontour(mu,tau,3,1,4,0.35,0.95)
NGacontour(mu,tau,2.5,30,20,2,0.95,add=TRUE,lty=3)

nclbayes documentation built on May 2, 2019, 5:53 p.m.