rCensSp {RcppCensSpatial}R Documentation

Censored spatial data simulation

Description

It simulates censored spatial data with a linear structure for an established censoring rate.

Usage

rCensSp(beta, sigma2, phi, nugget, x, coords, cens = "left", pcens = 0.1,
  npred = 0, cov.model = "exponential", kappa = NULL)

Arguments

beta

linear regression parameters.

sigma2

partial sill parameter.

phi

spatial scaling parameter.

nugget

nugget effect parameter.

x

design matrix of dimensions n\times q.

coords

2D spatial coordinates of dimensions n\times 2.

cens

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

pcens

desired censoring rate. By default =0.10.

npred

number of simulated data used for cross-validation (Prediction). By default =0.

cov.model

type of spatial correlation function: 'exponential', 'gaussian', 'matern', and 'pow.exp' for exponential, gaussian, matérn, and power exponential, respectively.

kappa

parameter for some spatial correlation functions. For exponential and gaussian kappa=NULL, for power exponential 0 < kappa <= 2, and for matérn correlation function kappa > 0.

Value

If npred > 0, it returns two lists: Data and TestData; otherwise, it returns a list with the simulated data.

Data

y

response vector.

ci

censoring indicator.

lcl

lower censoring bound.

ucl

upper censoring bound.

coords

coordinates matrix.

x

design matrix.

TestData

y

response vector.

coords

coordinates matrix.

x

design matrix.

Author(s)

Katherine L. Valeriano, Alejandro Ordoñez, Christian E. Galarza, and Larissa A. Matos.

Examples

n = 100
set.seed(1000)
coords = round(matrix(runif(2*n,0,15),n,2), 5)
x = cbind(1, rnorm(n))
data = rCensSp(beta=c(5,2), sigma2=2, phi=4, nugget=0.70, x=x,
               coords=coords, cens="left", pcens=0.10, npred=10,
               cov.model="gaussian")
data$Data
data$TestData

[Package RcppCensSpatial version 0.3.0 Index]