The function inferfmetrop is used to create a sample from the posterior distribution of H. The function uses the eq.10 in Tyralis and Koutsoyiannis (2014) and a Metropolis algorithm to make inference on H.
1 2  inferHmetrop(data, theta.init=0.7, burnin = 500, mcmc = 20000, thin = 1,
tune = 1,verbose = 0,seed = NA)

data 
time series data 
theta.init 
Starting values for the sampling. Must be of the appropriate
dimension. It must also be the case that 
burnin 
The number of burnin iterations for the sampler. 
mcmc 
The number of MCMC iterations after burnin. 
thin 
The thinning interval used in the simulation. The number of MCMC iterations must be divisible by this value. 
tune 
The tuning parameter for the Metropolis sampling. Can be either a positive scalar or a kvector, where k is the length of theta. 
verbose 
A switch which determines whether or not the progress of the
sampler is printed to the screen. If 
seed 
The seed for the random number generator. If NA, the Mersenne
Twister generator is used with default seed 12345; if an integer is passed it
is used to seed the Mersenne twister. The user can also pass a list of length
two to use the L'Ecuyer random number generator, which is suitable for parallel
computation. The first element of the list is the L'Ecuyer seed, which is a
vector of length six or NA (if NA a default seed of 
An mcmc object that contains the posterior sample. This object can be summarized by functions provided by the coda package.
The Metropolis algorithm uses the function MCMCmetrop1R from the package MCMCpack (Martin et al. 2011).
Hristos Tyralis
Martin A.D., Quinn K.M., Park J.H. (2011) MCMCpack: Markov chain Monte Carlo in R, Journal of Statistical Software 42(9), 1–21. http://www.jstatsoft.org/v42/i09.
Tyralis H., Koutsoyiannis, D. (2014) A Bayesian statistical model for deriving the predictive distribution of hydroclimatic variables, Climate Dynamics 42(1112), 2867–2883. http://dx.doi.org/10.1007/s003820131804y.
1 2 3 4 5 6  # Posterior distribution of the H parameter of the HKp for the Nile time series.
samp.sim < inferHmetrop(Nile,theta.init = 0.7,burnin = 500,mcmc = 500,thin = 1,
tune = 1,seed = 12345)
hist(samp.sim,breaks = 20,main = "Histogram of H",xlab = "H")

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.