What does 'frozen distribution' mean in Scipy?
Asked Answered
H

2

9

In the documentation of scipy, the 'frozen pdf', etc, is mentioned sometimes, but I don't know the meaning of it? Is it a statistical concept or scipy terminology? enter image description here

Halford answered 10/3, 2020 at 7:36 Comment(1)
with given/defined location , scale and others (if exist) parametersLotic
G
9

I agree that the docs are somewhat unclear on the issue. It seems that the frozen distribution fixes the first n moments for programmer's convenience. I am unaware of the term "forzen distribution" outside of SciPy.

SciPy's frozen distribution is perhaps best described here:

Passing the loc and scale keywords time and again can become quite bothersome. The concept of freezing a RV is used to solve such problems.

rv = gamma(1, scale=2.)

By using rv we no longer have to include the scale or the shape parameters anymore. Thus, distributions can be used in one of two ways, either by passing all distribution parameters to each method call (such as we did earlier) or by freezing the parameters for the instance of the distribution. Let us check this:

rv.mean(), rv.std() (2.0, 2.0)

This is, indeed, what we should get.

In the scipy tutorial page, we see the following line:

(We explain the meaning of a frozen distribution below).

The only mention of frozen distribution after that point is the following:

The main additional methods of the not frozen distribution are related to the estimation of distribution parameters:

fit: maximum likelihood estimation of distribution parameters, including location

    and scale

fit_loc_scale: estimation of location and scale when shape parameters are given

nnlf: negative log likelihood function

expect: calculate the expectation of a function against the pdf or pmf
Gibun answered 10/3, 2020 at 8:8 Comment(2)
All of the scipy.stats docs are "somewhat unclear", but yes, "frozen" is probably the high point.Elope
The link is broken.Dunkirk
L
0

In the book Haslwanter, T. (2016). An introduction to statistics with Python. With Applications in the Life Sciences; Springer International Publishing: Cham, Switzerland. In the page 99, the Author tell us:

"In the first step, you create the distribution (e.g., nd = stats.norm() ). Note that this is a distribution (in Python parlance a 'frozen distribution'), not a function yet!"

Then, a frozen distribution simply not is a function.

Lucania answered 15/9, 2023 at 23:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.