SoftPlusHSGPTerm#
- class pymc_marketing.terms_gp.SoftPlusHSGPTerm(*, var_name='date', name='tvp', X_mid=None, dims=None, demeaned_basis=False, time_resolution=None, eta=None, ls=None, m=None, L=None, centered=False, drop_first=True, eta_mass=0.05, eta_upper=1.0, ls_lower=1.0, ls_upper=None, ls_mass=0.9, cov_func=CovFunc.ExpQuad)[source]#
HSGP term with softplus transformation and mean-one centering.
Maps the latent GP to strictly positive values and normalizes multiplicatively by the time-mean, so the resulting multiplier has mean one over the time dimension while remaining strictly positive. This is the canonical time-varying multiplier for media effects, matching the time-varying parameters of the stable MMM classes.
The output broadcasts across a media term’s channel dimension through
*:tvp_media = SoftPlusHSGPTerm() * media
For out-of-sample prediction with
pymc_marketing.model_graph.deterministics_to_flat(), the{name}_f_meandeterministic is the one to replace:SoftPlusHSGPTerm.deterministics_to_replace("tvp") # ['tvp_f_mean']
Methods
SoftPlusHSGPTerm.__init__(*[, var_name, ...])Resolve deferred values.
Build the GP curve through the wrapped HSGP class.
Deterministics to replace with
pm.Flatfor out-of-sample.Reconstruct a term from its serialized form.
Collect coordinates from the time reference and extra dims.
SoftPlusHSGPTerm.named(name[, dims])Record this expression as a named deterministic model variable.
Register the numeric time index as
pmd.Dataand freezeX_mid.SoftPlusHSGPTerm.set_data(ds[, model])Update the shared time index for out-of-sample prediction.
SoftPlusHSGPTerm.sum(dim)Sum this expression over one named dimension.
SoftPlusHSGPTerm.to_dict([_orig])Attributes
Dataset variables this term reads as shared data.
Dims beyond the time dimension.
Deterministic to freeze for out-of-sample evaluation.
Name of this term's registered numeric index data variable.