FourierBase#

pydantic model pymc_marketing.mmm.fourier.FourierBase[source]#

Base class for Fourier seasonality transformations.

Parameters:
n_orderint

Number of fourier modes to use.

days_in_periodfloat

Number of days in a period.

prefixstr, optional

Alternative prefix for the fourier seasonality, by default None or “fourier”

priorPrior | VariableFactory, optional

Prior distribution or VariableFactory for the fourier seasonality beta parameters, by default Prior("Laplace", mu=0, b=1)

variable_namestr, optional

Name of the variable that multiplies the fourier modes. By default None, in which case it is set to the {prefix}_beta.

Methods

FourierBase.__init__(**data)

Create a new model by parsing and validating input data from keyword arguments.

FourierBase.apply(dayofperiod[, sum])

Apply fourier seasonality to day of year.

FourierBase.from_dict(data)

Deserialize the Fourier seasonality.

FourierBase.get_default_start_date([start_date])

Get the start date for the Fourier curve.

FourierBase.plot_curve(curve[, n_samples, ...])

Plot the seasonality for one full period.

FourierBase.plot_curve_hdi(curve[, ...])

Plot full period of the fourier seasonality.

FourierBase.plot_curve_samples(curve[, n, ...])

Plot samples from the curve.

FourierBase.sample_curve(parameters[, ...])

Create full period of the Fourier seasonality.

FourierBase.sample_prior([coords])

Sample the prior distributions.

FourierBase.serialize_prior()

Serialize the prior distribution.

FourierBase.to_dict()

Serialize the Fourier seasonality.

field days_in_period: float [Required][source]#
Constraints:
  • gt = 0

field n_order: int [Required][source]#
Constraints:
  • gt = 0

field prefix: str = 'fourier'[source]#
field prior: Annotated[Prior, InstanceOf()] | Annotated[VariableFactory, InstanceOf()] = Prior("Laplace", mu=0, b=1)[source]#
field variable_name: str | None = None[source]#