rspacens: Censored Spatial data simulation

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/rspacensfin.R

Description

It simulates spatial data with linear structure for one type of censure (left or right).

Usage

1
2
rspacens(cov.pars,beta,x=as.matrix(rep(1,n)),coords,kappa=0,cens,n,n1,
cov.model="exponential",cens.type)

Arguments

cov.pars

covariance structure parameters for the errors distribution (φ, σ^2, τ^2).

beta

linear regression parameters.

x

design matrix.

coords

coordinates of simulated data.

kappa

κ parameter used in some covariance structures.

cens

percentage of censure in the data (number between 0 and 1).

n

number of simulated data used in estimation.

n1

number of simulated data used for cross validation (Prediction).

cov.model

covariance structure for the data (see cov.spatial from geoR).

cens.type

type of censure ("left" or "right").

Details

This function analyses prediction in spatial data. It returns a spatial dataset for estimation (n length) and a spatial dataset (n1 length) used to evaluate the prediction power of a model through cross validation. The covariance functions used here were provided by cov.spatial from the geoR package.

Value

y

complete simulated data ((n+n1) length).

datare

data frame that will be used for the model estimation (coordinates and response).

valre

data that will be used for cross validation studies (just response).

cc

indicator of censure (1:censored 0:observed).

cutoff

limit of detection simulated for censure (left: <=cutoff, right: > cutoff).

coords1

coordinates of value data.

Author(s)

Alejandro Ordonez <<[email protected]>>, Victor H. Lachos <<[email protected]>> and Christian E. Galarza <<[email protected]>>

Maintainer: Alejandro Ordonez <<[email protected]>>

References

Diggle, P. & Ribeiro, P. (2007). Model-Based Geostatistics. Springer Series in Statistics.

Schelin, L. & Sjostedt-de Luna, S. (2014). Spatial prediction in the presence of left-censoring. Computational Statistics and Data Analysis, 74.

See Also

SAEMSCL

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
n<-200 ### sample size for estimation.
n1=100 ### number of observation used in the prediction.

###simulated coordinates
r1=sample(seq(1,30,length=400),n+n1)
r2=sample(seq(1,30,length=400),n+n1)
coords=cbind(r1,r2)### total coordinates (used in estimation and prediction).
coords1=coords[1:n,]####coordinates used for estimation.

type="matern"### covariance structure.

xtot<-cbind(1,runif((n+n1)),runif((n+n1),2,3))## X matrix for estimation and prediction.
xobs=xtot[1:n,]## X matrix for estimation

obj=rspacens(cov.pars=c(3,.3,0),beta=c(5,3,1),x=xtot,coords=coords,
kappa=1.2,cens=0.25,n=(n+n1),n1=n1,cov.model=type,cens.type="left")

CensSpatial documentation built on May 30, 2017, 8:24 a.m.