<div dir="ltr">Hi,<div><br></div><div>It has been a while since I wrote this and you could potentially be right that I forget to devide by the second derivative, I&#39;ll have a look.</div><div><br></div><div>P</div></div>

<div class="gmail_extra"><br><br><div class="gmail_quote">On 5 September 2013 02:31, Keitaro Yamashita <span dir="ltr">&lt;<a href="mailto:k.yamashita@spring8.or.jp" target="_blank">k.yamashita@spring8.or.jp</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear cctbx developers,<br>
<br>
I am interested in the implementation of model-based reflection<br>
outlier rejection. As I read the code<br>
mmtbx/scaling/outlier_rejection.py (lines 244-351), I noticed that<br>
maybe there was a discrepancy between what log_message explained and<br>
the actual code. The log_message in the code says:<br>
<br>
&gt; Outliers are rejected on the basis of the assumption that a scaled<br>
&gt; log likelihood differnce 2(log[P(Fobs)]-log[P(Fmode)])/Q\&quot; is distributed<br>
&gt; according to a Chi-square distribution (Q\&quot; is equal to the second<br>
&gt; derivative of the log likelihood function of the mode of the<br>
&gt; distribution).<br>
&gt; The outlier threshold of the p-value relates to the p-value of the<br>
&gt; extreme value distribution of the chi-square distribution.<br>
<br>
while actual p_value is calculated for each hkl as<br>
p_value = 1 - erf(sqrt(LLG))**N,<br>
where<br>
LLG = log p(F=Fbar | Fmodel) - log p(F=Fobs | Fmodel),<br>
and N is the number of reflections. Here, Fbar is F which<br>
gives the maximum value of p(F | Fmodel). At least, Q (the second<br>
derivative of p(F=Fbar | Fmodel)) is not used in the actual<br>
calculation.<br>
<br>
Could someone please explain the meaning of the actual calculation?<br>
Why taking square-root and raising erf() result to the power of N?<br>
<br>
Thank you very much,<br>
Keitaro<br>
_______________________________________________<br>
cctbxbb mailing list<br>
<a href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a><br>
<a href="http://phenix-online.org/mailman/listinfo/cctbxbb" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>-----------------------------------------------------------------<br>P.H. Zwart<br>Research Scientist<br>Berkeley Center for Structural Biology<br>Lawrence Berkeley National Laboratories<br>

1 Cyclotron Road, Berkeley, CA-94703, USA<br>Cell: 510 289 9246<br>BCSB:� � � <a href="http://bcsb.als.lbl.gov">http://bcsb.als.lbl.gov</a><br>PHENIX:�� <a href="http://www.phenix-online.org">http://www.phenix-online.org</a><br>

SASTBX:� <a href="http://sastbx.als.lbl.gov">http://sastbx.als.lbl.gov</a><br>-----------------------------------------------------------------
</div>