rnStempCens {StempCens}R Documentation

Censored spatio-temporal data simulation

Description

It simulates balanced censored spatio-temporal data with a linear structure for an established censoring rate o limit of detection.

Usage

rnStempCens(x, time, coords, beta, phi, rho, tau2, sigma2,
  type.S = "exponential", kappa = 0, cens = "left", pcens = 0.1,
  lod = NULL)

Arguments

x

design matrix of dimensions nt x p.

time

vector containing the unique time points at which the observations are made, of length t.

coords

2D unique spatial coordinates of dimension n x 2.

beta

linear regression parameters.

phi

value of the spatial scaling parameter.

rho

value of the time scaling parameter.

tau2

value of the the nugget effect parameter.

sigma2

value of the partial sill.

type.S

type of spatial correlation function: 'exponential' for exponential, 'gaussian' for gaussian, 'matern' for matern, 'pow.exp' for power exponential and 'spherical' for spherical function, respectively. See the analytical expressions of these functions in EffectiveRange.

kappa

parameter for all spatial covariance functions. In the case of exponential, gaussian and spherical function \kappa is equal to zero. For the power exponential function \kappa is a number between 0 and 2. For the matern correlation function is upper than 0.

cens

'left' or 'right' censoring. By default='left'.

pcens

desired censoring rate. By default=0.10.

lod

desired detection limit for censored observations. By default=NULL.

Value

The function returns a data.frame containing the simulated data.

Author(s)

Katherine L. Valeriano, Victor H. Lachos and Larissa A. Matos

Examples

set.seed(1000)
# Initial parameter values
phi  <- 5
rho  <- 0.45
tau2 <- 0.80
sigma2 <- 2
beta   <- c(1, 2.5)
x <- cbind(1, rnorm(50))

# Coordinates
coords <- matrix(runif(20, 0, 10), ncol=2) # Cartesian coordinates without repetitions
time   <- 1:5  # Time index without repetitions

# Data simulation
data <- rnStempCens(x, time, coords, beta, phi, rho, tau2, sigma2,
                    type.S="exponential", cens="left", pcens=0.10)

[Package StempCens version 1.2.0 Index]