pyuncertainnumber.calibration.pdfs ================================== .. py:module:: pyuncertainnumber.calibration.pdfs .. autoapi-nested-parse:: @author: Mukesh K. Ramancha A collection of common probability distributions Classes ------- .. autoapisummary:: pyuncertainnumber.calibration.pdfs.ProbabilityDensityFun pyuncertainnumber.calibration.pdfs.Uniform pyuncertainnumber.calibration.pdfs.HalfNormal pyuncertainnumber.calibration.pdfs.Normal pyuncertainnumber.calibration.pdfs.TruncatedNormal pyuncertainnumber.calibration.pdfs.MultivariateNormal Module Contents --------------- .. py:class:: ProbabilityDensityFun Bases: :py:obj:`abc.ABC` Blueprint for other classes. Base class. Abstract class is not a concrete class, it cannot be instantiated .. py:method:: generate_rns(N) :abstractmethod: Method to generate 'N' random numbers :param N: number of random numbers needed. :type N: int :rtype: numpy array of size N .. py:method:: log_pdf_eval(x) :abstractmethod: Method to compute log of the pdf at x :param x: value where to evalute the pdf. :type x: float :rtype: float - log of pdf evaluated at x. .. py:class:: Uniform(lower=0, upper=1) Bases: :py:obj:`ProbabilityDensityFun` Uniform continuous distribution .. py:attribute:: lower :value: 0 .. py:attribute:: upper :value: 1 .. py:method:: generate_rns(N) Method to generate 'N' random numbers :param N: number of random numbers needed. :type N: int :rtype: numpy array of size N .. py:method:: log_pdf_eval(x) Method to compute log of the pdf at x :param x: value where to evalute the pdf. :type x: float :rtype: float - log of pdf evaluated at x. .. py:class:: HalfNormal(sig=1) Bases: :py:obj:`ProbabilityDensityFun` Half Normal distribution with zero mean .. py:attribute:: sig :value: 1 .. py:method:: generate_rns(N) Method to generate 'N' random numbers :param N: number of random numbers needed. :type N: int :rtype: numpy array of size N .. py:method:: log_pdf_eval(x) Method to compute log of the pdf at x :param x: value where to evalute the pdf. :type x: float :rtype: float - log of pdf evaluated at x. .. py:class:: Normal(mu=0, sig=1) Bases: :py:obj:`ProbabilityDensityFun` Normal distribution .. py:attribute:: mu :value: 0 .. py:attribute:: sig :value: 1 .. py:method:: generate_rns(N) Method to generate 'N' random numbers :param N: number of random numbers needed. :type N: int :rtype: numpy array of size N .. py:method:: log_pdf_eval(x) Method to compute log of the pdf at x :param x: value where to evalute the pdf. :type x: float :rtype: float - log of pdf evaluated at x. .. py:class:: TruncatedNormal(mu=0, sig=1, low=-np.Inf, up=np.Inf) Bases: :py:obj:`ProbabilityDensityFun` Truncated Normal distribution .. py:attribute:: mu :value: 0 .. py:attribute:: sig :value: 1 .. py:attribute:: low .. py:attribute:: up .. py:method:: generate_rns(N) Method to generate 'N' random numbers :param N: number of random numbers needed. :type N: int :rtype: numpy array of size N .. py:method:: log_pdf_eval(x) Method to compute log of the pdf at x :param x: value where to evalute the pdf. :type x: float :rtype: float - log of pdf evaluated at x. .. py:class:: MultivariateNormal(mu=np.zeros(2), E=np.identity(2)) Bases: :py:obj:`ProbabilityDensityFun` Multivariate Normal distribution .. py:attribute:: mu .. py:attribute:: E .. py:attribute:: d .. py:attribute:: logdetE .. py:attribute:: Einv .. py:method:: generate_rns(N) Method to generate 'N' random numbers :param N: number of random numbers needed. :type N: int :rtype: numpy array of size N .. py:method:: log_pdf_eval(x) Method to compute log of the pdf at x :param x: value where to evalute the pdf. :type x: float :rtype: float - log of pdf evaluated at x.