TransferFunctionARRegression.priors_from_data#

TransferFunctionARRegression.priors_from_data(X, y)[source]#

Generate data-informed priors including AR(1) coefficient.

Similar to TransferFunctionLinearRegression but also includes a prior for the AR(1) coefficient rho.

Parameters:
  • X (xr.DataArray) – Baseline design matrix.

  • y (xr.DataArray) – Outcome variable.

Returns:

Dictionary with Prior objects for beta, theta_treatment, sigma, and rho.

Return type:

Dict[str, Prior]

Notes

The returned dictionary contains Prior objects with the following structure:

{
    "beta": Prior(
        "Normal", mu=0, sigma=5 * y_scale, dims=["treated_units", "coeffs"]
    ),
    "theta_treatment": Prior(
        "Normal",
        mu=0,
        sigma=2 * y_scale,
        dims=["treated_units", "treatment_names"],
    ),
    "sigma": Prior("HalfNormal", sigma=2 * y_scale, dims=["treated_units"]),
    "rho": Prior(
        "Uniform", lower=-0.99, upper=0.99, dims=["treated_units"]
    ),
}

where y_scale = std(y).