Description Usage Arguments Value Author(s) Examples
Assess climate-sensitivity of model performance
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
airtemp |
Numeric vector of observed annual average air temperatures (°C) |
precip |
Numeric vector of observed annual average precipitation values (mm) |
objective |
Numeric vector of model objective function results (e.g., RMSE, NSE) |
fixed_var |
If desired, a variable to be used for a fixed effect. Should be a vector of observations of this effect that correspond to the positions of other vectors given to the function. This vector can be of class numeric, factor, or character. |
fixed_return |
If a fixed effect variable is provided, this should be a numeric value of the fixed effect variable that should be used to return answers. Must be a value from within the fixed effect variable vector. If not provided, will take first value in fixed_var |
ref_airtemp |
The reference value of air temperature (°C) in a historical average year. If not provided, will be set to mean of observed vector. |
ref_precip |
The reference value of precipitation (mm) in a historical average year. If not provided, will be set to mean of observed vector. |
new_airtemp |
The air temperature values (°C) to be used for comparison. If not supplied, will be set to the 5th and 95th percentiles of the range of observations. This should be a vector of length one (representing unidirectional climate change) or two (representing potential change in two directions - e.g., wetting or drying). |
new_precip |
The precipitation values (mm) for comparison. See notes for new_airtemp. |
return_model |
Should the function return the model object? This is useful for examining residuals, but could lead to large outputs. |
return_plot_df |
Should the function return a data frame that can be used to make a contour plot? |
return_plot |
Should the function return a contour plot showing the results? The plot returned is a ggplot() object and can be modified with additional calls to ggplot2 (see package readme). |
return_pred |
Should the function return predicted error for the supplied values of airtemp and precip? |
airtemp_limits |
Limits of range on which to predict air temp if returning plot_df |
precip_limits |
Limits of range on which to predict precip if returning plot_df |
k_val |
Number of knots to use in gam - equivalent to k in gam(). Defaults to 3. |
A list that may contain the following items, depending on input parameters:
stats: A one-row data frame with CSMP statistics
model_object: The fitted GAM
contour_plot: A ggplot object showing the shape of the fitted GAM
predict_df: data frame showing predicted values of the objective function for ref_airtemp, ref_precip, new_airtemp, and new_precip
plot_df: The data frame used to create contour_plot (same information as predict_df, but predicted over more points for plotting)
Adrienne M. Marshall
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.