-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
matrixfit with 'lm' and 'optim' have different chi^2 #179
Comments
Just to quantify things: |
Note that in the |
Note that in the ```optim``` case, the resulting chi^2 compares very
well to the chi^2 of the corresponding effective mass fit with
covariance.
I have observed such an effect from time to time, but usually the
other way around. But, I think, this is worth exploring since a lot in
hadron changed.
|
I tried this out for several examples without covariance and there |
Would it be too much effort (or impossible) to try this with covariance on the data that you tested with? |
I tested with real data, for which I don't have the covariance. Of course I could simply use a random covarinace matrix. Do you think this is worth trying? |
If you have real data you can estimate a covariance matrix, what am I missing? |
Or do you just have central values and errors? |
Yes, I assume fully uncorrelated data. |
@pittlerf mentioned a case where gnuplot gives a better chi^2 than our fit routine. Maybe this example would help? |
I put an example R script with the necessary data to /qbigwork2/pittler/fit_check. With gnuplot I obtain: With matrixfit using either optim or lm I got: The mass is perfectly fine, but the amplitude is a bit different and the chi2 is larger. |
I was using a PS correlator from the A60 ensemble. |
Are you using the exact same fit range?
What does the hadron chi^2 function give with gnuplot parameters?
…On 1 October 2019 17:37:09 CEST, pittlerf ***@***.***> wrote:
I was using a PS correlator from the A60 ensemble.
--
Carsten Urbach mobile
|
I cannot load the file "check_fitting.RData".
|
Do you try this on qbig ? |
Rdata files are architecture independent...
…On 4 October 2019 12:29:30 CEST, pittlerf ***@***.***> wrote:
Do you try this on qbig ?
--
Carsten Urbach mobile
|
I am just asking, because I can read it on qbig. It contains a 'data' dataframe, from which you can extract the PS correlator with
|
I checked this, and found out that difference in the amplitude was due to the different normalization:
Using the results from gnuplot I indeed observe larger chi^2:
I think my issue is solved then, the difference that I saw, came only from the different parametrization. |
But why is the gnuplot chi^2 smaller?
…On 4 October 2019 15:16:55 CEST, pittlerf ***@***.***> wrote:
I checked this, and found out that difference in the amplitude was due
to the different normalization:
```
matrixChisqr(par=c(0.1733674,1.84797631),t=seq(16,20),y=bspp$cf0[17:21],M=M,T=48,matrix(c(2,2),nrow=1,ncol=2),sign.vec=1,ov.sign.vec=1)=0.005570092
```
Using the results from gnuplot I indeed observe larger chi^2:
```
matrixChisqr(par=c(0.1733674,sqrt(2*1.70752)),t=seq(16,20),y=bspp$cf0[17:21],M=M,T=48,matrix(c(2,2),nrow=1,ncol=2),sign.vec=1,ov.sign.vec=1)=0.005579476
```
I think my issue is solved then, the difference that I saw, came only
from the different parametrization.
--
Carsten Urbach mobile
|
Basically because I just fitted the output of print to the correlation function, when I extend the number of digits in the print, and do the fit once more, I got the same chi^2 (0.00557007) with gnuplot as well. |
I've noticed that for some reason
matrixfit
, when called with'lm'
seems to produce a tiny chi^2 compared to the same run with'optim'
. In the case that I tested, I do not believe the chi^2 given by the'lm'
run. Has anybody observed this before?The text was updated successfully, but these errors were encountered: