rCensSp: Censored Spatial Data Simulation

Description Usage Arguments Value Author(s) Examples

View source: R/rCensspatial_USER.R

Description

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

Usage

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

Arguments

beta

linear regression parameters.

sigma2

partial sill parameter.

phi

spatial scaling parameter.

nugget

nugget effect parameter.

x

design matrix.

coords

2D spatial coordinates.

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, matern, and power exponential, respectively.

kappa

parameter for all spatial correlation functions. For exponential and gaussian κ=0, for power exponential 0 < κ <= 2, and for matern correlation function κ > 0.

Value

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

TrainingData

yobs

generated response vector.

cens

censoring indicator.

LI

lower censoring bound.

LS

upper censoring bound.

xcoord

x coordinates.

ycoord

y coordinates.

X

design matrix.

TestData

yobs

generated response vector.

xcoord

x coordinates.

ycoord

y coordinates.

X

design matrix.

Author(s)

Katherine L. Valeriano, Alejandro Ordonez, Christian E. Galarza and Larissa A. Matos.

Examples

1
2
3
4
5
6
7
n = 100
set.seed(1000)
coords = round(matrix(runif(2*n,0,15),n,2),5)
x = cbind(1, rnorm(n))
data = rCensSp(c(5,2),2,4,0.70,x,coords,"left",0.10,10,"gaussian",0)
data$TrainingData
data$TestData

RcppCensSpatial documentation built on Sept. 21, 2021, 5:07 p.m.