compute_WMS: Compute the Weighted Mean Selection (WMS) gradient

Description Usage Arguments Value Note Examples

Description

compute_WMS computes the WMS gradient based on the fit of step 3 for a given study. The WMS gradient is produced by predicting the gradient in each year during the study period of ALL studies (accounting for the realization of the yearly random effect). The predictions are then averaged accounting for their uncertainty as measured by the prediction variance of the fit.

Usage

1
compute_WMS(mod_sel)

Arguments

mod_sel

An object produced by the function fit_cond_id with the settings 'condition = 3'.

Value

A list with two elements: the Weighted Mean Selection (WMS) gradient, and the weighted standard error associated with WMS (se).

Note

The weighted standard error is the square root of a prediction variance. It represents the prediction uncertainty of a weighted average of yearly selection gradients, taking into account the prediction covariance of yearly selection gradients. The weights used for averaging are the inverse of the yearly prediction variances, to minimize the variance of the average.

Examples

1
2
3
4
data_for_Trait <- prepare_data(data = dat_Trait, temperature = TRUE,
                               phenology = TRUE, morphology = FALSE)
mod3 <- fit_cond_id(data = data_for_Trait, id = "82", condition = "3")
compute_WMS(mod_sel = mod3)

radchukv/adRes documentation built on June 1, 2019, 7:05 p.m.