ChiSquared Values
ChiSquared Values
Hi all,
I have a quick question on chisquared values in programs such as CRYSOL and DAMMIN/F. In the literature associated with these papers, chisquared is calculated as:
X^{2}= (1/N1) * sum [((( I_{obs}(s)  I_{calc}(s))^{2})/sigma(s)^{2}]
therefore, this means if I_{obs}=I_{calc}, chisquared should be zero. However, reading around, most posts on here suggest a chisquared value of 1 is better. Where does this come from? Have I misinterpreted something?
I have a quick question on chisquared values in programs such as CRYSOL and DAMMIN/F. In the literature associated with these papers, chisquared is calculated as:
X^{2}= (1/N1) * sum [((( I_{obs}(s)  I_{calc}(s))^{2})/sigma(s)^{2}]
therefore, this means if I_{obs}=I_{calc}, chisquared should be zero. However, reading around, most posts on here suggest a chisquared value of 1 is better. Where does this come from? Have I misinterpreted something?
Re: ChiSquared Values
Chi squared much less than one suggests that either you have been overfitting the data or your error estimates are too large.
Re: ChiSquared Values
Is this quoted anywhere in the literature?
I understand that zero chisquared is probably due to overfitting and large errors, but it would also be the result of perfect fitting to a curve of little errors (i.e correct solution), would it not?
I understand that zero chisquared is probably due to overfitting and large errors, but it would also be the result of perfect fitting to a curve of little errors (i.e correct solution), would it not?
Re: ChiSquared Values
The chisquare test compares the discrepancies between your theoretical and experimental curves with the expected errors. The null hypothesis is that the discrepancies are entirely due to random experimental errors. A reduced chisquared value much less than one means that the discrepancies are much smaller than you expected, based on your estimate of what the experimental errors will be. Therefore either the discrepancies really are too small (i.e. overfitting) or the experimental errors are smaller than you estimated.
Re: ChiSquared Values
Hello, I have more general questions:
1) why is there the 1/(k1) factor?
2) how is calculated the scale factor? can you give me the explicit formula?
1) why is there the 1/(k1) factor?
2) how is calculated the scale factor? can you give me the explicit formula?

 Member
 Posts: 5
 Joined: 2020.02.28 11:46
Re: ChiSquared Values
Hi everyone,
Could you help me please understand how sigma(s), the experimental errors, are calculated in the Chi squared equation of CRYSOL, X^{2} = (1/N) * sum [ ( I_{obs}(s)  cI_{calc}(s) )^{2} / sigma(s)^{2} ] ?
Thanks in advance
Could you help me please understand how sigma(s), the experimental errors, are calculated in the Chi squared equation of CRYSOL, X^{2} = (1/N) * sum [ ( I_{obs}(s)  cI_{calc}(s) )^{2} / sigma(s)^{2} ] ?
Thanks in advance
Re: how sigma(s), the experimental errors, are calculated
The experimental errors sigma(s) are taken from the input data file, third column.

 Member
 Posts: 5
 Joined: 2020.02.28 11:46
Re: ChiSquared Values
Which input data file ?
If I apply the following CRYSOL command "crysol structure.pdb target.dat" with structure.pdb is a random frame of my structure trajectory and target.dat contains deux columns (q, Intensity). In this case what is sigma(s) in the Chi squared value calculated by CRYSOL ?
Thanks in advance
If I apply the following CRYSOL command "crysol structure.pdb target.dat" with structure.pdb is a random frame of my structure trajectory and target.dat contains deux columns (q, Intensity). In this case what is sigma(s) in the Chi squared value calculated by CRYSOL ?
Thanks in advance
Re: ChiSquared Values
target.dat  it should contain the experimental SAXS data, three columns: q, I(q), sigma(q).
(q and s both mean the same).
If your SAXS data file does not have the third sigma column then CRYSOL will invent the experimental errors and compute the chisquared using these.

 Member
 Posts: 5
 Joined: 2020.02.28 11:46
Re: ChiSquared Values
My target.dat doesn't have a third column.
Actually I am trying to reproduce CRYSOL calculation of the chisquared value. Thus, I need to better understand how CRYSOL invents the experimental errors ?
Thanks in advance.
Actually I am trying to reproduce CRYSOL calculation of the chisquared value. Thus, I need to better understand how CRYSOL invents the experimental errors ?
Thanks in advance.
Re: ChiSquared Values
It does polynomial smoothing of the nonnegative data. If the smoothed array still has significant systematic
deviations, 3% relative error is assigned.
In practice, the third column in the resulting *.fit file is the used error value.
deviations, 3% relative error is assigned.
In practice, the third column in the resulting *.fit file is the used error value.

 Member
 Posts: 5
 Joined: 2020.02.28 11:46
Re: ChiSquared Values
I have my experimental data (actually it is not a real experimental data, it is generated by crysol to test the value of chi2) and my structure pdb file. I try to apply chi2 equation (mentioned in the article D. Svregun, C. Barberato, M. H. J. Koch) but it does not work. In the chisquared equation, I use experimental data file as Ie in the chisquared equation, I use intensity file of my pdb structure (obtained by crysol) as Icalculated in the chisqured equation and I use 0.03*Ie=sigma to calculate sigma.
However my calculate for chisquared is not the same with the chisquared value obtained by crysol.
Could you help me to better understand where is the problem ?
Thanks in advance.
However my calculate for chisquared is not the same with the chisquared value obtained by crysol.
Could you help me to better understand where is the problem ?
Thanks in advance.
Re: ChiSquared Values
Could you please attach the resulting fit file?

 Member
 Posts: 5
 Joined: 2020.02.28 11:46
Re: ChiSquared Values
Thanks in advance
 Attachments

 1KH6_crysol.dat
 experimental data (not exactly experimental data, this file is obtained by crysol, it's corresponding to the frame 0 of the structure)
 (5.08 KiB) Downloaded 35 times

 model_1_crysol_v2.pdb
 pdb structure file
 (135.37 KiB) Downloaded 32 times

 model_1_crysol_v200.fit
 fit file result of the command (crysol model_1_crysol_v2.pdb 1KH6_crysol.dat)
 (5.74 KiB) Downloaded 30 times

 model_1_crysol_v200.log
 log file result
 (2.88 KiB) Downloaded 31 times
Re: ChiSquared Values
I've used the crysol binary from Atsas3.0.1 release and obtained the attached fit file.
The obtained chi^2 value is 3.355. The chi^2 computed from the fit file taking lines 3 to end is also 3.355.
Can you reproduce this result?
The obtained chi^2 value is 3.355. The chi^2 computed from the fit file taking lines 3 to end is also 3.355.
Can you reproduce this result?
 Attachments

 model_1_crysol_v202.log
 (81.76 KiB) Downloaded 30 times

 model_1_crysol_v202.fit
 (5.9 KiB) Downloaded 32 times