Learn R Programming

tsbridge (version 1.1)

y.fit: Fitted Time Series from Simulated Parameters

Description

Returns fitted time series for each set of simulated parameter values used in the calculation of the log-likelihood.

Usage

y.fit(bug, sims, ysim = NULL, pre.beg = FALSE)

Arguments

bug
A BUGS model created in the tsbugs package.
sims
A data.frame of simulated parameter values with column names labelled according to output from the R2OpenBUGS package.
ysim
A data.frame of simulated y values with column names labelled according to output from the R2OpenBUGS package.
pre.beg
Logical value to include or exclude NA outputs in time periods (columns) before the starting value for which data are considered in the likelihood of the BUGS model. The number of columns will be dependent on the value of the bug argument used when setting up the BUGS model using the tsbugs package. By default this argument is FALSE, i.e. there are no columns of missing values returned.

Value

A data.frame where rows are simulations and columns are time.

Details

Returns mean series for each set of simulated parameter values. When y, the observed time series contains missing values, users need to supply a data frame of simulated y values for ysim. This will allow the calculation of mean values for $y$ in the presence of missing data.

See Also

h.fit, tslogl

Examples

Run this code
## Not run: 
# # demo example with constant variance models for differenced growth rate
# # of England and Wales population as used in Abel et. al. (2013)
# demo("cv_bma", "tsbridge")
# ## End(Not run)

Run the code above in your browser using DataLab