Skip to main content
10-Marble
December 10, 2021
Question

More than 9 parameters in genfit

  • December 10, 2021
  • 1 reply
  • 1336 views

I would like to use genfit to fit a function with more than 9 parameters, and its not clear to me how to do that. 

 

The web description page for genfit says:

 
• vx, vy are vectors of real data values of the same length, corresponding to the x and y values in the data set. There must be at least as many data points as parameters.
• vg is an n element vector of guess values for the parameters. If n = 1, then vg is a scalar.
F(x, u) is a fitting function, or a vector of functions, where x is the independent variable and u is either a vector of parameters or individual parameter names. The following equation is both a valid representation for a fitting function:

• n is a positive integer. In the case of non-vectorized parameters, there is a limit of nine individual names.

 

For 9 or fewer parameters, just including the parameters in the fitting function definition as F(x, u1,u2,u3,...):= works fine.  But assigning the parameter names to a vector when there are more than 9 and using that vector name in the fitting function definition as F(x, params) where params is a vector of u1,u2,u3,... does not work. 

 

Does anyone have an expample of setting up genfit for a function with more than 9 parameters?

 

Thanks

1 reply

25-Diamond I
December 10, 2021

But assigning the parameter names to a vector when there are more than 9 and using that vector name in the fitting function definition as F(x, params) where params is a vector of u1,u2,u3,... does not work. 

That seems to be the cause for your attempts failing. If you use a vector params, you have to use params[0, params]1 etc. in the function definition.

 

Here is a quick example with 11 parameters:

Werner_E_2-1639174605702.png

 

tfetter10-MarbleAuthor
10-Marble
December 10, 2021

Yes - that makes perfect sense once you see the form

 

Thanks so much!