normalp: Posterior Distribution with Normal Density

Description Usage Arguments Value Note See Also Examples

View source: R/normalp.R

Description

MCMC runs of posterior distribution of data with Normal(mu,1/tau) density, where tau is the inverse of variance.

Usage

1
normalp(data, int=1000)

Arguments

data

data vector

int

number of iteractions selected in MCMC. The program selects 1 in each 10 iteraction, then thin=10. The first thin*int/3 iteractions is used as burn-in. After that, is runned thin*int iteraction, in which 1 of thin is selected for the final MCMC chain, resulting the number of int iteractions

Value

An object of class gumbelp that gives a list containing the points of posterior distributions of mu and tau of the normal distribution, the data, mean posterior, median posterior and the credibility interval of the parameters.

Note

The non-informative prior distribution of these parameters are Normal(0,10000000) for the parameter mu and Gamma(0.001,0.001) for the parameter tau . During the MCMC runs, screen shows the proportion of iteractions made.

See Also

plot.normalp

Examples

1
2
3
4
5
6
7
8
9
# Obtaining posterior distribution of a vector of simulated points
x=rnorm(300,2,sqrt(10))

# Obtaning 1000 points of posterior distribution
ajuste=normalp(x, 200)

# Posterior distribution of river Nile dataset
## Not run: data(Nile)
## Not run: postnile=normalp(Nile,1000)

Example output

Loading required package: evir
[1] 0.03333333
[1] 0.06666667
[1] 0.1
[1] 0.1333333
[1] 0.1666667
[1] 0.2
[1] 0.2333333
[1] 0.2666667
[1] 0.3
[1] 0.3333333
[1] 0.3666667
[1] 0.4
[1] 0.4333333
[1] 0.4666667
[1] 0.5
[1] 0.5333333
[1] 0.5666667
[1] 0.6
[1] 0.6333333
[1] 0.6666667
[1] 0.7
[1] 0.7333333
[1] 0.7666667
[1] 0.8
[1] 0.8333333
[1] 0.8666667
[1] 0.9
[1] 0.9333333
[1] 0.9666667
[1] 1

MCMC4Extremes documentation built on May 1, 2019, 8:50 p.m.