KrigingExampleData: Synthetic data for kriging examples

Description Usage Format Details Examples

Description

This is a sample of 50 (x,y) ordered pairs: the x values are in sorted order, drawn from the interval [0,1]. The smallest x value is exactly 0, and the largest is exactly 1. The y values are the function y=9*x*(1-x)^3 evaluated at each x value, with a small measurement error (normal with mean 0, standard deviation 0.01) added on.

Usage

1
2

Format

The data in KrigingExampleData is listed in two vectors, x and y.

Details

The following code was used to generate the data:

1
2
3
4
5
set.seed(123)
x <- c(0,sort(runif(48)),1 )  
y <-  9*x*(1-x)^3  + rnorm(50, sd=0.01)
KrigingExampleData<- list( x=x, y=y)
save( KrigingExampleData, file="KrigingExampleData.rda")

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
data(KrigingExampleData)
x<- KrigingExampleData$x
y<- KrigingExampleData$y
plot(x,y)
kFit <- LatticeKrig(x, y)
xGrid <- seq(0,1,0.001)
lines(xGrid, predict(kFit, xGrid), col='red')

## End(Not run)

Example output

Loading required package: spam
Loading required package: dotCall64
Loading required package: grid
Spam version 2.5-1 (2019-12-12) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction 
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package:spamThe following objects are masked frompackage:base:

    backsolve, forwardsolve

Loading required package: fields
See https://github.com/NCAR/Fields for
 an extensive vignette, other supplements and source code 

LatticeKrig documentation built on Nov. 9, 2019, 5:07 p.m.