scipyexponential-distributionfrozenset

Why is the Scipy instance of expon() returning type: <scipy.stats._distn_infrastructure.rv_frozen>


I am interested why the code below returns an instance type of rv_frozen when expon() is an instance of class expon_gen(rv_continuous) in the stats._continous_distns.py file.

Shouldn't it return type: <scipy.stats._distn_infrastructure.rv_continous>?

In [1]: from scipy.stats import expon

In [2]: type(expon())
Out[2]: scipy.stats._distn_infrastructure.rv_frozen


Solution

  • Calling a distribution instance (backets in expon()) freezes a distribution.

    Here freezing means fixing the values of the shape parameters. Trivial for expon, less so for e.g. gamma and such.