def ppf( self, x ):
     self.check()
     if len( self.cdf_values ) != 0:
         xx, cdf = self.x_values, self.cdf_values
     else:
         xx, cdf = self.x_values, self.cdf( self.x_values )
     ppf_mfn_line = MFnLineArray( xdata = cdf, ydata = xx )
     return ppf_mfn_line.get_values( x )
예제 #2
0
 def ppf( self, x ):
     self.check()
     if len( self.cdf_values ) != 0:
         xx, cdf = self.x_values, self.cdf_values
     else:
         xx, cdf = self.x_values, self.cdf( self.x_values )
     ppf_mfn_line = MFnLineArray( xdata = cdf, ydata = xx )
     return ppf_mfn_line.get_values( x )
예제 #3
0
    def _get_pdf_array( self ):

        # get the normed histogram implemented in the base class YMBHist
        h, b = self.normed_hist
        b_cen = ( b[1:] + b[:-1] ) / 2.
        mask = ( h != 0. )
        h = h[mask]
        b_cen = b_cen[mask]
        b = hstack( [min( b ), b_cen, max( b )] )
        h = hstack( [0, h, 0] )
        h = h / trapz( h, b )
        p = MFnLineArray( xdata=b, ydata=h )
        return p.get_values( self.x_array )