Questions tagged [iminuit]

Interactive IPython Friendly Mimizer based on SEAL Minuit

20 questions
7
votes
1 answer

PyMinuit vs IMinuit

I was looking for a minuit equivalent on Python 2.7 and I found this two variants: PyMinuit and iMinuit. My question is: what's the difference between them? Both uses Seal 1.7.9 Minuit and in a few 2D Gaussian fit tests that I had both brought the…
pekapa
  • 881
  • 1
  • 11
  • 25
6
votes
1 answer

"print_level =-1" doesn't remove all messages

I am succeding fiiting a function with iminuit in python but I can't get rid of the message even with "print_level =-1" or "print_level =0". Here is the minimalist code I use: from iminuit import Minuit m = Minuit(chi2, alpha=1., beta=0.,…
londumas
  • 83
  • 5
1
vote
0 answers

Specify (multi)parameter limits with iminuit

I have tried to set limits on parameters using iminuit with the example code: import iminuit def func(x,y): fun = 2*x**2 + 3*y + 5 return fun m = iminuit.Minuit(func, x=1, y=1, limit_x=(0,100), limit_y=(0,50)) What I get is the error…
Marcos
  • 57
  • 5
1
vote
1 answer

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, uses iMinuit I have only created the zfit.Parameters and put…
Horace
  • 62
  • 4
1
vote
0 answers

Minuit doesn't fit curve

I'm trying to fit a curve using minuit but it appears that the data are not fitted correctly to the curve. I suspect that it has something to do with the log in the function since once I remove the chiaf from chisquare function the values are fitted…
Linus
  • 147
  • 4
  • 15
1
vote
1 answer

solve an n-dimensional optimisation problem using iminuit

I woul like to solve an n-dimensional optimisation problem using iminuit. So my approach is the following. I am trying to figure out how to extend this: def f(x,y,z): return (x-1.)**2 + (y-2*x)**2 + (z-3.*x)**2 -1. to a variable "x" that is a…
davrandom
  • 21
  • 9
0
votes
0 answers

iminuit high-dimension multivariate fit problem

I would like to perform multivariate fit using iminuit. Everything works fine when I use two dimensions but I get an 'ValueError: too many values to unpack (expected 2)' if I use more than two dimensions. Below is the working code for 2D fit: from…
0
votes
0 answers

Get intermediate parameter values when minimizing with iminuit

When minimizing a function using iminuit: m = Minuit(func, alpha=1, beta=1) m.errordef = 1.0 m = m.migrad() I can get the final parameter values like so: final_alpha, final_beta = m.values["alpha"], m.values["beta"] I would like to plot the path…
Jakob Harteg
  • 9,587
  • 15
  • 56
  • 78
0
votes
0 answers

minuit m.migrad fitting fails

I am trying to fit a gaussian peak + linear background shape to a histogram. The histogram shape is pretty distinct and the fitting with minuit still fails sometimes. I cannot figure out why since it works most of the time with similar histograms…
Sara S
  • 101
  • 1
  • 4
0
votes
0 answers

iminuit: minimization in a parameter range. Problem

I am using iminuit for the minimization of a function. I wanted to explore only a parameter range, and also, the ranges of one of my variables depend on the other. For example, if the function to minimize is "my_function", and the two parameters are…
Manu Saez
  • 1
  • 1
0
votes
1 answer

how to set one fitting parameter larger than the other as constraints in iminuit in python?

I have two related fitting parameters. They have the same fitting range. Let's call them r1 and r2. I know I can limit the fitting range using minuit.limits, but I have an additional criteria that r2 has to be smaller than r1, can I do that in…
poon_h
  • 1
0
votes
2 answers

divide by zero encountered in true_divide error without having zeros in my data

this is my code and this is my data, and this is the output of the code. I've tried adding one the values on the x axes, thinking maybe values so little can be interpreted as zeros. I've no idea what true_divide could be, and I cannot explain this…
Lorenzo
  • 3
  • 3
0
votes
1 answer

Different output with equal input for python program when using iminuit: undefined behavior?

I encountered this wiered bugs that the iminuit cannot converge on a naive linear model. However, the real problem is, if I uncomment the line "#bins = np.linspace(0,4,25)", the result of the program is different, and it can converge. If "same…
Ding Xuefeng
  • 1
  • 1
  • 3
0
votes
0 answers

Investigating memory leak while using TMinuit ROOT with valgrind

I am using TMinuit in a loop for scanning some upper limit maps and I am running into a memory problem. The only thing which is created within the loop is the TMinuit object using "TMinuit * minuit = new TMinuit(n_params);". This is deleted at the…
0
votes
1 answer

Constraints on fitting parameters in iminuit?

I’ve been trying to fit some parameters to a curve but I need to put a constraint on one of the constants and I don’t know how to make my code acknowledge the constraints and fit a value with the correct value. I’ll try to write a simple example…
Linus
  • 147
  • 4
  • 15
1
2