infermsfmetrop: Bayesian inference for mu and sigma^2 for the AR(1) process.

Description Usage Arguments Value Author(s) References Examples

View source: R/infermsfmetrop.R

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

1

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. http://dx.doi.org/10.1007/s00382-013-1804-y.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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)))

HKprocess documentation built on May 29, 2017, 9:20 p.m.