runMCMCCountry: Run MCMC estimation (single time series)

Description Usage Arguments Value See Also Examples

View source: R/runmcmccountry.R

Description

Run MCMC estimation of a single time series using JAGS.

Usage

1
2
3
4
runMCMCCountry(df, nyears, method, order = NULL, I = 2.5,
  matern.cov = TRUE, obs.err = FALSE, measurement.err = FALSE,
  nchains = 4, nburnin = 1000, niter = 1000 + 30000, nthin = 30,
  model.file.path = NULL)

Arguments

df

A dataframe of x and y observations, and standard errors around ys

nyears

number of years of observations

method

The method of smoothing to implement (choices: ar, arma, splines, gp)

order

The order of splines penalization (either 1 or 2)

I

Knot spacing for splines

matern.cov

Whether or not to use Matern covariance function. Default is TRUE.

obs.err

is TRUE if standard errors are observed

measurement.err

is TRUE if there is assumed to be measurement error

nchains

Number of MCMC chains

nburnin

Number of iterations to throw away as burn in.

niter

Number of total iterations.

nthin

Degree of thinning of MCMC chains

model.file.path

Text file which contains the model to be fitted. If NULL, the text file is drawn from the models folder.

Value

A JAGS model object

See Also

getResults, plotResults

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
nyears <- 100
prop.sample <- 0.7
obs.err <- TRUE
sigma.y <- 0.5
seed <- 123
method <- 'splines'
params <- list(sigma.alpha = 1, order = 1)
df <- simulateFluctuations(nyears, prop.sample, method, params, obs.err, sigma.y)
df$se <- 1
mod <- runMCMCCountry(df = df, nyears = 100, method = "splines", order = 1,
nchains = 4, nburnin = 100, niter = 100+3000, nthin = 3)

MJAlexander/distortr documentation built on July 17, 2020, 4:06 p.m.