infermsfmetrop {HKprocess}R Documentation

Bayesian inference for μ and σ^2 for the AR(1) process.

Description

The function infermsmetrop is used to create a sample from the posterior distribution of μ and σ^2, using eqs. 8,9 in Tyralis and Koutsoyiannis (2014) for the AR(1) process.

Usage

infermsfmetrop(fbayes,data)

Arguments

data

time series data

fbayes

phi parameter simulation sample, should be a vector

Value

A matrix with two columns, the first corresponding to the sample of μ and the second corresponding to the sample of σ^2.

Author(s)

Hristos Tyralis

References

Tyralis H, Koutsoyiannis D (2014) A Bayesian statistical model for deriving the predictive distribution of hydroclimatic variables. Climate Dynamics 42(11-12):2867–2883. doi:10.1007/s00382-013-1804-y.

Examples

# Posterior distribution of the mu and sigma parameters of the AR(1) process for
# the Nile time series.

set.seed(12345)

samp.sim1 <- inferf(Nile, 500)

samp.sim2 <- infermsfmetrop(samp.sim1, Nile)

hist(samp.sim2[,1], breaks = 20, main = expression(paste("Histogram of ",mu)),
    xlab = expression(paste(mu)))

hist(sqrt(samp.sim2[,2]), breaks = 20,
    main = expression(paste("Histogram of ",sigma)),
    xlab = expression(paste(sigma)))

[Package HKprocess version 0.1-1 Index]