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 |
coords |
2D spatial coordinates of dimensions |
cens |
|
pcens |
desired censoring rate. By default |
npred |
number of simulated data used for cross-validation (Prediction). By default |
cov.model |
type of spatial correlation function: |
kappa |
parameter for some spatial correlation functions. For exponential and
gaussian |
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