# Path: concept_formation/utils.py
# def c4(n):
#     """
#     Returns the correction factor to apply to unbias estimates of standard
#     deviation in low sample sizes. This implementation is based on a lookup
#     table for n in [2-29] and returns 1.0 for values >= 30.
# 
#     >>> c4(3)
#     0.886226925452758
#     """
#     if n <= 1:
#         raise ValueError("Cannot apply correction for a sample size of 1.")
#     else:
#         return c4n_table[n] if n < 30 else 1.0


from math import sqrt
from math import exp
from math import pi
from concept_formation.utils import c4
        :rtype: float
        """
        if scale <= 0:
            scale = 1
        return (self.mean - shift) / scale

    def biased_std(self):
        """
        Returns a biased estimate of the std (i.e., the sample std)

        :return: biased estimate of the std (i.e., the sample std)
        :rtype: float
        """
        return sqrt(self.meanSq / (self.num))

    def unbiased_std(self):
        """
        Returns an unbiased estimate of the std, but for n < 2 the std is
        estimated to be 0.0.

        This implementation uses Bessel's correction and Cochran's theorem:
        `<https://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation#Bias_correction>`_

        :return: an unbiased estimate of the std
        :rtype: float

        .. seealso:: :meth:`concept_formation.utils.c4`
        """
        if self.num < 2:
            return 0.0

# Path: concept_formation/utils.py
# def c4(n):
#     """
#     Returns the correction factor to apply to unbias estimates of standard
#     deviation in low sample sizes. This implementation is based on a lookup
#     table for n in [2-29] and returns 1.0 for values >= 30.
# 
#     >>> c4(3)
#     0.886226925452758
#     """
#     if n <= 1:
#         raise ValueError("Cannot apply correction for a sample size of 1.")
#     else:
#         return c4n_table[n] if n < 30 else 1.0


# Path: concept_formation/continuous_value.py
from math import sqrt
from math import exp
from math import pi
from concept_formation.utils import c4

        :rtype: float
        """
        if scale <= 0:
            scale = 1
        return (self.mean - shift) / scale

    def biased_std(self):
        """
        Returns a biased estimate of the std (i.e., the sample std)

        :return: biased estimate of the std (i.e., the sample std)
        :rtype: float
        """
        return sqrt(self.meanSq / (self.num))

    def unbiased_std(self):
        """
        Returns an unbiased estimate of the std, but for n < 2 the std is
        estimated to be 0.0.

        This implementation uses Bessel's correction and Cochran's theorem:
        `<https://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation#Bias_correction>`_

        :return: an unbiased estimate of the std
        :rtype: float

        .. seealso:: :meth:`concept_formation.utils.c4`
        """
        if self.num < 2:
            return 0.0

        return sqrt(self.meanSq / (self.num - 1)) / c4(self.num)