0
$\begingroup$

I am writing a function to standardize the data and I found out that we can choose either ddof = 0 or ddof = 1, so I got confused that which one to choose and why? Does this make any difference?

$\endgroup$

1 Answer 1

0
$\begingroup$

ddof represents the degrees of freedom adjustment when you subtract from N in the standard deviation formula below. So I suggest that if you are working with a sample from a population, and you want an unbiased estimate then you use ddof=1. If you want to consider it as a population you can use ddof=0.

$$ S= \sqrt{ \dfrac{1}{N-1}\sum_{i=1}^N \bigg( X_i-\bar X \bigg)^2 } $$

$\endgroup$
3
  • $\begingroup$ In addition to @Ralph's answer, usually the choice of DDOF does not make much impact since 1) the difference is small for large N; and 2) it is just a scaling to feature which (AFAIK) every models can cope with. $\endgroup$
    – lpounng
    May 24, 2022 at 4:26
  • $\begingroup$ Amazingly, the square root of that unbiased estimator of variance is a biased estimator of standard deviation. $\endgroup$
    – Dave
    May 24, 2022 at 10:11
  • $\begingroup$ I had never heard of the term Delta Degrees of freedom, but had to look it up. Not a statistical term $\endgroup$ May 24, 2022 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.