Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mhuiying/scp
R Package for Spatial Conformal Prediction
https://github.com/mhuiying/scp
Last synced: 3 months ago
JSON representation
R Package for Spatial Conformal Prediction
- Host: GitHub
- URL: https://github.com/mhuiying/scp
- Owner: mhuiying
- License: gpl-3.0
- Created: 2020-04-04T19:09:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-06T00:59:27.000Z (over 2 years ago)
- Last Synced: 2024-02-13T08:04:57.758Z (9 months ago)
- Language: R
- Homepage:
- Size: 106 MB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-conformal-prediction - R Package for Spatial Conformal Prediction
README
# R Package for Spatial Conformal Prediction
The goal of “scp” is to provide valid model-free spatial prediction
intervals.## Installation
The current development version can be installed from source using
devtools.``` r
devtools::install_github("mhuiying/scp", build_vignettes = TRUE)
```## Example
``` r
library(scp)# an example sample data
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)
```Want more example, please check our `vignettes`.
``` r
browseVignettes('scp')
```## References
Mao, Huiying, Ryan Martin, and Brian Reich. **Valid model-free spatial
prediction**, 2020. [\[arxiv\]](https://arxiv.org/pdf/2006.15640.pdf)