Hello,
Running your code I noticed first that your chi2 function does not depend on the parameters. It returns always the same value, 7003.212. For example when p0 = 2. I get:
2 2.2 2.3 2 3
Theory: -0.0387504
Esti: 0.0387504
EstiE: 0.00254024
chi2: 232.705
chi2: 7003.23
for p0 = 2.2 I get again the same:
2.2 2.2 2.3 2 3
Theory: -0.0387504
Esti: 0.0387504
EstiE: 0.00254024
chi2: 232.705
chi2: 7003.23
Minuit cannot work if the function does not depend on the parameters.
Second I noticed that you are calling two times migrad, by doing :
MnMigrad migrad(nmfcn,upar);
migrad();
FunctionMinimum min = migrad();
you should just do:
MnMigrad migrad(nmfcn,upar);
FunctionMinimum min = migrad();
The Nan are cause by doing this, since in the first minimization the
returned gradient are zero due to the fact that the function does not
depend on the
parameters.
Best Regards
Lorenzo
On Aug 10, 2009, at 8:03 AM, vicky mangat wrote:
>
>
> HI all
> I was trying to minimize a user define function by using Miniut
> in root. But i am facing problem that after a few iterations me
> parameter become nan and then same with calculated value of
> function. To avoid this i put a condition on function that return
> value when function is not equal to nan by doing this function is
> showing some junk values and chi2 become inf. Can some one tell me
> but is problem. I have attached header files main function file and
> data file. You can run it and see the problem.
> Thankx
>
> Varinderjit Singh
> Research Scholar
> Dept. of Physics
> Panjab University
> Chandigarh
> 09914100789
>
> Yahoo! recommends that you upgrade to the new and safer Internet
> Explorer 8.
>
> Looking for local information? Find it on Yahoo!
> Local<DemoNMSim.C><NeutronMultiFcn.h><NeutronMulti.h><F7.dat>
Received on Mon Aug 10 2009 - 12:41:40 CEST
This archive was generated by hypermail 2.2.0 : Mon Aug 10 2009 - 17:50:02 CEST