innovate.substitute.fisher_pry module

class innovate.substitute.fisher_pry.FisherPryModel[source]

Bases: DiffusionModel

Implementation of the Fisher-Pry model for technology substitution.

This model assumes that the substitution of a new technology for an old one follows a logistic growth curve. The model tracks the market share fraction of the new technology.

bounds(t: Sequence[float], y: Sequence[float]) Dict[str, tuple][source]

Returns bounds for the model parameters.

differential_equation(y, t, alpha, t0)[source]

The differential equation for the Fisher-Pry model.

fit(fitter, t: Sequence[float], y: Sequence[float], **kwargs)[source]

Fits the Fisher-Pry model to the data.

Note: The input y for the Fisher-Pry model should be the market share fraction (between 0 and 1) of the new technology.

initial_guesses(t: Sequence[float], y: Sequence[float]) Dict[str, float][source]

Provides initial guesses for the model parameters. - t0 is estimated as the time at which the market share is closest to 50%. - alpha is estimated from a linearization of the logistic function.

property param_names: Sequence[str]

alpha and t0.

Type:

Returns the names of the model parameters

property params_: Dict[str, float]

Returns a dictionary of fitted model parameters.

predict(t: Sequence[float]) Sequence[float][source]

Predicts the market share fraction of the new technology.

Parameters:

t – A sequence of time points.

Returns:

A sequence of predicted market share fractions (between 0 and 1).

predict_adoption_rate(t: Sequence[float]) Sequence[float][source]

Predicts the rate of change of market share.

This is the derivative of the logistic function, representing the speed of substitution.

score(t: Sequence[float], y: Sequence[float]) float[source]

Calculates the R^2 score for the model fit.