cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

More than 9 parameters in genfit

tfetter
6-Contributor

More than 9 parameters in genfit

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

2 REPLIES 2
Werner_E
24-Ruby IV
(To:tfetter)


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

 

tfetter
6-Contributor
(To:Werner_E)

Yes - that makes perfect sense once you see the form

 

Thanks so much!

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."