Learn R Programming

SpatioTemporal (version 0.9.2)

compute.ltaCV: Computes the long term average for each sites.

Description

Computes the long term average of observations and cross-validated predictions for each of the sites in predCV. The long term averages are computed using only timepoints that have observations, this applies to both the observed and predicted. Also the function allows for a transformation: if requested the transformation is applied before the averaging.

Usage

compute.ltaCV(predCV, trans = NULL)

Arguments

predCV
Result of a cross-validation. Should be the output from predictCV.
trans
Transform observations and predictions before computing averages. NULL gives no transformation, trans=0 takes the exponent of data (assuming that data was originally log-transformed) a non-zero value will rai

Value

  • Returns a (number of locations) - by - 2 matrix with the observed and predicted value for each location.

encoding

latin1

See Also

See createCV and estimateCV for cross-validation set-up and estimation.

For computing CV statistics, see also predictNaive, and for further illustration see plotCV, CVresiduals.qqnorm, and summaryStatsCV.

Examples

Run this code
##load data
data(mesa.data.res)

##Extract pre-computed cross-validated predictions
pred.cv <- mesa.data.res$pred.cv

##compute long term averages of predictions and observations
pred.lta <- compute.ltaCV(pred.cv)

##we can now compare observed and predicted averages at each site
plot(pred.lta[,"obs"],pred.lta[,"pred"])
abline(0,1)

Run the code above in your browser using DataLab