Learn R Programming

geoCount (version 1.150120)

repYeb: Generate Replicated Data with Estimated Parameters

Description

This function generates replicated data sets based on estimated parameters (given or from posterior samples).

Usage

repYeb(N.sim, loc, L, X = NULL, rho.family = "rhoPowerExp", Y.family="Poisson", res.m = NULL, est = "mode", beta = NULL, sigma = NULL, phi = NULL, k = 1)

Arguments

N.sim
the number of replicated data sets to be simulated
loc
a $n \times 2$ matrix which indicates the coordinates of observed locations
L
a vector of length n; it indicates the time duration during which the Poisson counts are accumulated, or the total number of trials for Binomial response
X
a $n \times p$ covariate matrix; the default value "NULL" indicates no covariate
rho.family
take the value of "rhoPowerExp" or "rhoMatern" which indicates the powered exponential or Matern correlation function is used
Y.family
take the value of "Poisson" or "Binomial" which indicates Poisson or Binomial distribution for response variables
res.m
a list with elements containing the posterior samples of latent variables and parameters for observed locations
est
take the value of "mode" which indicates the mode of posterior samples will be used as the parameter estimate; otherwise, the mean will be used
beta
a value which indicates the estimation for $\beta$; ignored if "res.m" is given
sigma
a value which indicates the estimation for $\sigma$; ignored if "res.m" is given
phi
a value which indicates the estimation for $\phi$; ignored if "res.m" is given
k
a value which indicates the estimation for $\kappa$; ignored if "res.m" is given and contains the posterior samples for $\kappa$

Value

A $n \times N.sim$ matrix of replicated data sets.

See Also

repYpost, simData.

Examples

Run this code
## Not run: 
# # Estimate parameters from posterior samples
# Yrep.eb <- repYeb(N.sim=2000, loc, L, res.m, est = "mode")
# # Pre-determined parameters (also an efficient way to simulate massive data sets)
# Yrep.eb <- repYeb(N.sim=2000, loc, L, beta = 5, sigma = 1, phi = 0.1, 
#                   k = 1)
# ## End(Not run)

Run the code above in your browser using DataLab