select_eta: Select the optimal tunning parameter for 'scp'

View source: R/select_eta.R

select_etaR Documentation

Select the optimal tunning parameter for scp

Description

Select the optimal tunning parameter for scp

Usage

select_eta(s, Y, eta_cand = NULL, plot = TRUE)

Arguments

s

an n x 2 matrix or a data.frame with two coordinates of n locations.

Y

a vector with n values corresponding to Y(s).

eta_cand

a vector of candidate eta values. Defaults to NULL.

plot

logical; if TRUE, select_eta plots the empirical interval score for the candidate eta values. if FALSE, no plot will be generated. Defaults to TRUE.

Value

The optimum eta based on minimizing empirical interval score.

Examples

#?sample_data
s  = sample_data$s
Y  = sample_data$Y

# CAUTION: the following command may take one hour to run.
opt_eta = select_eta(s = s, Y = Y)

use optimal eta to calculate prediction interval
s0  = c(0.5,0.5)
scp(s0 = s0, s = s, Y = Y, eta = opt_eta)

mhuiying/scp documentation built on May 4, 2022, 11:35 p.m.