MonthlyFourier#

class pymc_marketing.mmm.fourier.MonthlyFourier(**data)[source]#

Monthly fourier seasonality.

(Source code, png, hires.png, pdf)

../../_images/pymc_marketing-mmm-fourier-MonthlyFourier-1.png
n_orderint

Number of fourier modes to use.

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)

namestr, optional

Name of the variable that multiplies the fourier modes, by default None

variable_namestr, optional

Name of the variable that multiplies the fourier modes, by default None

Methods

MonthlyFourier.__init__(**data)

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

MonthlyFourier.apply(dayofperiod[, ...])

Apply fourier seasonality to day of year.

MonthlyFourier.construct([_fields_set])

MonthlyFourier.copy(*[, include, exclude, ...])

Returns a copy of the model.

MonthlyFourier.dict(*[, include, exclude, ...])

MonthlyFourier.from_dict(data)

Deserialize the Fourier seasonality.

MonthlyFourier.from_orm(obj)

MonthlyFourier.get_default_start_date([...])

Get the start date for the Fourier curve.

MonthlyFourier.json(*[, include, exclude, ...])

MonthlyFourier.model_construct([_fields_set])

Creates a new instance of the Model class with validated data.

MonthlyFourier.model_copy(*[, update, deep])

Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#model_copy

MonthlyFourier.model_dump(*[, mode, ...])

Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#modelmodel_dump

MonthlyFourier.model_dump_json(*[, indent, ...])

Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#modelmodel_dump_json

MonthlyFourier.model_json_schema([by_alias, ...])

Generates a JSON schema for a model class.

MonthlyFourier.model_parametrized_name(params)

Compute the class name for parametrizations of generic classes.

MonthlyFourier.model_post_init(...)

Model post initialization for a Pydantic model.

MonthlyFourier.model_rebuild(*[, force, ...])

Try to rebuild the pydantic-core schema for the model.

MonthlyFourier.model_validate(obj, *[, ...])

Validate a pydantic model instance.

MonthlyFourier.model_validate_json(json_data, *)

Usage docs: https://docs.pydantic.dev/2.10/concepts/json/#json-parsing

MonthlyFourier.model_validate_strings(obj, *)

Validate the given object with string data against the Pydantic model.

MonthlyFourier.parse_file(path, *[, ...])

MonthlyFourier.parse_obj(obj)

MonthlyFourier.parse_raw(b, *[, ...])

MonthlyFourier.plot_curve(curve[, ...])

Plot the seasonality for one full period.

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

Plot full period of the fourier seasonality.

MonthlyFourier.plot_curve_samples(curve[, ...])

Plot samples from the curve.

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

Create full period of the Fourier seasonality.

MonthlyFourier.sample_prior([coords])

Sample the prior distributions.

MonthlyFourier.schema([by_alias, ref_template])

MonthlyFourier.schema_json(*[, by_alias, ...])

MonthlyFourier.serialize_prior()

Serialize the prior distribution.

MonthlyFourier.to_dict()

Serialize the Fourier seasonality.

MonthlyFourier.update_forward_refs(**localns)

MonthlyFourier.validate(value)

Attributes

model_computed_fields

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_extra

Get extra fields set during validation.

model_fields

model_fields_set

Returns the set of fields that have been explicitly set on this model instance.

nodes

Fourier node names for model coordinates.

days_in_period

n_order

prefix

prior

variable_name