gammap: Posterior Distribution with Gamma Density

Description Usage Arguments Value Note Examples

View source: R/gammap.R

Description

MCMC runs of posterior distribution of data with Gamma(alpha,beta) density.

Usage

1
gammap(data, int=1000)

Arguments

data

data vector

int

number of iteractions selected in MCMC. The program selects 1 in each 10 iteractions, 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 gammap that gives a list containing the points of posterior distributions of alpha and beta of the gamma distribution, the data, mean posterior, median posterior and the credibility interval of the parameters.

Note

The non-informative prior distribution of these parameters are both Gamma(0.0001,0.0001). During the MCMC runs, screen shows the proportion of iteractions made

Examples

1
2
3
4
5
# Vector of maxima return for each 10 days for ibovespa data
data(ibovespa)
ibmax=gev(ibovespa[,4],10)$data
# obtaining 500 points of posterior distribution 
ibovpost=gammap(ibmax,300)

Example output

Loading required package: evir
[1] 0.02222222
[1] 0.04444444
[1] 0.06666667
[1] 0.08888889
[1] 0.1111111
[1] 0.1333333
[1] 0.1555556
[1] 0.1777778
[1] 0.2
[1] 0.2222222
[1] 0.2444444
[1] 0.2666667
[1] 0.2888889
[1] 0.3111111
[1] 0.3333333
[1] 0.3555556
[1] 0.3777778
[1] 0.4
[1] 0.4222222
[1] 0.4444444
[1] 0.4666667
[1] 0.4888889
[1] 0.5111111
[1] 0.5333333
[1] 0.5555556
[1] 0.5777778
[1] 0.6
[1] 0.6222222
[1] 0.6444444
[1] 0.6666667
[1] 0.6888889
[1] 0.7111111
[1] 0.7333333
[1] 0.7555556
[1] 0.7777778
[1] 0.8
[1] 0.8222222
[1] 0.8444444
[1] 0.8666667
[1] 0.8888889
[1] 0.9111111
[1] 0.9333333
[1] 0.9555556
[1] 0.9777778
[1] 1

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