# computeLTA: Computes the Long Term Average for Each Sites. In SpatioTemporal: Spatio-Temporal Model Estimation

## Description

Computes the long term average of observations and cross-validated predictions for each of the sites in `object`. 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

 `1` ```computeLTA(object, transform = function(x) { return(x) }) ```

## Arguments

 `object` A `predCVSTmodel` object, the result of `predictCV.STmodel`. `transform` Transform observations (without bias correction) and predictions before computing averages; e.g. `transform=exp` gives the long term averages as `mean( exp(obs) )` and `mean( exp(pred) )`.

## Value

Returns a (number of locations) - by - 4 matrix with the observed and predicted value (using the three different model parts) for each location.

## Author(s)

Johan Lindstrom

Other predCVSTmodel functions: `estimateCV.STmodel`

Other cross-validation functions: `createCV`, `dropObservations`, `estimateCV.STmodel`, `predictNaive`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25``` ```##load data data(pred.cv.mesa) ##compute long term averages of predictions and observations pred.lta <- computeLTA(pred.cv.mesa) ##we can now compare observed and predicted averages at each site plot(pred.lta[,"obs"], pred.lta[,"EX.mu"], pch=1, xlim=range(pred.lta), ylim=range(pred.lta), xlab="obs", ylab="predictions") ##for the different model components points(pred.lta[,"obs"], pred.lta[,"EX.mu.beta"], pch=3, col=2) points(pred.lta[,"obs"], pred.lta[,"EX"], pch=4, col=3) abline(0,1) ##we could also try computaitons on the original scale pred.lta <- computeLTA(pred.cv.mesa, exp) ##compare observed and predicted averages plot(pred.lta[,"obs"], pred.lta[,"EX.mu"], pch=1, xlim=range(pred.lta), ylim=range(pred.lta), xlab="obs", ylab="predictions") points(pred.lta[,"obs"], pred.lta[,"EX.mu.beta"], pch=3, col=2) points(pred.lta[,"obs"], pred.lta[,"EX"], pch=4, col=3) abline(0,1) ```

### Example output

```Loading required package: Matrix
```

SpatioTemporal documentation built on May 2, 2019, 8:49 a.m.