Learn R Programming

gapfill (version 0.9.6-1)

EstimateQuantile: Estimate the Quantile of a Missing Value

Description

Helper function for Predict. The function estimates the quantile of the missing value at position mp from the data a relative to its image a[,,mp[3],mp[4]].

Usage

EstimateQuantile(a, mp, nQuant, predictionInterval = FALSE)

Arguments

a

Numeric array with 4 dimensions.

mp

Integer vector of length 4 indexing the position of the missing value to predict.

nQuant

Integer vector of length 1. Minimum number of non-missing values in a[mp[1], mp[2],,] required to estimate the quantile. If a[mp[1], mp[2],,] contains less non-missing values, the neighboring values of a[mp[1], mp[2],,] are also taken into account.

predictionInterval

Logical vector of length 1. If TRUE, the estimated quantile together with lower and upper bounds of an approximate 90% uncertainty interval is returned.

Value

If predictionInterval is FALSE, a numeric vector of length 1 being the estimated quantile of the missing value a[mp[1], mp[2], mp[3], mp[4]] is returned. Otherwise, a numeric vector of length 3 containing the estimated quantile and the lower and upper bounds of an approximate 90% uncertainty interval is returned.

References

F. Gerber, R. de Jong, M. E. Schaepman, G. Schaepman-Strub, and R. Furrer (2018) in IEEE Transactions on Geoscience and Remote Sensing, pp. 1-13, 10.1109/TGRS.2017.2785240.

See Also

Predict.

Examples

Run this code
# NOT RUN {
a <- Subset(data = ndvi, mp = c(1, 3, 1, 2), i = 0)
EstimateQuantile(a = a, mp = attr(a, "mp"), nQuant = 2)

# }

Run the code above in your browser using DataLab