YearlyFourier#

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

Yearly fourier seasonality.

(Source code)

n_orderint

Number of fourier modes to use.

prefixstr, optional

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

priorPrior, optional

Prior distribution 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

YearlyFourier.__init__(**data)

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

YearlyFourier.apply(dayofyear[, result_callback])

Apply fourier seasonality to day of year.

YearlyFourier.construct([_fields_set])

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

Returns a copy of the model.

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

YearlyFourier.from_orm(obj)

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

YearlyFourier.model_construct([_fields_set])

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

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

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

YearlyFourier.model_dump(*[, mode, include, ...])

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

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

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

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

Generates a JSON schema for a model class.

YearlyFourier.model_parametrized_name(params)

Compute the class name for parametrizations of generic classes.

YearlyFourier.model_post_init(...)

Model post initialization for a Pydantic model.

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

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

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

Validate a pydantic model instance.

YearlyFourier.model_validate_json(json_data, *)

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

YearlyFourier.model_validate_strings(obj, *)

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

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

YearlyFourier.parse_obj(obj)

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

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

Plot the seasonality for one full period.

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

Plot full period of the fourier seasonality.

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

Plot samples from the curve.

YearlyFourier.sample_curve(parameters)

Create full period of the fourier seasonality.

YearlyFourier.sample_prior([coords])

Sample the prior distributions.

YearlyFourier.schema([by_alias, ref_template])

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

YearlyFourier.serialize_prior()

Serialize the prior distribution.

YearlyFourier.update_forward_refs(**localns)

YearlyFourier.validate(value)

Attributes

model_computed_fields

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

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

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

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