SensitivityAnalysis.run_sweep#
- SensitivityAnalysis.run_sweep(var_input, sweep_values, *, var_names='channel_contribution', sweep_type='multiplicative', posterior_sample_fraction=1.0, response_mask=None, extend_idata=False, **kwargs)[source]#
Run sweeps by forward-evaluating the response graph (no Jacobian).
- Parameters:
- var_input
str Name of the pm.Data variable (e.g., “channel_data”). Expected shape: (date, *dims, arbitrary_dim) that match var_input dims.
- sweep_values
np.ndarray Values to sweep over.
- var_names
str The deterministic variable of interest.
- sweep_type{“multiplicative”,”additive”,”absolute”}
Type of sweep to apply.
- posterior_sample_fraction
float Posterior sampling control in (0, 1]. The retained fraction of draws is roughly
posterior_sample_fraction ** 2(e.g., 0.1 keeps about 1% of the draws, while 1.0 keeps the full posterior).- response_mask
xr.DataArray|np.ndarray|None Optional boolean mask with the same non-sample dims as
var_names. When provided, the mask zeroes out the response prior to evaluating the sweeps. Useful for focusing on specific coordinates of the deterministic response (e.g., single channels).
- var_input
- Returns:
xarray.DataArray|NoneIf extend_idata is False, returns an xarray.DataArray with shape (sample, sweep, *dims_order), where
dims_orderare the non-date dims ofvar_inputin the same order as in the model. The response is averaged over thedateaxis as in the draft example. If extend_idata is True, stores the result underidata.sensitivity_analysisand returns None.