Esempio n. 1
0
    def _pdf(self, x, norm_range=False):
        x = x.unstack_x()
        mu = self.params['mu']
        sigma = self.params['sigma']

        return z.exp((-(x - mu) ** 2) / (
            2 * sigma ** 2))  # non-normalized gaussian
Esempio n. 2
0
        def _unnormalized_pdf(self, x):
            x = x.unstack_x()
            mu = self.params['mu']
            sigma = self.params['sigma']

            from zfit import z
            return z.exp(
                (-(x - mu)**2) / (2 * sigma**2))  # non-normalized gaussian
Esempio n. 3
0
File: basic.py Progetto: tgag17/zfit
 def _unnormalized_pdf(self, x):
     lambda_ = self.params['lambda']
     x = x.unstack_x()
     probs = z.exp(lambda_ * (self._shift_x(x)))
     tf.debugging.assert_all_finite(probs, f"Exponential PDF {self} has non valid values. This is likely caused"
                                           f" by numerical problems: if the exponential is too steep, this will"
                                           f" yield NaNs or infs. Make sure that your lambda is small enough and/or"
                                           f" the initial space is in the same"
                                           f" region as your data (and norm_range, if explicitly set differently)."
                                           f" If this issue still persists, please oben an issue on Github:"
                                           f" https://github.com/zfit/zfit")
     return probs  # Don't use exp! will overflow.
Esempio n. 4
0
 def _numerics_shifted_exp(self, x, lambda_):  # needed due to overflow in exp otherwise, prevents by shift
     return z.exp(lambda_ * (x - self._numerics_data_shift))
Esempio n. 5
0
    def _unnormalized_pdf(self, x):  # implement function
        data = z.unstack_x(x)
        alpha = self.params['alpha']

        return z.exp(alpha * data)
Esempio n. 6
0
 def raw_integral(x):
     return (z.exp(lambd * (model._shift_x(x))) / lambd
             )  # needed due to overflow in exp otherwise
Esempio n. 7
0
    def _unnormalized_pdf(self, x):
        x = x.unstack_x()
        mu = self.params["mu"]
        sigma = self.params["sigma"]

        return z.exp((-((x - mu) ** 2)) / (2 * sigma**2))  # non-normalized gaussian
Esempio n. 8
0
 def _func(self, x):
     mu = self.params['mu']
     sigma = self.params['sigma']
     x = z.unstack_x(x)
     return z.exp(-z.square((x - mu) / sigma))
Esempio n. 9
0
 def _unnormalized_pdf(self, x):
     mu = self.params['mu']
     sigma = self.params['sigma']
     x = z.unstack_x(x)
     return z.exp(-z.square((x - mu) / sigma))
Esempio n. 10
0
 def _func(self, x):
     mu = self.params["mu"]
     sigma = self.params["sigma"]
     x = z.unstack_x(x)
     return z.exp(-z.square((x - mu) / sigma))