Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/varianceAnalysis.R
Extract componets of lists of objects
(as returned by function mopaPredict
)
and perform variance analysis to obtain raster objects of the
contribution of each component to the observed varaibility.
1 | varianceAnalysis(predictions, component1, component2, fixed = NULL)
|
predictions |
listed lists of raster objects as returned by |
component1 |
Character. Options are "SP", "PA", "SDM", "baseClim" and "newClim" (see Details). If exist, "foldModel" is another option. Selected option corresponds to the first component in the variance analysis. |
component2 |
Character. Options are "SP", "PA", "SDM", "baseClim" and "newClim" (see Details). If exist, "foldModel" is another option. Selected option corresponds to the second component in the variance analysis. |
fixed |
Optional. Character of the component names corresponding to the components that are not being
analyzed (component3, component4...). One name for each component is provided, components that only have one choice
(e.g. a single species, a single baseline climate, etc.) are internally fixed.
If |
Rasters are extracted using function grep
, by matching
names in the lists and characters in componen1
and componen2
.
The contribution of componen1 in front component2 to the spread (uncertainty) of the projected probabilities
in predictions
is here assessed using a simple analysis of variance approach, where the total
variance (V) can be decomposed as the summation of the variance explained by component1 (Vcomp1),
component2 (Vcomp2) and the combination of the previous two (Vcomp12):
V = Vcomp1 + Vcomp2 + Vcomp12.
Description of the components:
SP: presence data sets
PA: pseudo-absence realizations
SDM: modeling algorithms
baseClim: bseline climate, i.e. sets of vaiables used for model calibration in function
mopaTrain
,
newClim: new climate, i.e. sets of vaiables used to project models (e.g. future climate projections) in
function mopaPredict
.
A list of two RasterStack objects, the first containing the global mean and standard deviation and the second containing the percentage of variance correponding to each component in the analysis (component1, component2 and components 1 and 2).
M. Iturbide
San Martin, D., Manzanas, R., Brands, S., Herrera, S., & Gutierrez, J.M. (2016) Reassessing Model Uncertainty for Regional Projections of Precipitation with an Ensemble of Statistical Downscaling Methods. Journal of Climate 30, 203-223.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Load climate data
destfile <- tempfile()
data.url <- "https://raw.githubusercontent.com/SantanderMetGroup/mopa/master/data/biostack.rda"
download.file(data.url, destfile)
load(destfile, verbose = TRUE)
## Fitted models
data(mods)
?mods
## Model prediction and analysis of the variability in projections
newClim <- lapply(1:4, function(x){
crop(biostack$future[[x]], extent(-10, 5, 35, 60))
})
prdRS.fut <- mopaPredict(models = mods, newClim = newClim)
result <- varianceAnalysis(prdRS.fut, "PA", "newClim")
spplot(result$variance, col.regions = rev(get_col_regions()))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.