GPDataTerm#

class pymc_marketing.terms_gp.GPDataTerm(*, var_name='date', name='hsgp', X_mid=None, dims=None, demeaned_basis=False, time_resolution=None)[source]#

Shared data lifecycle for GP terms.

Resolves the time reference var_name to a numeric index, registers it as pmd.Data, freezes the centering value (X_mid) at the first registration, and collects coordinates for the time dimension and any extra coefficient dims.

var_name names the time reference in the dataset and is read with ds[var_name], which works for both coordinates and data variables. The numeric index is always registered as pmd.Data under {name}_index; use index_var for that name.

Methods

GPDataTerm.__init__(*[, var_name, name, ...])

GPDataTerm.add_coords(ds)

Add coordinates to the model during register_data.

GPDataTerm.create_variable()

Build the GP curve through the wrapped HSGP class.

GPDataTerm.get_coords(ds)

Collect coordinates from the time reference and extra dims.

GPDataTerm.named(name[, dims])

Record this expression as a named deterministic model variable.

GPDataTerm.register_data(ds)

Register the numeric time index as pmd.Data and freeze X_mid.

GPDataTerm.set_data(ds[, model])

Update the shared time index for out-of-sample prediction.

GPDataTerm.sum(dim)

Sum this expression over one named dimension.

Attributes