Decompose a seasonal stress-lag prediction

Description

Reports additive contributions in the response unit. Contributions are centered at training feature means and reproduce the model prediction. They are statistical components, not causal effects or measured crop losses.

Usage

explain_crop_prediction(object, newdata, use_ar = TRUE)

Arguments

object

A 'crop_yield_model' fitted with method 'stress_lag'.

newdata

Prediction panel or a 'crop_yield_data' object.

use_ar

Include the residual AR(1) correction.

Value

A data frame with region/year, intercept, trend, regional effects, linear anomalies, upper/lower anomaly tails, compound hot-dry effects, residual correction, and their sum ('Prediction').

Examples

data <- synthetic_crop_example()
model <- fit_crop_model(data, "stress_lag", robust = FALSE)
explain_crop_prediction(model, subset(data$panel, Year == 2016))

[Package yieldlag version 0.3.0 ]