FourierBase#
- class pymc_marketing.mmm.fourier.FourierBase(**data)[source]#
Base class for Fourier seasonality transformations.
- Parameters:
- n_order
int
Number of fourier modes to use.
- days_in_period
float
Number of days in a period.
- prefix
str
, optional Alternative prefix for the fourier seasonality, by default None or “fourier”
- prior
Prior
|VariableFactory
, optional Prior distribution or VariableFactory for the fourier seasonality beta parameters, by default
Prior("Laplace", mu=0, b=1)
- variable_name
str
, optional Name of the variable that multiplies the fourier modes. By default None, in which case it is set to the
{prefix}_beta
.
- n_order
Methods
FourierBase.__init__
(**data)Create a new model by parsing and validating input data from keyword arguments.
FourierBase.apply
(dayofperiod[, result_callback])Apply fourier seasonality to day of year.
FourierBase.construct
([_fields_set])FourierBase.copy
(*[, include, exclude, ...])Returns a copy of the model.
FourierBase.dict
(*[, include, exclude, ...])FourierBase.from_dict
(data)Deserialize the Fourier seasonality.
FourierBase.from_orm
(obj)FourierBase.get_default_start_date
([start_date])Get the start date for the Fourier curve.
FourierBase.json
(*[, include, exclude, ...])FourierBase.model_construct
([_fields_set])Creates a new instance of the
Model
class with validated data.FourierBase.model_copy
(*[, update, deep])!!! abstract "Usage Documentation"
FourierBase.model_dump
(*[, mode, include, ...])!!! abstract "Usage Documentation"
FourierBase.model_dump_json
(*[, indent, ...])!!! abstract "Usage Documentation"
FourierBase.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.
FourierBase.model_rebuild
(*[, force, ...])Try to rebuild the pydantic-core schema for the model.
FourierBase.model_validate
(obj, *[, strict, ...])Validate a pydantic model instance.
FourierBase.model_validate_json
(json_data, *)!!! abstract "Usage Documentation"
FourierBase.model_validate_strings
(obj, *[, ...])Validate the given object with string data against the Pydantic model.
FourierBase.parse_file
(path, *[, ...])FourierBase.parse_raw
(b, *[, content_type, ...])FourierBase.plot_curve
(curve[, ...])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.schema
([by_alias, ref_template])FourierBase.schema_json
(*[, by_alias, ...])Serialize the prior distribution.
Serialize the Fourier seasonality.
FourierBase.update_forward_refs
(**localns)FourierBase.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.
n_order
days_in_period
prefix
prior
variable_name