Validate: Validation with RMSE

Description Usage Arguments Value Author(s) Examples

Description

The function summarizes the validation scenario and returns the root mean squared error (RMSE) of the predictions. The typical validation procedure is: start with the trueData. Remove some validation points to obtain artificially generated dataObserved. Predicting the validation points based on dataObserved leads to dataFilled.

Usage

1
2
3
4
5
6
Validate(
  dataObserved,
  dataFilled,
  dataTrue,
  include = rep(TRUE, length(dataObserved))
)

Arguments

dataObserved

Numeric vector containing the observed data.

dataFilled

Numeric vector containing the filled (predicted) data. Needs to have the same length as dataObserved.

dataTrue

Numeric vector containing the true data. Needs to have the same length as dataObserved.

include

Logical vector indicating which element to include in the calculation of the RMSE.

Value

Numeric matrix with one 1 row and 6 columns having the entries:

Author(s)

Florian Gerber, flora.fauna.gerber@gmail.com.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
Validate(c(1, NA, 2, NA), c(1, 2, 2, NA), c(1, 1, 2, 2))

## validate gap-fill predictions: consider the ndvi data
Image(ndvi)

## define some validation points vp
## in the image of the day 145 of the year 2004
vp <- 300 + c(5:10) + rep(21 * c(0:5), each = 6)

## remove the vp values from the data
nn <- ndvi
nn[vp] <- NA
Image(nn)

## predict the vp values 
out <- Gapfill(nn, subset = vp)
Validate(dataObserved = nn, dataFilled = out$fill,
         dataTrue = ndvi)

gapfill documentation built on Feb. 12, 2021, 5:06 p.m.