scp | R Documentation |
This function provides the spatial conformal prediction interval for location(s) s0
,
given obserations s
and Y
.
scp( s0, s, Y, global = TRUE, eta = Inf, m = NULL, pred_fun = krige_pred, thetaHat = NULL, dfun = c("residual2", "std_residual2"), precision = NULL, alpha = 0.05 )
s0 |
prediction location(s), a numeric vector with |
s |
an n x 2 |
Y |
a vector with n values corresponding to |
global |
logical; if |
eta |
kernel bandwidth for weight schema, a positve scalar with smaller value meaning more localized procedure.
Defauls to |
m |
an postive integer representing the number of nearest locations to use for prediction.
Default depands on |
pred_fun |
spatial prediction function with inputs being s0, s, Y and ouputs being predicted |
thetaHat |
a vector of Matern parameters, representing nugget, partial sill, range, and smoothness as in Mao. et al. (2020).
Defaults to |
dfun |
non-conformity measure with four options.
In which, |
precision |
a positive scalar represents how dense the candidates for |
alpha |
significance level. Defaults to 0.05. |
The output is a data.frame
of lower and upper bounds of the conformal prediction interval(s) for s0
.
Huiying Mao, hmao@samsi.info, Brian Reich bjreich@ncsu.edu
to be entered
plausibility
, plausibility_contour
## generate prediction interval for prediction locations(s) s0(s) using sample data #?sample_data s = sample_data$s Y = sample_data$Y # locations to predict s0 = c(0.5,0.5) s0s = rbind(c(0.4, 0.4), c(0.5,0.5), c(0.6, 0.6)) # default prediction interval scp(s0=s0,s=s,Y=Y) scp(s0=s0s,s=s,Y=Y) # user define eta=0.1, where LSCP is considered scp(s0=s0,s=s,Y=Y,eta=0.1) # user define non-conformity measure scp(s0=s0,s=s,Y=Y,dfun="std_residual2") # user define prediction function fun = function(s0,s,Y) return(mean(Y)) scp(s0=s0,s=s,Y=Y,pred_fun=fun)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.