Questions tagged [zfit]

The tag has no usage guidance, but it has a tag wiki.

Filter by
Sorted by
Tagged with
1 vote
1 answer
24 views

Problems creating a customized pdf; asymmetric gaussian

In order to create a customized pdf in zfit; Skew normal distribution (asymmetric gaussian), how can be called the error function? Seems that math.erf(x) and scipy.special.erf(x) do not works (they ...
Jordan C. Correa's user avatar
-1 votes
1 answer
16 views

zfit ConvPDF for small kernel uses a lot of memory

I'm using the zfit FFTConvPDFV1 object and experience that for a lot smaller kernel (space-) limits, the memory consumption rises extremely. In my case, I'm using a DoubleCB PDF with floating ...
Mayou36's user avatar
  • 4,633
0 votes
1 answer
20 views

How can I obtain sWeights with zfit?

I have a fit to the signal region using zfit and fitting with an ExtendedUnbinnedNLL. My models are a signal and a background PDF. How can I obtain the sWeights for background subtraction? I had a ...
Mayou36's user avatar
  • 4,633
0 votes
0 answers
36 views

Landau function in Zfit

I would like to try to fit a dataset with the sum of two landaus by using Zfit. From what I see, the Landau function is not within the default PDFs, so I am trying to implement it as a custom PDF. My ...
aleolomorfo's user avatar
1 vote
1 answer
39 views

Error estimation of maximum likelihood fit in zfit with weight

I am looking at the zfit tutorial, and seeing the comment about the likelihood with weight, (see attached image) does anyone know if how the uncertainty is estimated in this case. How would the ...
peilian's user avatar
  • 11
0 votes
1 answer
25 views

"TypeError: compute_integral() got multiple values for argument 'limits'" using register_analytic_integral

I defined my own ZFit pdf using something like: class AngularPDFWithAcceptance(zfit.pdf.BasePDF): def __init__(self, ctl_name, ctk_name, phi_name, params, name): from math import pi ...
Wouter Hulsbergen's user avatar
1 vote
1 answer
82 views

zfit hesse function error: "RuntimeWarning: Exception occurred, parameter values are not reset and in an arbitrary, last used state."

When playing with zfit tutorial, I just tried to remove the floating option of the alpha_sig parameter. In other words, I changed alpha_sig = zfit.Parameter('alpha_sig', 200, 100, 400, floating=False) ...
gtateno's user avatar
  • 11
1 vote
1 answer
152 views

Exclude/Ignore data region in polynomial fit (zfit)

I wanted to know if there's a way to exclude one or more data regions in a polynomial fit. Currently this doesn't seem to work as I would expect. Here a small example: import numpy as np import pandas ...
lweid's user avatar
  • 13
1 vote
1 answer
115 views

How can I convert a histogram (2D) into 2 pdf in zfit?

I am trying to do some 2d spectra fitting with the help of zfit. The pdf I want to use comes from ROOT TH2D. Is there any method to convert the input Th2D into a 2D pdf directly in zfit? Thanks a lot!
YMTheory's user avatar
2 votes
1 answer
171 views

Pull plot from toys in zFit

First of all I would like to say that I do have conceptual difficulties with this topic, so please correct me if my intention does not make sense. I'm trying to validate the model that I use to ...
holyschmoly's user avatar
0 votes
1 answer
153 views

zfit straight line fitting for 2 dim dataset

I would like to fit 2-dim plot by straight line (a*x+b) using zfit like the following figure. That is very easy work by a probfit package, but it has been deprecated by scikit-hep. https://nbviewer....
Keita Mizukoshi's user avatar
2 votes
1 answer
86 views

Import dataset from a ROOT file with cut using zfit

I am trying to perform a fit to a tree. But I need to add some cut to the branches which are not the observables of the fit. Website https://zfit.readthedocs.io/en/latest/getting_started/intro/data....
Xuelong's user avatar
  • 21
1 vote
1 answer
158 views

PDF from a histogram in zfit?

I looking in the documentation how to obtain a PDF from a histogram, but I couldn't find anything, so how can I obtain PDF from a histogram ?, for example to use it in a sum_pdf = zfit.pdf.SumPDF([...
Marchela04's user avatar
2 votes
2 answers
293 views

Use of data with negative weights in unbinned maximum likelihood fit in zfit

I am trying to perform an unbinned 3D angular fit in zfit, where the input data is a sample with per-event sWeights assigned from a separate invariant mass peak fit. I think I'm running into issues of ...
dhill89's user avatar
  • 61
1 vote
1 answer
139 views

Constrain on parameters for Negative Log Likelihood Minimization

I am trying to fit a 5 parameter (a, b, c, d, e) model, where one of the parameters is constrained by another, let's say, 0< d < 1 e < |d| I am currently using zfit which as far as I know, ...
Horace's user avatar
  • 62
1 vote
1 answer
557 views

Why is __future__.annotations (PEP 563) not backported to python3.6?

Does anyone know why PEP 563 is not backported to python36 as of the time of this writing? Are there any plans to do that or is it even possible? I am asking because I could use it for the codebase of ...
SebastianJL's user avatar
1 vote
1 answer
37 views

Accessing PDF variables when registering analytic integral

Firstly, thank you for making a really neat, pythonic tool which can be used as an alternative for RooFit. I have successfully defined a custom 2D PDF but I am not completely sure on how to register ...
Colm  Murphy's user avatar
2 votes
1 answer
111 views

Is there way to extend predefined polynomial pdf in zfit?

​I'm trying to perform a fit with extended Chebyshev pdf. To do so I use predefined zfit.pdf.Chebyshev(). What do I miss here? import tensorflow as tf import zfit from zfit import ztf obs = zfit....
serhiiC's user avatar
  • 23
2 votes
1 answer
111 views

Multiple limits in fitting and toy generation in zfit

I have a running model with a pdf in zfit from where I want to generate toys from and after also fit the pdf to the toys. However I was wondering how to exclude certain areas in the toy generation as ...
Dovahkinsl's user avatar
0 votes
1 answer
136 views

How can I fix a parameter on creation in zfit?

I want to perform several fits with multiple parameters, some of the which are fixed in the first fit. How can I define a parameter that is not floating and how to change that? Creating without limits ...
Mayou36's user avatar
  • 4,633