WeeklyFourier#
- class pymc_marketing.mmm.fourier.WeeklyFourier(**data)[source]#
Weekly fourier seasonality.
(
Source code
,png
,hires.png
,pdf
)- 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
WeeklyFourier.__init__
(**data)Create a new model by parsing and validating input data from keyword arguments.
WeeklyFourier.apply
(dayofperiod[, ...])Apply fourier seasonality to day of year.
WeeklyFourier.construct
([_fields_set])WeeklyFourier.copy
(*[, include, exclude, ...])Returns a copy of the model.
WeeklyFourier.dict
(*[, include, exclude, ...])WeeklyFourier.from_dict
(data)Deserialize the Fourier seasonality.
Get the start date for the Fourier curve.
WeeklyFourier.json
(*[, include, exclude, ...])WeeklyFourier.model_construct
([_fields_set])Creates a new instance of the
Model
class with validated data.WeeklyFourier.model_copy
(*[, update, deep])Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#model_copy
WeeklyFourier.model_dump
(*[, mode, include, ...])Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#modelmodel_dump
WeeklyFourier.model_dump_json
(*[, indent, ...])Usage docs: https://docs.pydantic.dev/2.10/concepts/serialization/#modelmodel_dump_json
WeeklyFourier.model_json_schema
([by_alias, ...])Generates a JSON schema for a model class.
Compute the class name for parametrizations of generic classes.
Model post initialization for a Pydantic model.
WeeklyFourier.model_rebuild
(*[, force, ...])Try to rebuild the pydantic-core schema for the model.
WeeklyFourier.model_validate
(obj, *[, ...])Validate a pydantic model instance.
WeeklyFourier.model_validate_json
(json_data, *)Usage docs: https://docs.pydantic.dev/2.10/concepts/json/#json-parsing
Validate the given object with string data against the Pydantic model.
WeeklyFourier.parse_file
(path, *[, ...])WeeklyFourier.parse_raw
(b, *[, ...])WeeklyFourier.plot_curve
(curve[, ...])Plot the seasonality for one full period.
WeeklyFourier.plot_curve_hdi
(curve[, ...])Plot full period of the fourier seasonality.
WeeklyFourier.plot_curve_samples
(curve[, n, ...])Plot samples from the curve.
WeeklyFourier.sample_curve
(parameters[, ...])Create full period of the Fourier seasonality.
WeeklyFourier.sample_prior
([coords])Sample the prior distributions.
WeeklyFourier.schema
([by_alias, ref_template])WeeklyFourier.schema_json
(*[, by_alias, ...])Serialize the prior distribution.
Serialize the Fourier seasonality.
WeeklyFourier.update_forward_refs
(**localns)WeeklyFourier.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