<?xml version='1.0'?>
<!DOCTYPE art SYSTEM 'http://www.biomedcentral.com/xml/article.dtd'>
<art>
   <ui>1748-7188-2-9</ui>
   <ji>1748-7188</ji>
   <fm>
      <dochead>Research</dochead>
      <bibl>
         <title>
            <p>Local sequence alignments statistics: deviations from Gumbel statistics in the rare-event tail</p>
         </title>
         <aug>
            <au id="A1" ca="yes">
               <snm>Wolfsheimer</snm>
               <fnm>Stefan</fnm>
               <insr iid="I1"/>
               <insr iid="I2"/>
               <email>wolfsh@theorie.physik.uni-oldenburg.de</email>
            </au>
            <au id="A2">
               <snm>Burghardt</snm>
               <fnm>Bernd</fnm>
               <insr iid="I1"/>
               <email>burghard@theorie.physik.uni-goettingen.de</email>
            </au>
            <au id="A3">
               <snm>Hartmann</snm>
               <mi>K</mi>
               <fnm>Alexander</fnm>
               <insr iid="I1"/>
               <insr iid="I2"/>
               <email>a.hartmann@uni-oldenburg.de</email>
            </au>
         </aug>
         <insg>
            <ins id="I1">
               <p>Institut f&#252;r Theoretische Physik, Universit&#228;t G&#246;ttingen, 37077, G&#246;ttingen, Friedrich-Hund-Platz 1, Germany</p>
            </ins>
            <ins id="I2">
               <p>Institut f&#252;r Physik, Universit&#228;t Oldenburg, 26111, Oldenburg, Germany</p>
            </ins>
         </insg>
         <source>Algorithms for Molecular Biology</source>
         <issn>1748-7188</issn>
         <pubdate>2007</pubdate>
         <volume>2</volume>
         <issue>1</issue>
         <fpage>9</fpage>
         <url>http://www.almob.org/content/2/1/9</url>
         <xrefbib>
            <pubidlist>
               <pubid idtype="pmpid">17625018</pubid>
               <pubid idtype="doi">10.1186/1748-7188-2-9</pubid>
            </pubidlist>
         </xrefbib>
      </bibl>
      <history>
         <rec>
            <date>
               <day>05</day>
               <month>10</month>
               <year>2006</year>
            </date>
         </rec>
         <acc>
            <date>
               <day>11</day>
               <month>7</month>
               <year>2007</year>
            </date>
         </acc>
         <pub>
            <date>
               <day>11</day>
               <month>7</month>
               <year>2007</year>
            </date>
         </pub>
      </history>
      <cpyrt>
         <year>2007</year>
         <collab>Wolfsheimer et al; licensee BioMed Central Ltd.</collab>
         <note>This is an Open Access article distributed under the terms of the Creative Commons Attribution License (<url>http://creativecommons.org/licenses/by/2.0</url>), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</note>
      </cpyrt>
      <abs>
         <sec>
            <st>
               <p>Abstract</p>
            </st>
            <sec>
               <st>
                  <p>Background</p>
               </st>
               <p>The optimal score for ungapped local alignments of infinitely long random sequences is known to follow a Gumbel extreme value distribution. Less is known about the important case, where gaps are allowed. For this case, the distribution is only known empirically in the high-probability region, which is biologically less relevant.</p>
            </sec>
            <sec>
               <st>
                  <p>Results</p>
               </st>
               <p>We provide a method to obtain numerically the biologically relevant rare-event tail of the distribution. The method, which has been outlined in an earlier work, is based on generating the sequences with a parametrized probability distribution, which is biased with respect to the original biological one, in the framework of Metropolis Coupled Markov Chain Monte Carlo. Here, we first present the approach in detail and evaluate the convergence of the algorithm by considering a simple test case. In the earlier work, the method was just applied to one single example case. Therefore, we consider here a large set of parameters:</p>
               <p>We study the distributions for protein alignment with different substitution matrices (BLOSUM62 and PAM250) and affine gap costs with different parameter values. In the logarithmic phase (large gap costs) it was previously assumed that the Gumbel form still holds, hence the Gumbel distribution is usually used when evaluating p-values in databases. Here we show that for all cases, provided that the sequences are not too long (<it>L </it>> 400), a "modified" Gumbel distribution, i.e. a Gumbel distribution with an additional Gaussian factor is suitable to describe the data. We also provide a "scaling analysis" of the parameters used in the modified Gumbel distribution. Furthermore, via a comparison with BLAST parameters, we show that significance estimations change considerably when using the true distributions as presented here. Finally, we study also the distribution of the sum statistics of the <it>k </it>best alignments.</p>
            </sec>
            <sec>
               <st>
                  <p>Conclusion</p>
               </st>
               <p>Our results show that the statistics of gapped and ungapped local alignments deviates significantly from Gumbel in the rare-event tail. We provide a Gaussian correction to the distribution and an analysis of its scaling behavior for several different scoring parameter sets, which are commonly used to search protein data bases. The case of sum statistics of <it>k </it>best alignments is included.</p>
            </sec>
         </sec>
      </abs>
   </fm>
   <bdy>
      <sec>
         <st>
            <p>Background</p>
         </st>
         <p>Sequence alignment is a powerful tool in bioinformatics <abbrgrp><abbr bid="B1">1</abbr><abbr bid="B2">2</abbr></abbrgrp> to detect evolutionarily related proteins by comparing their sequences of amino acids. Basically one wants to determine the "similarity" of the sequences. For example, given a protein in a database like PDB <abbrgrp><abbr bid="B3">3</abbr></abbrgrp>, such similarity analysis can be used to detect other proteins, which are evolutionary close to it. Related approaches are also used for the comparison of DNA sequences, i.e. shotgun DNA sequencing <abbrgrp><abbr bid="B4">4</abbr></abbrgrp>, but the application to DNA is not considered in this article.</p>
         <p>Alignment algorithms find optimum alignments and maximum alignment scores <it>S </it>of two or more sequences for a given scoring system. Needleman and Wunsch suggested a method to compute global alignments <abbrgrp><abbr bid="B5">5</abbr></abbrgrp>, whereas the Smith-Waterman algorithm <abbrgrp><abbr bid="B6">6</abbr></abbrgrp> aims at finding local similarities. Insertions and deletions of residues are taken into account by allowing for gaps in the alignment. Gaps yield a negative contribution to the alignment score and are usually modeled by a gap-length <it>l </it>depending score function <it>g </it>(<it>l</it>). Widely used are affine gap costs because for two given sequences of length <it>L </it>and <it>M</it>, because fast algorithms with running time <inline-formula><m:math name="1748-7188-2-9-i1" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">O</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFoe=taaa@383D@</m:annotation></m:semantics></m:math></inline-formula> (<it>LM</it>) are available for this case <abbrgrp><abbr bid="B7">7</abbr></abbrgrp>. Note that for database queries even this is too complex, hence fast heuristics like BLAST <abbrgrp><abbr bid="B8">8</abbr></abbrgrp> are used there.</p>
         <p>By itself, the alignment <it>score</it>, which measures the similarity of two given sequences, does not contain any information about the statistical significance of an alignment. One approach to quantify the statistical significance is to compute the <it>p-value </it>for a given score <it>S</it>. This means under a random sequence model one wants to know the probability for the occurrence of at least one hit with a score <it>S </it>greater than or equal to some given threshold value <it>b</it>, i.e. &#8473;(<it>S </it>&#8805; <it>b</it>). Often E-values are used instead. They describe the number of expected hits with a score greater than or equal to some threshold value. One possible access to the statistical significance can be achieved under the null model of random sequences. Then the optimal alignment score <it>S </it>becomes a random variable and the probability of occurrence of <it>S </it>under this model <it>P </it>(<it>s</it>) = &#8473; (<it>S </it>= <it>s</it>) provides estimates for p-values. Analytic expressions for <it>P </it>(<it>s</it>) are only known asymptotically in the case of gapless alignments of long sequences, where an <it>extreme value distribution </it>(also called <it>Gumbel distribution</it>) <abbrgrp><abbr bid="B9">9</abbr><abbr bid="B10">10</abbr></abbrgrp> was found. For alignments with gaps, such analytical expressions are not available. Approximation for scenarios with gaps based on probabilistic alignment <abbrgrp><abbr bid="B11">11</abbr><abbr bid="B12">12</abbr><abbr bid="B13">13</abbr></abbrgrp>, large deviations <abbrgrp><abbr bid="B14">14</abbr></abbrgrp> and a Poisson model <abbrgrp><abbr bid="B15">15</abbr></abbrgrp> had been developed. Altschul and Gish <abbrgrp><abbr bid="B16">16</abbr></abbrgrp> investigated the score statistics of random sequences for a number of scoring systems and gap parameters by computer simulations: They obtained histograms of optimum scores for randomly sampled pairs of sequences by simple sampling. By curve fitting, they showed that in the region of high probability the extreme value distribution describes the data well, also for gapped alignments of finite sequences. Additionally, they found that the theoretical predictions for the relation between the scoring system on one side and the Gumbel parameters on the other side hold approximately for gapped alignments. In this context they obtained two improvements: Using a correction to account for finite sequence lengths and sum statistics of the <it>k</it>-best alignments, theoretical predictions for ungapped alignments could be applied more accurately to gapped alignments. Recently Olsen et al. introduced the "island method" <abbrgrp><abbr bid="B17">17</abbr><abbr bid="B18">18</abbr></abbrgrp>, which accelerates sampling time. BLAST <abbrgrp><abbr bid="B8">8</abbr></abbrgrp> uses precomputed data, generated with the island method, to estimate E-values. In any case, as already pointed out, the studies in Ref. <abbrgrp><abbr bid="B16">16</abbr></abbrgrp> and <abbrgrp><abbr bid="B18">18</abbr></abbrgrp> give reliable data in the region where <it>P </it>(<it>s</it>) is large only. This is outside the region of biological interest because pairs of biologically related sequences have a higher similarity than pairs of purely randomly drawn sequences.</p>
         <p>To overcome this drawback a rare-event sampling technique was proposed recently <abbrgrp><abbr bid="B19">19</abbr></abbrgrp>, which is based on methods from statistical physics. This general approach allows to obtain the distribution over a wide range, in the present case down to <it>P </it>(<it>s</it>) = 10<sup>-40</sup>. So far this method has been applied to one relevant case only, namely protein alignment with the BLOSUM 62 score matrix <abbrgrp><abbr bid="B7">7</abbr></abbrgrp> and affine gap costs with <it>&#945; </it>= 12 opening and <it>&#946; </it>= 1 extension costs. It turned out that at least for one scoring matrix and one set of gap-cost parameters, the distribution deviates from the Gumbel form in the biologically relevant rare-event tail, where simple sampling methods fail. Empirically, a Gaussian correction to the original distribution was proposed for this case.</p>
         <p>Results as in Ref. <abbrgrp><abbr bid="B19">19</abbr></abbrgrp> are only useful if one obtains the distribution for a large range of parameter values which are commonly used in bioinformatics. It is the purpose of this work to study the distribution of <it>S </it>for other relevant cases. Here we consider the BLOSUM62 and the PAM250 score matrices in connection with various parameters <it>&#945; </it>, <it>&#946; </it>of affine gap costs.</p>
         <p>The paper is organized as follows. In the second section we define alignments formally and state a few main results on the statistics of local sequence alignment. Next, we state the rare-event approach used here and in the fourth section we explain our approach in detail. We introduce some toy examples which are also used to evaluate the convergence properties of the algorithm. In the fifth section, we present our results for BLOSUM62 and PAM 250 matrices in conjunction with different affine gap costs. We show also our results for the sum statistics of the <it>k </it>largest alignments. In the last section, we summarize and discuss our results.</p>
      </sec>
      <sec>
         <st>
            <p>Statistics of local sequence alignment</p>
         </st>
         <p>In this section, we define sequence alignment, and state some analytical results for the distribution of the optimum scores <it>S </it>over pairs of random sequences.</p>
         <p>Let <b>x </b>= <it>x</it><sub>1</sub><it>x</it><sub>2 </sub>... <it>x</it><sub><it>L </it></sub>and <b>y </b>= <it>y</it><sub>1</sub><it>y</it><sub>2 </sub>... <it>y</it><sub><it>M </it></sub>be two sequences over a finite alphabet &#931; with <it>r </it>= |&#931;| letters(e.g. nucleic acids or amino acids). An <it>alignment </it><inline-formula><m:math name="1748-7188-2-9-i2" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">A</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFaeFqaaa@3821@</m:annotation></m:semantics></m:math></inline-formula> is a set <inline-formula><m:math name="1748-7188-2-9-i2" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">A</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFaeFqaaa@3821@</m:annotation></m:semantics></m:math></inline-formula> = {(<it>i</it><sub><it>k</it></sub>, <it>j</it><sub><it>k</it></sub>} of <it>K </it>pairs of "non-crossing" indices (<it>k </it>= 1, 2, ..., <it>K </it>- 1, 1 &#8804; <it>i</it><sub><it>k </it></sub>&lt;<it>i</it><sub><it>k</it>+1 </sub>&#8804; <it>L </it>and 1 &#8804; <it>j</it><sub><it>k </it></sub>&lt;<it>j</it><sub><it>k</it>+1 </sub>&#8804; <it>M</it>) identifying pairs of letters from the two sequences. Letters, which are not paired are called <it>unpaired </it>or <it>gapped</it>. A <it>gap g of length l</it><sub><it>g </it></sub>is a substring of <it>l</it><sub><it>g </it></sub>gapped letters from one sequence. Note, that this representation <abbrgrp><abbr bid="B14">14</abbr></abbrgrp> of an alignment is equivalent to an introduction of a gap symbol, as commonly used. Formally the gap cost function can be defined by considering the length of a gap beginning at the <it>k</it>th pairing in sequence <b>x </b>or sequence <b>y </b>respectively, in detail</p>
         <p>
            <display-formula>
               <m:math name="1748-7188-2-9-i3" xmlns:m="http://www.w3.org/1998/Math/MathML">
                  <m:semantics>
                     <m:mrow>
                        <m:mtable>
                           <m:mtr>
                              <m:mtd>
                                 <m:mrow>
                                    <m:msubsup>
                                       <m:mi>l</m:mi>
                                       <m:mi>g</m:mi>
                                       <m:mi>x</m:mi>
                                    </m:msubsup>
                                    <m:mo stretchy="false">(</m:mo>
                                    <m:mi>k</m:mi>
                                    <m:mo stretchy="false">)</m:mo>
                                    <m:mo>=</m:mo>
                                    <m:msub>
                                       <m:mi>i</m:mi>
                                       <m:mrow>
                                          <m:mi>k</m:mi>
                                          <m:mo>+</m:mo>
                                          <m:mn>1</m:mn>
                                       </m:mrow>
                                    </m:msub>
                                    <m:mo>&#8722;</m:mo>
                                    <m:msub>
                                       <m:mi>i</m:mi>
                                       <m:mi>k</m:mi>
                                    </m:msub>
                                    <m:mo>&#8722;</m:mo>
                                    <m:mn>1</m:mn>
                                 </m:mrow>
                              </m:mtd>
                           </m:mtr>
                           <m:mtr>
                              <m:mtd>
                                 <m:mrow>
                                    <m:msubsup>
                                       <m:mi>l</m:mi>
                                       <m:mi>g</m:mi>
                                       <m:mi>y</m:mi>
                                    </m:msubsup>
                                    <m:mo stretchy="false">(</m:mo>
                                    <m:mi>k</m:mi>
                                    <m:mo stretchy="false">)</m:mo>
                                    <m:mo>=</m:mo>
                                    <m:msub>
                                       <m:mi>j</m:mi>
                                       <m:mrow>
                                          <m:mi>k</m:mi>
                                          <m:mo>+</m:mo>
                                          <m:mn>1</m:mn>
                                       </m:mrow>
                                    </m:msub>
                                    <m:mo>&#8722;</m:mo>
                                    <m:msub>
                                       <m:mi>j</m:mi>
                                       <m:mi>k</m:mi>
                                    </m:msub>
                                    <m:mo>&#8722;</m:mo>
                                    <m:mn>1.</m:mn>
                                 </m:mrow>
                              </m:mtd>
                           </m:mtr>
                        </m:mtable>
                     </m:mrow>
                     <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaafaqabeGabaaabaGaemiBaW2aa0baaSqaaiabdEgaNbqaaiabdIha4baakiabcIcaOiabdUgaRjabcMcaPiabg2da9iabdMgaPnaaBaaaleaacqWGRbWAcqGHRaWkcqaIXaqmaeqaaOGaeyOeI0IaemyAaK2aaSbaaSqaaiabdUgaRbqabaGccqGHsislcqaIXaqmaeaacqWGSbaBdaqhaaWcbaGaem4zaCgabaGaemyEaKhaaOGaeiikaGIaem4AaSMaeiykaKIaeyypa0JaemOAaO2aaSbaaSqaaiabdUgaRjabgUcaRiabigdaXaqabaGccqGHsislcqWGQbGAdaWgaaWcbaGaem4AaSgabeaakiabgkHiTiabigdaXiabc6caUaaaaaa@5399@</m:annotation>
                  </m:semantics>
               </m:math>
            </display-formula>
         </p>
         <p>The <it>score </it><inline-formula><m:math name="1748-7188-2-9-i4" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mover accent="true"><m:mi>S</m:mi><m:mo>&#732;</m:mo></m:mover><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuWGtbWugaacaaaa@2DEA@</m:annotation></m:semantics></m:math></inline-formula>(<b>x</b>, <b>y</b>, <inline-formula><m:math name="1748-7188-2-9-i2" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">A</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFaeFqaaa@3821@</m:annotation></m:semantics></m:math></inline-formula>) of the local alignment of the two sequences is composed of a sum over all aligned pairs and a sum over all gaps of both sequences:</p>
         <p>
            <display-formula id="M1">
               <m:math name="1748-7188-2-9-i5" xmlns:m="http://www.w3.org/1998/Math/MathML">
                  <m:semantics>
                     <m:mrow>
                        <m:mtable>
                           <m:mtr>
                              <m:mtd>
                                 <m:mrow>
                                    <m:mover accent="true">
                                       <m:mi>S</m:mi>
                                       <m:mo>&#732;</m:mo>
                                    </m:mover>
                                    <m:mo stretchy="false">(</m:mo>
                                    <m:mi>x</m:mi>
                                    <m:mo>,</m:mo>
                                    <m:mi>y</m:mi>
                                    <m:mo>,</m:mo>
                                    <m:mi mathvariant="script">A</m:mi>
                                    <m:mo stretchy="false">)</m:mo>
                                    <m:mo>=</m:mo>
                                    <m:mstyle displaystyle="true">
                                       <m:munderover>
                                          <m:mo>&#8721;</m:mo>
                                          <m:mrow>
                                             <m:mi>k</m:mi>
                                             <m:mo>=</m:mo>
                                             <m:mn>1</m:mn>
                                          </m:mrow>
                                          <m:mi>K</m:mi>
                                       </m:munderover>
                                       <m:mrow>
                                          <m:mi>&#963;</m:mi>
                                          <m:mo stretchy="false">(</m:mo>
                                          <m:msub>
                                             <m:mi>x</m:mi>
                                             <m:mrow>
                                                <m:msub>
                                                   <m:mi>i</m:mi>
                                                   <m:mi>k</m:mi>
                                                </m:msub>
                                             </m:mrow>
                                          </m:msub>
                                          <m:mo>,</m:mo>
                                          <m:msub>
                                             <m:mi>y</m:mi>
                                             <m:mrow>
                                                <m:msub>
                                                   <m:mi>j</m:mi>
                                                   <m:mi>k</m:mi>
                                                </m:msub>
                                             </m:mrow>
                                          </m:msub>
                                          <m:mo stretchy="false">)</m:mo>
                                          <m:mo>+</m:mo>
                                          <m:mstyle displaystyle="true">
                                             <m:munder>
                                                <m:mo>&#8721;</m:mo>
                                                <m:mrow>
                                                   <m:mtext>gaps&#160;</m:mtext>
                                                   <m:mi>g</m:mi>
                                                </m:mrow>
                                             </m:munder>
                                             <m:mrow>
                                                <m:mi>g</m:mi>
                                                <m:mo stretchy="false">(</m:mo>
                                                <m:msub>
                                                   <m:mi>l</m:mi>
                                                   <m:mi>g</m:mi>
                                                </m:msub>
                                                <m:mo stretchy="false">)</m:mo>
                                             </m:mrow>
                                          </m:mstyle>
                                       </m:mrow>
                                    </m:mstyle>
                                 </m:mrow>
                              </m:mtd>
                           </m:mtr>
                           <m:mtr>
                              <m:mtd>
                                 <m:mrow>
                                    <m:mo>=</m:mo>
                                    <m:mstyle displaystyle="true">
                                       <m:munderover>
                                          <m:mo>&#8721;</m:mo>
                                          <m:mrow>
                                             <m:mi>k</m:mi>
                                             <m:mo>=</m:mo>
                                             <m:mn>1</m:mn>
                                          </m:mrow>
                                          <m:mi>K</m:mi>
                                       </m:munderover>
                                       <m:mrow>
                                          <m:mi>&#963;</m:mi>
                                          <m:mo stretchy="false">(</m:mo>
                                          <m:msub>
                                             <m:mi>x</m:mi>
                                             <m:mrow>
                                                <m:msub>
                                                   <m:mi>i</m:mi>
                                                   <m:mi>k</m:mi>
                                                </m:msub>
                                             </m:mrow>
                                          </m:msub>
                                          <m:mo>,</m:mo>
                                          <m:msub>
                                             <m:mi>y</m:mi>
                                             <m:mrow>
                                                <m:msub>
                                                   <m:mi>j</m:mi>
                                                   <m:mi>k</m:mi>
                                                </m:msub>
                                             </m:mrow>
                                          </m:msub>
                                          <m:mo stretchy="false">)</m:mo>
                                          <m:mo>+</m:mo>
                                          <m:mstyle displaystyle="true">
                                             <m:munderover>
                                                <m:mo>&#8721;</m:mo>
                                                <m:mrow>
                                                   <m:mi>k</m:mi>
                                                   <m:mo>=</m:mo>
                                                   <m:mn>1</m:mn>
                                                </m:mrow>
                                                <m:mrow>
                                                   <m:mi>K</m:mi>
                                                   <m:mo>&#8722;</m:mo>
                                                   <m:mn>1</m:mn>
                                                </m:mrow>
                                             </m:munderover>
                                             <m:mrow>
                                                <m:mo>{</m:mo>
                                                <m:mi>g</m:mi>
                                                <m:mo stretchy="false">(</m:mo>
                                                <m:msubsup>
                                                   <m:mi>l</m:mi>
                                                   <m:mi>g</m:mi>
                                                   <m:mi>x</m:mi>
                                                </m:msubsup>
                                                <m:mo stretchy="false">(</m:mo>
                                                <m:mi>k</m:mi>
                                                <m:mo stretchy="false">)</m:mo>
                                                <m:mo stretchy="false">)</m:mo>
                                                <m:mo>+</m:mo>
                                                <m:mi>g</m:mi>
                                                <m:mo stretchy="false">(</m:mo>
                                                <m:msubsup>
                                                   <m:mi>l</m:mi>
                                                   <m:mi>g</m:mi>
                                                   <m:mi>y</m:mi>
                                                </m:msubsup>
                                                <m:mo stretchy="false">(</m:mo>
                                                <m:mi>k</m:mi>
                                                <m:mo stretchy="false">)</m:mo>
                                                <m:mo stretchy="false">)</m:mo>
                                                <m:mo>}</m:mo>
                                             </m:mrow>
                                          </m:mstyle>
                                       </m:mrow>
                                    </m:mstyle>
                                 </m:mrow>
                              </m:mtd>
                           </m:mtr>
                        </m:mtable>
                     </m:mrow>
                     <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaafaqadeGabaaabaGafm4uamLbaGaacqGGOaakieqacqWF4baEcqGGSaalcqWF5bqEcqGGSaalt0uy0HwzTfgDPnwy1egaryqtHrhAL1wy0L2yHvdaiqaacqGFaeFqcqGGPaqkcqGH9aqpdaaeWbqaaGGaciab9n8aZjabcIcaOiabdIha4naaBaaaleaacqWGPbqAdaWgaaadbaGaem4AaSgabeaaaSqabaGccqGGSaalcqWG5bqEdaWgaaWcbaGaemOAaO2aaSbaaWqaaiabdUgaRbqabaaaleqaaOGaeiykaKIaey4kaSYaaabuaeaacqWGNbWzcqGGOaakcqWGSbaBdaWgaaWcbaGaem4zaCgabeaakiabcMcaPaWcbaGaee4zaCMaeeyyaeMaeeiCaaNaee4CamNaeeiiaaIaem4zaCgabeqdcqGHris5aaWcbaGaem4AaSMaeyypa0JaeGymaedabaGaem4saSeaniabggHiLdaakeaacqGH9aqpdaaeWbqaaiab9n8aZjabcIcaOiabdIha4naaBaaaleaacqWGPbqAdaWgaaadbaGaem4AaSgabeaaaSqabaGccqGGSaalcqWG5bqEdaWgaaWcbaGaemOAaO2aaSbaaWqaaiabdUgaRbqabaaaleqaaOGaeiykaKIaey4kaSYaaabCaeaacqGG7bWEcqWGNbWzcqGGOaakcqWGSbaBdaqhaaWcbaGaem4zaCgabaGaemiEaGhaaOGaeiikaGIaem4AaSMaeiykaKIaeiykaKIaey4kaSIaem4zaCMaeiikaGIaemiBaW2aa0baaSqaaiabdEgaNbqaaiabdMha5baakiabcIcaOiabdUgaRjabcMcaPiabcMcaPiabc2ha9bWcbaGaem4AaSMaeyypa0JaeGymaedabaGaem4saSKaeyOeI0IaeGymaedaniabggHiLdaaleaacqWGRbWAcqGH9aqpcqaIXaqmaeaacqWGlbWsa0GaeyyeIuoaaaaaaa@9D73@</m:annotation>
                  </m:semantics>
               </m:math>
            </display-formula>
         </p>
         <p>where <it>&#963; </it>(<it>a</it>, <it>b</it>) <it>a, b </it>&#8712; <inline-formula><m:math name="1748-7188-2-9-i2" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">A</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFaeFqaaa@3821@</m:annotation></m:semantics></m:math></inline-formula> is the given <it>score matrix </it>(or <it>substitution matrix</it>) and <it>g </it>(<it>l</it>) the <it>gap-cost function </it>with <it>g </it>(0) = 0. Note that the alignment is local, because the (possibly large) gaps at the beginning and the end of each sequence are not included in the scoring function. Otherwise the alignment would be global. Here, we consider the BLOSUM62 <abbrgrp><abbr bid="B20">20</abbr></abbrgrp> and the PAM250 <abbrgrp><abbr bid="B21">21</abbr><abbr bid="B22">22</abbr></abbrgrp> matrices and affine gap costs, i.e. <it>g </it>(<it>l</it>) = <it>&#945; </it>+ <it>&#946; </it>(<it>l </it>-1). The <it>similarity </it>of the sequences is the optimum alignment with the maximum score</p>
         <p>
            <display-formula id="M2">
               <m:math name="1748-7188-2-9-i6" xmlns:m="http://www.w3.org/1998/Math/MathML">
                  <m:semantics>
                     <m:mrow>
                        <m:mi>S</m:mi>
                        <m:mo stretchy="false">(</m:mo>
                        <m:mi>x</m:mi>
                        <m:mo>,</m:mo>
                        <m:mi>y</m:mi>
                        <m:mo stretchy="false">)</m:mo>
                        <m:mo>=</m:mo>
                        <m:munder>
                           <m:mrow>
                              <m:mi>max</m:mi>
                              <m:mo>&#8289;</m:mo>
                           </m:mrow>
                           <m:mi mathvariant="script">A</m:mi>
                        </m:munder>
                        <m:mover accent="true">
                           <m:mi>S</m:mi>
                           <m:mo>&#732;</m:mo>
                        </m:mover>
                        <m:mo stretchy="false">(</m:mo>
                        <m:mi>x</m:mi>
                        <m:mo>,</m:mo>
                        <m:mi>y</m:mi>
                        <m:mo>,</m:mo>
                        <m:mi mathvariant="script">A</m:mi>
                        <m:mo stretchy="false">)</m:mo>
                        <m:mo>,</m:mo>
                     </m:mrow>
                     <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGtbWucqGGOaakieqacqWF4baEcqGGSaalcqWF5bqEcqGGPaqkcqGH9aqpdaWfqaqaaiGbc2gaTjabcggaHjabcIha4bWcbaWenfgDOvwBHrxAJfwnHbqeg0uy0HwzTfgDPnwy1aaceaGae4haXheabeaakiqbdofatzaaiaGaeiikaGIae8hEaGNaeiilaWIae8xEaKNaeiilaWIae4haXhKaeiykaKIaeiilaWcaaa@4E77@</m:annotation>
                  </m:semantics>
               </m:math>
            </display-formula>
         </p>
         <p>which can be obtained in <inline-formula><m:math name="1748-7188-2-9-i1" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">O</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFoe=taaa@383D@</m:annotation></m:semantics></m:math></inline-formula>(<it>LM</it>) time <abbrgrp><abbr bid="B7">7</abbr></abbrgrp>.</p>
         <p>In the case of gapless optimum local alignments of two random sequences of <it>L </it>and <it>M </it>independent letters from &#931; with frequencies {<it>f</it><sub><it>a </it></sub>} with <it>a </it>&#8712; &#931; and &#8721;<sub><it>a </it></sub><it>f</it><sub><it>a </it></sub>= 1, referred as <it>null model</it>, the score statistics can be calculated analytically in the asymptotic regime of long sequences <abbrgrp><abbr bid="B9">9</abbr><abbr bid="B10">10</abbr></abbrgrp>.</p>
         <p>In this case one obtains the Gumbel distribution (Karlin-Altschul statistics) <abbrgrp><abbr bid="B23">23</abbr></abbrgrp></p>
         <p>
            <display-formula id="M3">&#8473;(<it>S </it>&#8805; <it>b</it>) = 1 - exp [- <it>KLM e</it><sup>-<it>&#955;b</it></sup>]</display-formula>
         </p>
         <p>or</p>
         <p>
            <display-formula id="M4">P<sub>Gumble </sub>(<it>s</it>) = &#8473;(<it>S </it>= <it>s</it>) = <it>&#955; KLM </it>exp [-<it>&#955; s </it>- <it>KLM e</it><sup>-<it>&#955; s</it></sup>]</display-formula>
         </p>
         <p>The parameters <it>&#955; </it>and <it>K </it>of Eq. (3) can be derived directly from the score matrix <it>&#963; </it>(<it>a</it>, <it>b</it>) and frequencies <it>f</it><sub><it>a </it></sub><abbrgrp><abbr bid="B9">9</abbr><abbr bid="B10">10</abbr></abbrgrp>.</p>
         <p>As pointed out by Altschul and Gish <abbrgrp><abbr bid="B16">16</abbr></abbrgrp>, in finite systems there occur edge effects: An alignment may extend to the end of either sequence and the score will be distorted towards lower values and high scores become less probable. Since this effect vanishes in the limit of infinite sequences, the tail of Eq. (3) can be understood as an upper bound for finite sequences.</p>
         <p>Arratia and Waterman <abbrgrp><abbr bid="B24">24</abbr></abbrgrp> predicted a phase transition between a linear phase and a logarithmic phase, i.e. a linear growth of the excepted score as a function of the sequence length, changing to a logarithmic growth with increasing gap costs. In the linear phase an optimum alignment may spread over a large range of the sequences and the statistical theory breaks down. However, only the logarithmic phase is of interest in biological questions because the alignment algorithm becomes more sensitive in this phase, especially near the threshold <abbrgrp><abbr bid="B25">25</abbr></abbrgrp>.</p>
         <p>Often the sensitivity of an alignment algorithm can be increased by not only considering the best optimal alignment score, but also the <it>k</it>-best scores of non overlapping alignments. An <inline-formula><m:math name="1748-7188-2-9-i1" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">O</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFoe=taaa@383D@</m:annotation></m:semantics></m:math></inline-formula>(<it>LM</it>) algorithm for this task, based on Sellers concept of local optimality, was developed <abbrgrp><abbr bid="B26">26</abbr><abbr bid="B27">27</abbr></abbrgrp>. According to Karlin and Altschul <abbrgrp><abbr bid="B28">28</abbr></abbrgrp> also the sum statistics of the <it>k</it>-best alignment scores for random sequences can be derived analytically for asymptotically long sequences. The probability <it>f </it>for the sum of the <it>k</it>-best normalized scores <inline-formula><m:math name="1748-7188-2-9-i7" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mi>T</m:mi><m:mi>k</m:mi></m:msub><m:mo>=</m:mo><m:mi>&#955;</m:mi><m:mstyle displaystyle="true"><m:msubsup><m:mo>&#8721;</m:mo><m:mi>i</m:mi><m:mi>k</m:mi></m:msubsup><m:mrow><m:mo stretchy="false">(</m:mo><m:msub><m:mi>S</m:mi><m:mi>i</m:mi></m:msub><m:mo>&#8722;</m:mo><m:mfrac><m:mrow><m:mi>ln</m:mi><m:mo>&#8289;</m:mo><m:mi>K</m:mi><m:mi>L</m:mi><m:mi>M</m:mi></m:mrow><m:mi>&#955;</m:mi></m:mfrac></m:mrow></m:mstyle><m:mo stretchy="false">)</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGubavdaWgaaWcbaGaem4AaSgabeaakiabg2da9GGaciab=T7aSnaaqadabaGaeiikaGIaem4uam1aaSbaaSqaaiabdMgaPbqabaGccqGHsisldaWcaaqaaiGbcYgaSjabc6gaUjabdUealjabdYeamjabd2eanbqaaiab=T7aSbaaaSqaaiabdMgaPbqaaiabdUgaRbqdcqGHris5aOGaeiykaKcaaa@4440@</m:annotation></m:semantics></m:math></inline-formula> (<it>&#955; </it>and <it>K </it>are the corresponding Gumbel-parameters for the optimal alignment)is given by the integral</p>
         <p>
            <display-formula id="M5">
               <m:math name="1748-7188-2-9-i8" xmlns:m="http://www.w3.org/1998/Math/MathML">
                  <m:semantics>
                     <m:mrow>
                        <m:mi>f</m:mi>
                        <m:mo stretchy="false">(</m:mo>
                        <m:mi>t</m:mi>
                        <m:mo stretchy="false">)</m:mo>
                        <m:mo>=</m:mo>
                        <m:mfrac>
                           <m:mrow>
                              <m:msup>
                                 <m:mi>e</m:mi>
                                 <m:mrow>
                                    <m:mo>&#8722;</m:mo>
                                    <m:mi>t</m:mi>
                                 </m:mrow>
                              </m:msup>
                           </m:mrow>
                           <m:mrow>
                              <m:mi>k</m:mi>
                              <m:mo>!</m:mo>
                              <m:mo stretchy="false">(</m:mo>
                              <m:mi>k</m:mi>
                              <m:mo>&#8722;</m:mo>
                              <m:mn>2</m:mn>
                              <m:mo stretchy="false">)</m:mo>
                              <m:mo>!</m:mo>
                           </m:mrow>
                        </m:mfrac>
                        <m:mstyle displaystyle="true">
                           <m:mrow>
                              <m:msubsup>
                                 <m:mo>&#8747;</m:mo>
                                 <m:mn>0</m:mn>
                                 <m:mi>&#8734;</m:mi>
                              </m:msubsup>
                              <m:mrow>
                                 <m:msup>
                                    <m:mi>y</m:mi>
                                    <m:mrow>
                                       <m:mi>k</m:mi>
                                       <m:mo>&#8722;</m:mo>
                                       <m:mn>2</m:mn>
                                    </m:mrow>
                                 </m:msup>
                                 <m:mi>exp</m:mi>
                                 <m:mo>&#8289;</m:mo>
                                 <m:mo stretchy="false">(</m:mo>
                                 <m:mo>&#8722;</m:mo>
                                 <m:msup>
                                    <m:mi>e</m:mi>
                                    <m:mrow>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:mi>y</m:mi>
                                       <m:mo>&#8722;</m:mo>
                                       <m:mi>t</m:mi>
                                       <m:mo stretchy="false">)</m:mo>
                                       <m:mo>/</m:mo>
                                       <m:mi>k</m:mi>
                                    </m:mrow>
                                 </m:msup>
                                 <m:mo stretchy="false">)</m:mo>
                                 <m:mi>d</m:mi>
                                 <m:mi>y</m:mi>
                                 <m:mo>.</m:mo>
                              </m:mrow>
                           </m:mrow>
                        </m:mstyle>
                     </m:mrow>
                     <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGMbGzcqGGOaakcqWG0baDcqGGPaqkcqGH9aqpdaWcaaqaaiabdwgaLnaaCaaaleqabaGaeyOeI0IaemiDaqhaaaGcbaGaem4AaSMaeiyiaeIaeiikaGIaem4AaSMaeyOeI0IaeGOmaiJaeiykaKIaeiyiaecaamaapedabaGaemyEaK3aaWbaaSqabeaacqWGRbWAcqGHsislcqaIYaGmaaGccyGGLbqzcqGG4baEcqGGWbaCcqGGOaakcqGHsislcqWGLbqzdaahaaWcbeqaaiabcIcaOiabdMha5jabgkHiTiabdsha0jabcMcaPiabc+caViabdUgaRbaakiabcMcaPiabdsgaKjabdMha5jabc6caUaWcbaGaeGimaadabaGaeyOhIukaniabgUIiYdaaaa@5B5A@</m:annotation>
                  </m:semantics>
               </m:math>
            </display-formula>
         </p>
         <p>In the tail, i.e. for large <it>t</it>, <it>f </it>(<it>t</it>) is well approximated by</p>
         <p>
            <display-formula id="M6">
               <m:math name="1748-7188-2-9-i9" xmlns:m="http://www.w3.org/1998/Math/MathML">
                  <m:semantics>
                     <m:mrow>
                        <m:msub>
                           <m:mi>f</m:mi>
                           <m:mrow>
                              <m:mtext>tail</m:mtext>
                           </m:mrow>
                        </m:msub>
                        <m:mo stretchy="false">(</m:mo>
                        <m:mi>t</m:mi>
                        <m:mo stretchy="false">)</m:mo>
                        <m:mo>=</m:mo>
                        <m:mfrac>
                           <m:mrow>
                              <m:msup>
                                 <m:mi>e</m:mi>
                                 <m:mrow>
                                    <m:mo>&#8722;</m:mo>
                                    <m:mi>t</m:mi>
                                 </m:mrow>
                              </m:msup>
                           </m:mrow>
                           <m:mrow>
                              <m:mi>k</m:mi>
                              <m:mo>!</m:mo>
                              <m:mo stretchy="false">(</m:mo>
                              <m:mi>k</m:mi>
                              <m:mo>&#8722;</m:mo>
                              <m:mn>1</m:mn>
                              <m:mo stretchy="false">)</m:mo>
                              <m:mo>!</m:mo>
                           </m:mrow>
                        </m:mfrac>
                        <m:mo stretchy="false">[</m:mo>
                        <m:msup>
                           <m:mi>t</m:mi>
                           <m:mrow>
                              <m:mi>k</m:mi>
                              <m:mo>&#8722;</m:mo>
                              <m:mn>1</m:mn>
                           </m:mrow>
                        </m:msup>
                        <m:mo>&#8722;</m:mo>
                        <m:mo stretchy="false">(</m:mo>
                        <m:mi>k</m:mi>
                        <m:mo>&#8722;</m:mo>
                        <m:mn>1</m:mn>
                        <m:mo stretchy="false">)</m:mo>
                        <m:msup>
                           <m:mi>t</m:mi>
                           <m:mrow>
                              <m:mi>k</m:mi>
                              <m:mo>&#8722;</m:mo>
                              <m:mn>2</m:mn>
                           </m:mrow>
                        </m:msup>
                        <m:mo stretchy="false">)</m:mo>
                        <m:mo stretchy="false">]</m:mo>
                        <m:mo>.</m:mo>
                     </m:mrow>
                     <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGMbGzdaWgaaWcbaGaeeiDaqNaeeyyaeMaeeyAaKMaeeiBaWgabeaakiabcIcaOiabdsha0jabcMcaPiabg2da9maalaaabaGaemyzau2aaWbaaSqabeaacqGHsislcqWG0baDaaaakeaacqWGRbWAcqGGHaqicqGGOaakcqWGRbWAcqGHsislcqaIXaqmcqGGPaqkcqGGHaqiaaGaei4waSLaemiDaq3aaWbaaSqabeaacqWGRbWAcqGHsislcqaIXaqmaaGccqGHsislcqGGOaakcqWGRbWAcqGHsislcqaIXaqmcqGGPaqkcqWG0baDdaahaaWcbeqaaiabdUgaRjabgkHiTiabikdaYaaakiabcMcaPiabc2faDjabc6caUaaa@578C@</m:annotation>
                  </m:semantics>
               </m:math>
            </display-formula>
         </p>
         <p>In the asymptotic theory the score can be seen as a continuous variable and the probabilities Eq. (4) and Eq. (5) become probability densities. Then the probability of finding a normalized score <it>b </it>or larger is given by the integral <inline-formula><m:math name="1748-7188-2-9-i10" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mi>&#8473;</m:mi><m:mo stretchy="false">(</m:mo><m:mi>S</m:mi><m:mo>&#8805;</m:mo><m:mi>b</m:mi><m:mo stretchy="false">)</m:mo><m:mo>=</m:mo><m:mstyle displaystyle="true"><m:mrow><m:msubsup><m:mo>&#8747;</m:mo><m:mi>b</m:mi><m:mi>&#8734;</m:mi></m:msubsup><m:mrow><m:mi>f</m:mi><m:mo stretchy="false">(</m:mo><m:mi>t</m:mi><m:mo stretchy="false">)</m:mo><m:mi>d</m:mi><m:mi>t</m:mi></m:mrow></m:mrow></m:mstyle></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaatuuDJXwAK1uy0HMmaeHbfv3ySLgzG0uy0HgiuD3BaGabaiab=LriqjabcIcaOiabdofatjabgwMiZkabdkgaIjabcMcaPiabg2da9maapedabaGaemOzayMaeiikaGIaemiDaqNaeiykaKIaemizaqMaemiDaqhaleaacqWGIbGyaeaacqGHEisPa0Gaey4kIipaaaa@4A78@</m:annotation></m:semantics></m:math></inline-formula>. However in computer simulations the score is a discrete variable and therefore the normalization constants in Eq. (5) differ from continious scoring. Below we will compare the results of our numerical studies to this distribution in the tail of the data for values <it>k </it>= 2, ..., 5.</p>
      </sec>
      <sec>
         <st>
            <p>Sampling of rare-events</p>
         </st>
         <sec>
            <st>
               <p>Metropolis Hastings Algorithm</p>
            </st>
            <p>As already pointed out, the main purpose of this paper is to calculate the tail of the distribution of optimum scores of gapped local alignments over pairs of randomly and independently drawn sequences of finite lengths. The basic idea of our approach is to generate the sequences from different distributions, which are biased towards higher scores.</p>
            <p>In order to be more precise let us denote the state space of all possible pairs of sequences (<b>x</b>, <b>y</b>) as <inline-formula><m:math name="1748-7188-2-9-i11" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">X</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFxepwaaa@384F@</m:annotation></m:semantics></m:math></inline-formula> and an element in this space as a <it>configuration</it>. We write <b>X </b>= (<b>x</b>, <b>y</b>).</p>
            <p>The probability mass function (pmf) of finding <b>X </b>under the null model is given by <inline-formula><m:math name="1748-7188-2-9-i12" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mi>p</m:mi><m:mo stretchy="false">(</m:mo><m:mi>X</m:mi><m:mo stretchy="false">)</m:mo><m:mo>=</m:mo><m:mi>p</m:mi><m:mo stretchy="false">(</m:mo><m:mi>x</m:mi><m:mo>,</m:mo><m:mi>y</m:mi><m:mo stretchy="false">)</m:mo><m:mo>=</m:mo><m:mstyle displaystyle="true"><m:msubsup><m:mo>&#8719;</m:mo><m:mrow><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:mi>L</m:mi></m:msubsup><m:mrow><m:msub><m:mi>f</m:mi><m:mrow><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mrow></m:msub></m:mrow></m:mstyle><m:mstyle displaystyle="true"><m:msubsup><m:mo>&#8719;</m:mo><m:mrow><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:mi>M</m:mi></m:msubsup><m:mrow><m:msub><m:mi>f</m:mi><m:mrow><m:msub><m:mi>y</m:mi><m:mi>j</m:mi></m:msub></m:mrow></m:msub></m:mrow></m:mstyle></m:mrow><m:annotation encoding="MathType-MTEF">
MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGWbaCcqGGOaakieqacqWFybawcqGGPaqkcqGH9aqpcqWGWbaCcqGGOaakcqWF4baEcqGGSaalcqWF5bqEcqGGPaqkcqGH9aqpdaqeWaqaaiabdAgaMnaaBaaaleaacqWG4baEdaWgaaadbaGaemyAaKgabeaaaSqabaaabaGaemyAaKMaeyypa0JaeGymaedabaGaemitaWeaniabg+GivdGcdaqeWaqaaiabdAgaMnaaBaaaleaacqWG5bqEdaWgaaadbaGaemOAaOgabeaaaSqabaaabaGaemOAaOMaeyypa0JaeGymaedabaGaemyta0eaniabg+Givdaaaa@4FD5@</m:annotation></m:semantics></m:math></inline-formula> and the alignment score as defined in Eq. (2) is a random variable. A direct way to obtain the probability of the occurrence of a certain score <it>s</it>, is to generate <it>n </it>uncorrelated representatives <b>X</b><sub><it>i </it></sub>&#8712; <inline-formula><m:math name="1748-7188-2-9-i11" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">X</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFxepwaaa@384F@</m:annotation></m:semantics></m:math></inline-formula> according to the null model and then compute the expectation values of the family of indicator functions <it>h</it><sub><it>s</it></sub>: <inline-formula><m:math name="1748-7188-2-9-i11" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">X</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFxepwaaa@384F@</m:annotation></m:semantics></m:math></inline-formula> &#8594; &#8477; with <it>h</it><sub><it>s </it></sub>(<b>X</b>) = 1, if <it>S </it>(<b>X</b>) = <it>s </it>and <it>h</it><sub><it>s </it></sub>(<b>X</b>) = 0 otherwise, in other words</p>
            <p>
               <display-formula>
                  <m:math name="1748-7188-2-9-i13" xmlns:m="http://www.w3.org/1998/Math/MathML">
                     <m:semantics>
                        <m:mrow>
                           <m:mi>&#8473;</m:mi>
                           <m:mo stretchy="false">[</m:mo>
                           <m:mi>S</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>X</m:mi>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo>=</m:mo>
                           <m:mi>s</m:mi>
                           <m:mo stretchy="false">]</m:mo>
                           <m:mo>=</m:mo>
                           <m:mi mathvariant="double-struck">E</m:mi>
                           <m:mo stretchy="false">[</m:mo>
                           <m:msub>
                              <m:mi>h</m:mi>
                              <m:mi>s</m:mi>
                           </m:msub>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>X</m:mi>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo stretchy="false">]</m:mo>
                           <m:mo>=</m:mo>
                           <m:mstyle displaystyle="true">
                              <m:munder>
                                 <m:mo>&#8721;</m:mo>
                                 <m:mi>X</m:mi>
                              </m:munder>
                              <m:mrow>
                                 <m:msub>
                                    <m:mi>h</m:mi>
                                    <m:mi>s</m:mi>
                                 </m:msub>
                              </m:mrow>
                           </m:mstyle>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>X</m:mi>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mi>p</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>X</m:mi>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo>&#8776;</m:mo>
                           <m:mfrac>
                              <m:mn>1</m:mn>
                              <m:mi>n</m:mi>
                           </m:mfrac>
                           <m:mstyle displaystyle="true">
                              <m:munderover>
                                 <m:mo>&#8721;</m:mo>
                                 <m:mrow>
                                    <m:mi>i</m:mi>
                                    <m:mo>=</m:mo>
                                    <m:mn>1</m:mn>
                                 </m:mrow>
                                 <m:mi>n</m:mi>
                              </m:munderover>
                              <m:mrow>
                                 <m:msub>
                                    <m:mi>h</m:mi>
                                    <m:mi>s</m:mi>
                                 </m:msub>
                                 <m:mo stretchy="false">(</m:mo>
                                 <m:msub>
                                    <m:mi>X</m:mi>
                                    <m:mi>i</m:mi>
                                 </m:msub>
                                 <m:mo stretchy="false">)</m:mo>
                              </m:mrow>
                           </m:mstyle>
                           <m:mo>.</m:mo>
                        </m:mrow>
                        <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaatuuDJXwAK1uy0HMmaeHbfv3ySLgzG0uy0HgiuD3BaGabaiab=LriqjabcUfaBjabdofatjabcIcaOGqabiab+HfayjabcMcaPiabg2da9iabdohaZjabc2faDjabg2da9iab=ri8fjabcUfaBjabdIgaOnaaBaaaleaacqWGZbWCaeqaaOGaeiikaGIae4hwaGLaeiykaKIaeiyxa0Laeyypa0ZaaabuaeaacqWGObaAdaWgaaWcbaGaem4CamhabeaaaeaacqGFybawaeqaniabggHiLdGccqGGOaakcqGFybawcqGGPaqkcqWGWbaCcqGGOaakcqGFybawcqGGPaqkcqGHijYUdaWcaaqaaiabigdaXaqaaiabd6gaUbaadaaeWbqaaiabdIgaOnaaBaaaleaacqWGZbWCaeqaaOGaeiikaGIae4hwaG1aaSbaaSqaaiabdMgaPbqabaGccqGGPaqkaSqaaiabdMgaPjabg2da9iabigdaXaqaaiabd6gaUbqdcqGHris5aOGaeiOla4caaa@6E0F@</m:annotation>
                     </m:semantics>
                  </m:math>
               </display-formula>
            </p>
            <p>Since the region of biological interest is located in the rare-event tail a huge amount of samples would be needed to achieve an acceptable accuracy. In practice the rare-event tail becomes inaccessible.</p>
            <p>Our method is based on importance sampling of a mixture of chains based on the Metropolis-Hastings algorithm. Before describing the coupling of multiple chains, we introduce the general idea of importance sampling first: The approach is based on sampling from a different distribution, such that the region of interest is sampled with high probability. Since this happens in a controlled manner the true distribution can be obtained afterward, as frequently used in variance reduction techniques. The modified distribution yields a different random variable with a different pmf <it>q</it>. We may write</p>
            <p>
               <display-formula>
                  <m:math name="1748-7188-2-9-i14" xmlns:m="http://www.w3.org/1998/Math/MathML">
                     <m:semantics>
                        <m:mrow>
                           <m:mi>P</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>s</m:mi>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo>=</m:mo>
                           <m:mi>&#8473;</m:mi>
                           <m:mo stretchy="false">[</m:mo>
                           <m:mi>S</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>X</m:mi>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo>=</m:mo>
                           <m:mi>s</m:mi>
                           <m:mo stretchy="false">]</m:mo>
                           <m:mo>=</m:mo>
                           <m:mstyle displaystyle="true">
                              <m:munder>
                                 <m:mo>&#8721;</m:mo>
                                 <m:msup>
                                    <m:mi>X</m:mi>
                                    <m:mo>&#8242;</m:mo>
                                 </m:msup>
                              </m:munder>
                              <m:mrow>
                                 <m:msub>
                                    <m:mi>h</m:mi>
                                    <m:mi>s</m:mi>
                                 </m:msub>
                                 <m:mo stretchy="false">(</m:mo>
                                 <m:msup>
                                    <m:mi>X</m:mi>
                                    <m:mo>&#8242;</m:mo>
                                 </m:msup>
                                 <m:mo stretchy="false">)</m:mo>
                                 <m:mfrac>
                                    <m:mrow>
                                       <m:mi>p</m:mi>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:msup>
                                          <m:mi>X</m:mi>
                                          <m:mo>&#8242;</m:mo>
                                       </m:msup>
                                       <m:mo stretchy="false">)</m:mo>
                                    </m:mrow>
                                    <m:mrow>
                                       <m:mi>q</m:mi>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:msup>
                                          <m:mi>X</m:mi>
                                          <m:mo>&#8242;</m:mo>
                                       </m:msup>
                                       <m:mo stretchy="false">)</m:mo>
                                    </m:mrow>
                                 </m:mfrac>
                              </m:mrow>
                           </m:mstyle>
                           <m:mi>q</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:msup>
                              <m:mi>X</m:mi>
                              <m:mo>&#8242;</m:mo>
                           </m:msup>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo>&#8776;</m:mo>
                           <m:mfrac>
                              <m:mn>1</m:mn>
                              <m:mi>n</m:mi>
                           </m:mfrac>
                           <m:mstyle displaystyle="true">
                              <m:munderover>
                                 <m:mo>&#8721;</m:mo>
                                 <m:mrow>
                                    <m:mi>i</m:mi>
                                    <m:mo>=</m:mo>
                                    <m:mn>1</m:mn>
                                 </m:mrow>
                                 <m:mi>n</m:mi>
                              </m:munderover>
                              <m:mrow>
                                 <m:msub>
                                    <m:mi>h</m:mi>
                                    <m:mi>s</m:mi>
                                 </m:msub>
                              </m:mrow>
                           </m:mstyle>
                           <m:mo stretchy="false">(</m:mo>
                           <m:msub>
                              <m:msup>
                                 <m:mi>X</m:mi>
                                 <m:mo>&#8242;</m:mo>
                              </m:msup>
                              <m:mi>i</m:mi>
                           </m:msub>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mfrac>
                              <m:mrow>
                                 <m:mi>p</m:mi>
                                 <m:mo stretchy="false">(</m:mo>
                                 <m:msub>
                                    <m:msup>
                                       <m:mi>X</m:mi>
                                       <m:mo>&#8242;</m:mo>
                                    </m:msup>
                                    <m:mi>i</m:mi>
                                 </m:msub>
                                 <m:mo stretchy="false">)</m:mo>
                              </m:mrow>
                              <m:mrow>
                                 <m:mi>q</m:mi>
                                 <m:mo stretchy="false">(</m:mo>
                                 <m:msub>
                                    <m:msup>
                                       <m:mi>X</m:mi>
                                       <m:mo>&#8242;</m:mo>
                                    </m:msup>
                                    <m:mi>i</m:mi>
                                 </m:msub>
                                 <m:mo stretchy="false">)</m:mo>
                              </m:mrow>
                           </m:mfrac>
                           <m:mo>.</m:mo>
                        </m:mrow>
                        <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGqbaucqGGOaakcqWGZbWCcqGGPaqkcqGH9aqptuuDJXwAK1uy0HMmaeHbfv3ySLgzG0uy0HgiuD3BaGabaiab=LriqjabcUfaBjabdofatjabcIcaOGqabiab+HfayjabcMcaPiabg2da9iabdohaZjabc2faDjabg2da9maaqafabaGaemiAaG2aaSbaaSqaaiabdohaZbqabaGccqGGOaakcuGFybawgaqbaiabcMcaPmaalaaabaGaemiCaaNaeiikaGIaf4hwaGLbauaacqGGPaqkaeaacqWGXbqCcqGGOaakcuGFybawgaqbaiabcMcaPaaaaSqaaiqb+HfayzaafaaabeqdcqGHris5aOGaemyCaeNaeiikaGIaf4hwaGLbauaacqGGPaqkcqGHijYUdaWcaaqaaiabigdaXaqaaiabd6gaUbaadaaeWbqaaiabdIgaOnaaBaaaleaacqWGZbWCaeqaaaqaaiabdMgaPjabg2da9iabigdaXaqaaiabd6gaUbqdcqGHris5aOGaeiikaGIaf4hwaGLbauaadaWgaaWcbaGaemyAaKgabeaakiabcMcaPmaalaaabaGaemiCaaNaeiikaGIaf4hwaGLbauaadaWgaaWcbaGaemyAaKgabeaakiabcMcaPaqaaiabdghaXjabcIcaOiqb+HfayzaafaWaaSbaaSqaaiabdMgaPbqabaGccqGGPaqkaaGaeiOla4caaa@7C9B@</m:annotation>
                     </m:semantics>
                  </m:math>
               </display-formula>
            </p>
            <p>At least approximately, the distribution of local alignment follows a Gumbel distribution, which exhibits an exponential behavior in the tail. Therefore an obvious choice for the biased distribution is</p>
            <p>
               <display-formula id="M7">
                  <m:math name="1748-7188-2-9-i15" xmlns:m="http://www.w3.org/1998/Math/MathML">
                     <m:semantics>
                        <m:mrow>
                           <m:msub>
                              <m:mi>q</m:mi>
                              <m:mi>T</m:mi>
                           </m:msub>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>X</m:mi>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo>&#8801;</m:mo>
                           <m:mfrac>
                              <m:mrow>
                                 <m:msub>
                                    <m:mover accent="true">
                                       <m:mi>q</m:mi>
                                       <m:mo>&#732;</m:mo>
                                    </m:mover>
                                    <m:mi>T</m:mi>
                                 </m:msub>
                                 <m:mo stretchy="false">(</m:mo>
                                 <m:mi>X</m:mi>
                                 <m:mo stretchy="false">)</m:mo>
                              </m:mrow>
                              <m:mrow>
                                 <m:msub>
                                    <m:mi>Z</m:mi>
                                    <m:mi>T</m:mi>
                                 </m:msub>
                              </m:mrow>
                           </m:mfrac>
                           <m:mo>&#8801;</m:mo>
                           <m:mfrac>
                              <m:mn>1</m:mn>
                              <m:mrow>
                                 <m:msub>
                                    <m:mi>Z</m:mi>
                                    <m:mi>T</m:mi>
                                 </m:msub>
                              </m:mrow>
                           </m:mfrac>
                           <m:mi>p</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>X</m:mi>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo>&#8901;</m:mo>
                           <m:mi>exp</m:mi>
                           <m:mo>&#8289;</m:mo>
                           <m:mo stretchy="false">[</m:mo>
                           <m:mi>S</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>X</m:mi>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo>/</m:mo>
                           <m:mi>T</m:mi>
                           <m:mo stretchy="false">]</m:mo>
                           <m:mo>,</m:mo>
                        </m:mrow>
                        <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGXbqCdaWgaaWcbaGaemivaqfabeaakiabcIcaOGqabiab=HfayjabcMcaPiabggMi6oaalaaabaGafmyCaeNbaGaadaWgaaWcbaGaemivaqfabeaakiabcIcaOiabdIfayjabcMcaPaqaaiabdQfaAnaaBaaaleaacqWGubavaeqaaaaakiabggMi6oaalaaabaGaeGymaedabaGaemOwaO1aaSbaaSqaaiabdsfaubqabaaaaOGaemiCaaNaeiikaGIae8hwaGLaeiykaKIaeyyXICTagiyzauMaeiiEaGNaeiiCaaNaei4waSLaem4uamLaeiikaGIae8hwaGLaeiykaKIaei4la8IaemivaqLaeiyxa0LaeiilaWcaaa@5680@</m:annotation>
                     </m:semantics>
                  </m:math>
               </display-formula>
            </p>
            <p>where <inline-formula><m:math name="1748-7188-2-9-i16" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mover accent="true"><m:mi>q</m:mi><m:mo>&#732;</m:mo></m:mover><m:mi>T</m:mi></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuWGXbqCgaacamaaBaaaleaacqWGubavaeqaaaaa@2F83@</m:annotation></m:semantics></m:math></inline-formula> the unnormalized weight of a configuration, <it>Z</it><sub><it>T </it></sub>is a (usually unknown) normalization constant and <it>T </it>an adjustable parameter, which we will call "temperature" (In the framework of statistical mechanics, which is closely related to our method, the parameter <it>T </it>describes the temperature of a physical system. The pair of sequences can be seen as a configuration of a physical system and the negative score as the energy function. Then exp [<it>S </it>(<b>X</b>)/<it>T</it>] refers to the so called <it>Gibbs-Boltzmann distribution</it>.) The close-to Gumbel form of the distribution is also directly related to the so called "large deviation rate function", which basically describes the decay rate of the tail of the distribution. Note that, if the score distribution is an exact Gumbel distribution Eq. (3), i.e. the rate function a known constant <it>&#955;</it>, then setting <it>T </it>= 1/<it>&#955; </it>in Eq. (7) yields a "flat score histogram" for sufficient large <it>s</it>. Hence, in this case, a simulation at a single carfully chosen value <it>T </it>would be sufficient to obtain the full result. Since <it>P </it>(<it>s</it>) does not follow the Gumbel form exactly, importance sampling has to be applied. Each value of <it>T </it>selects one region of the distribution around which a high accurracy is obtained.</p>
            <p>This importance sampling approach is conceptual related to the method of "measure change" in large deviation theory. For example Siegmund and Yakir <abbrgrp><abbr bid="B14">14</abbr></abbrgrp> approximated the p-value for local sequence alignment by considering the log-likelihood ratio between an alternative measure and the measure of the null model. Under the new measure a rare event occurs more likely than under the original null measure and approximations become possible. Another example can be found in Ref. <abbrgrp><abbr bid="B29">29</abbr></abbrgrp>, where techniques from large deviation theory were applied to proof "asymptotic efficiency" of rare-event simulations.</p>
            <p>However, since there is no direct method to sample directly according to the modified distribution Eq. (7) we implemented the <it>Metropolis-Hastings algorithm </it><abbrgrp><abbr bid="B30">30</abbr></abbrgrp>, which is explained now in detail. It is based on ergodic <it>Markov chain Monte Carlo (MCMC) </it>in state space. Ergodic here means, that for a given state in the configuration space <inline-formula><m:math name="1748-7188-2-9-i11" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">X</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFxepwaaa@384F@</m:annotation></m:semantics></m:math></inline-formula> any other can be achieved by stepwise "local" modifications of configurations in finite time. Note that we work in discrete time steps here. Let <b>X </b>&#8712; <inline-formula><m:math name="1748-7188-2-9-i11" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">X</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFxepwaaa@384F@</m:annotation></m:semantics></m:math></inline-formula> a configuration at time <it>t </it>(e.g. at the start of the simulation). To determine the configuration at time <it>t </it>+ 1, first a <it>trial configuration </it><b>X</b>* is selected randomly among its "neighbors". The neighborhood of a configuration depends on the choice of trial steps, which are specified below. For practical reasons we require, that the score within a neighborhood of a given configuration will not change too much. The transition matrix for this trial selection process is denoted by <it>P </it>(<b>X</b>, <b>X</b>*). Now, the trial configuration becomes the configuration at time <it>t </it>+ 1, i.e. is <it>accepted</it>, with probability</p>
            <p>
               <display-formula id="M8">
                  <m:math name="1748-7188-2-9-i17" xmlns:m="http://www.w3.org/1998/Math/MathML">
                     <m:semantics>
                        <m:mrow>
                           <m:mover accent="true">
                              <m:mi>p</m:mi>
                              <m:mo>&#732;</m:mo>
                           </m:mover>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>X</m:mi>
                           <m:mo>&#8594;</m:mo>
                           <m:msup>
                              <m:mi>X</m:mi>
                              <m:mo>&#8727;</m:mo>
                           </m:msup>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo>=</m:mo>
                           <m:mi>max</m:mi>
                           <m:mo>&#8289;</m:mo>
                           <m:mrow>
                              <m:mo>{</m:mo>
                              <m:mrow>
                                 <m:mn>1</m:mn>
                                 <m:mo>,</m:mo>
                                 <m:mfrac>
                                    <m:mrow>
                                       <m:mi>P</m:mi>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:msup>
                                          <m:mi>X</m:mi>
                                          <m:mo>&#8727;</m:mo>
                                       </m:msup>
                                       <m:mo>,</m:mo>
                                       <m:mi>X</m:mi>
                                       <m:mo stretchy="false">)</m:mo>
                                    </m:mrow>
                                    <m:mrow>
                                       <m:mi>P</m:mi>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:mi>X</m:mi>
                                       <m:mo>,</m:mo>
                                       <m:msup>
                                          <m:mi>X</m:mi>
                                          <m:mo>&#8727;</m:mo>
                                       </m:msup>
                                       <m:mo stretchy="false">)</m:mo>
                                    </m:mrow>
                                 </m:mfrac>
                                 <m:mo>&#8901;</m:mo>
                                 <m:mfrac>
                                    <m:mrow>
                                       <m:msub>
                                          <m:mi>q</m:mi>
                                          <m:mi>T</m:mi>
                                       </m:msub>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:msup>
                                          <m:mi>X</m:mi>
                                          <m:mo>&#8727;</m:mo>
                                       </m:msup>
                                       <m:mo stretchy="false">)</m:mo>
                                    </m:mrow>
                                    <m:mrow>
                                       <m:msub>
                                          <m:mi>q</m:mi>
                                          <m:mi>T</m:mi>
                                       </m:msub>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:mi>X</m:mi>
                                       <m:mo stretchy="false">)</m:mo>
                                    </m:mrow>
                                 </m:mfrac>
                              </m:mrow>
                              <m:mo>}</m:mo>
                           </m:mrow>
                           <m:mo>=</m:mo>
                           <m:mi>max</m:mi>
                           <m:mo>&#8289;</m:mo>
                           <m:mrow>
                              <m:mo>{</m:mo>
                              <m:mrow>
                                 <m:mn>1</m:mn>
                                 <m:mo>,</m:mo>
                                 <m:mfrac>
                                    <m:mrow>
                                       <m:mi>P</m:mi>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:msup>
                                          <m:mi>X</m:mi>
                                          <m:mo>&#8727;</m:mo>
                                       </m:msup>
                                       <m:mo>,</m:mo>
                                       <m:mi>X</m:mi>
                                       <m:mo stretchy="false">)</m:mo>
                                    </m:mrow>
                                    <m:mrow>
                                       <m:mi>P</m:mi>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:mi>X</m:mi>
                                       <m:mo>,</m:mo>
                                       <m:msup>
                                          <m:mi>X</m:mi>
                                          <m:mo>&#8727;</m:mo>
                                       </m:msup>
                                       <m:mo stretchy="false">)</m:mo>
                                    </m:mrow>
                                 </m:mfrac>
                                 <m:mi>exp</m:mi>
                                 <m:mo>&#8289;</m:mo>
                                 <m:mo stretchy="false">[</m:mo>
                                 <m:mi>&#916;</m:mi>
                                 <m:mi>S</m:mi>
                                 <m:mo>/</m:mo>
                                 <m:mi>T</m:mi>
                                 <m:mo stretchy="false">]</m:mo>
                              </m:mrow>
                              <m:mo>}</m:mo>
                           </m:mrow>
                           <m:mo>,</m:mo>
                        </m:mrow>
                        <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuWGWbaCgaacaiabcIcaOGqabiab=HfayjabgkziUkab=HfaynaaCaaaleqabaGaey4fIOcaaOGaeiykaKIaeyypa0JagiyBa0MaeiyyaeMaeiiEaG3aaiWabeaacqaIXaqmcqGGSaaldaWcaaqaaiabdcfaqjabcIcaOiab=HfaynaaCaaaleqabaGaey4fIOcaaOGaeiilaWIae8hwaGLaeiykaKcabaGaemiuaaLaeiikaGIae8hwaGLaeiilaWIae8hwaG1aaWbaaSqabeaacqGHxiIkaaGccqGGPaqkaaGaeyyXIC9aaSaaaeaacqWGXbqCdaWgaaWcbaGaemivaqfabeaakiabcIcaOiab=HfaynaaCaaaleqabaGaey4fIOcaaOGaeiykaKcabaGaemyCae3aaSbaaSqaaiabdsfaubqabaGccqGGOaakcqWFybawcqGGPaqkaaaacaGL7bGaayzFaaGaeyypa0JagiyBa0MaeiyyaeMaeiiEaG3aaiWabeaacqaIXaqmcqGGSaaldaWcaaqaaiabdcfaqjabcIcaOiab=HfaynaaCaaaleqabaGaey4fIOcaaOGaeiilaWIae8hwaGLaeiykaKcabaGaemiuaaLaeiikaGIae8hwaGLaeiilaWIae8hwaG1aaWbaaSqabeaacqGHxiIkaaGccqGGPaqkaaGagiyzauMaeiiEaGNaeiiCaaNaei4waSLaeuiLdqKaem4uamLaei4la8IaemivaqLaeiyxa0facaGL7bGaayzFaaGaeiilaWcaaa@8037@</m:annotation>
                     </m:semantics>
                  </m:math>
               </display-formula>
            </p>
            <p>with &#916;<it>S </it>= <it>S </it>(<b>X</b>*) - <it>S </it>(<b>X</b>) If the trial configuration is not accepted, the previous configuration <b>X </b>is kept for the next time step <it>t </it>+ 1. In this way, the Markov chain fulfills the detailed balance condition <it>P </it>(<b>X</b>*, <b>X</b>)<inline-formula><m:math name="1748-7188-2-9-i18" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mover accent="true"><m:mi>p</m:mi><m:mo>&#732;</m:mo></m:mover><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuWGWbaCgaacaaaa@2E24@</m:annotation></m:semantics></m:math></inline-formula>(<b>X</b>* &#8594; <b>X</b>)&#183;<it>q</it><sub><it>T </it></sub>(<b>X</b>*) = <it>P </it>(<b>X</b>, <b>X</b>*)<inline-formula><m:math name="1748-7188-2-9-i18" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mover accent="true"><m:mi>p</m:mi><m:mo>&#732;</m:mo></m:mover><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuWGWbaCgaacaaaa@2E24@</m:annotation></m:semantics></m:math></inline-formula>(<b>X </b>&#8594; <b>X</b>*)&#183;<it>q</it><sub><it>T</it></sub>(<b>X</b>). In this case it has been proven that an ergodic Markov chain converges to the stationary distribution <it>q</it><sub><it>T</it></sub>. Ergodicity means, that there is a non-zero probability for a path between <it>any </it>pair(<b>X</b><sub><b>1</b></sub>, <b>X</b><sub><b>2</b></sub>) of configurations.</p>
            <p>We used a simple way to define the neighborhood of a configuration and constructed the trial configuration as follows: First a letter <it>a </it>is drawn from the alphabet &#931; according to the letter weights <it>f</it><sub><it>a </it></sub>and next one of the sequences (<b>x </b>or <b>y</b>) and a position <it>i </it>is chosen randomly. Finally, the letter at position <it>i </it>is replaced by <it>a</it>.</p>
            <p>Given a Monte Carlo chain (<b>X</b><sub>1</sub>, ..., <b>X</b><sub><it>n</it></sub>) estimated for a fixed temperature <it>T </it>in principle one may estimate expectation values with respect to any member of the family of distributions <it>q</it><sub><it>T </it></sub>by importance reweighting</p>
            <p>
               <display-formula>
                  <m:math name="1748-7188-2-9-i19" xmlns:m="http://www.w3.org/1998/Math/MathML">
                     <m:semantics>
                        <m:mrow>
                           <m:msub>
                              <m:mi mathvariant="double-struck">E</m:mi>
                              <m:msup>
                                 <m:mi>T</m:mi>
                                 <m:mo>&#8242;</m:mo>
                              </m:msup>
                           </m:msub>
                           <m:mo stretchy="false">[</m:mo>
                           <m:mi>g</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>X</m:mi>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo stretchy="false">]</m:mo>
                           <m:mo>&#8776;</m:mo>
                           <m:mfrac>
                              <m:mn>1</m:mn>
                              <m:mi>n</m:mi>
                           </m:mfrac>
                           <m:mstyle displaystyle="true">
                              <m:munderover>
                                 <m:mo>&#8721;</m:mo>
                                 <m:mrow>
                                    <m:mi>i</m:mi>
                                    <m:mo>=</m:mo>
                                    <m:mn>1</m:mn>
                                 </m:mrow>
                                 <m:mi>n</m:mi>
                              </m:munderover>
                              <m:mrow>
                                 <m:mfrac>
                                    <m:mrow>
                                       <m:msub>
                                          <m:mi>q</m:mi>
                                          <m:msup>
                                             <m:mi>T</m:mi>
                                             <m:mo>&#8242;</m:mo>
                                          </m:msup>
                                       </m:msub>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:msub>
                                          <m:mi>X</m:mi>
                                          <m:mi>i</m:mi>
                                       </m:msub>
                                       <m:mo stretchy="false">)</m:mo>
                                    </m:mrow>
                                    <m:mrow>
                                       <m:msub>
                                          <m:mi>q</m:mi>
                                          <m:mi>T</m:mi>
                                       </m:msub>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:msub>
                                          <m:mi>X</m:mi>
                                          <m:mi>i</m:mi>
                                       </m:msub>
                                       <m:mo stretchy="false">)</m:mo>
                                    </m:mrow>
                                 </m:mfrac>
                              </m:mrow>
                           </m:mstyle>
                           <m:mo>&#8901;</m:mo>
                           <m:mi>g</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:msub>
                              <m:mi>X</m:mi>
                              <m:mi>i</m:mi>
                           </m:msub>
                           <m:mo stretchy="false">)</m:mo>
                        </m:mrow>
                        <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaatuuDJXwAK1uy0HMmaeHbfv3ySLgzG0uy0HgiuD3BaGabaiab=ri8fnaaBaaaleaacuWGubavgaqbaaqabaGccqGGBbWwcqWGNbWzcqGGOaakieqacqGFybawcqGGPaqkcqGGDbqxcqGHijYUdaWcaaqaaiabigdaXaqaaiabd6gaUbaadaaeWbqaamaalaaabaGaemyCae3aaSbaaSqaaiqbdsfauzaafaaabeaakiabcIcaOiab+HfaynaaBaaaleaacqWGPbqAaeqaaOGaeiykaKcabaGaemyCae3aaSbaaSqaaiabdsfaubqabaGccqGGOaakcqGFybawdaWgaaWcbaGaemyAaKgabeaakiabcMcaPaaaaSqaaiabdMgaPjabg2da9iabigdaXaqaaiabd6gaUbqdcqGHris5aOGaeyyXICTaem4zaCMaeiikaGIae4hwaG1aaSbaaSqaaiabdMgaPbqabaGccqGGPaqkaaa@62A4@</m:annotation>
                     </m:semantics>
                  </m:math>
               </display-formula>
            </p>
            <p>Since the normalization of <it>q</it><sub><it>T </it></sub>is not trivial, we used a different normalization</p>
            <p>
               <display-formula id="M9">
                  <m:math name="1748-7188-2-9-i20" xmlns:m="http://www.w3.org/1998/Math/MathML">
                     <m:semantics>
                        <m:mrow>
                           <m:msub>
                              <m:mi mathvariant="double-struck">E</m:mi>
                              <m:msup>
                                 <m:mi>T</m:mi>
                                 <m:mo>&#8242;</m:mo>
                              </m:msup>
                           </m:msub>
                           <m:mo stretchy="false">[</m:mo>
                           <m:mi>g</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>X</m:mi>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo stretchy="false">]</m:mo>
                           <m:mo>&#8776;</m:mo>
                           <m:mfrac>
                              <m:mn>1</m:mn>
                              <m:mi>n</m:mi>
                           </m:mfrac>
                           <m:mstyle displaystyle="true">
                              <m:munderover>
                                 <m:mo>&#8721;</m:mo>
                                 <m:mrow>
                                    <m:mi>i</m:mi>
                                    <m:mo>=</m:mo>
                                    <m:mn>1</m:mn>
                                 </m:mrow>
                                 <m:mi>n</m:mi>
                              </m:munderover>
                              <m:mrow>
                                 <m:mfrac>
                                    <m:mrow>
                                       <m:msub>
                                          <m:mover accent="true">
                                             <m:mi>q</m:mi>
                                             <m:mo>&#732;</m:mo>
                                          </m:mover>
                                          <m:msup>
                                             <m:mi>T</m:mi>
                                             <m:mo>&#8242;</m:mo>
                                          </m:msup>
                                       </m:msub>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:msub>
                                          <m:mi>X</m:mi>
                                          <m:mi>i</m:mi>
                                       </m:msub>
                                       <m:mo stretchy="false">)</m:mo>
                                    </m:mrow>
                                    <m:mrow>
                                       <m:msub>
                                          <m:mover accent="true">
                                             <m:mi>q</m:mi>
                                             <m:mo>&#732;</m:mo>
                                          </m:mover>
                                          <m:mi>T</m:mi>
                                       </m:msub>
                                       <m:mo stretchy="false">(</m:mo>
                                       <m:msub>
                                          <m:mi>X</m:mi>
                                          <m:mi>i</m:mi>
                                       </m:msub>
                                       <m:mo stretchy="false">)</m:mo>
                                    </m:mrow>
                                 </m:mfrac>
                              </m:mrow>
                           </m:mstyle>
                           <m:mo>&#8901;</m:mo>
                           <m:mi>g</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:msub>
                              <m:mi>X</m:mi>
                              <m:mi>i</m:mi>
                           </m:msub>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo>,</m:mo>
                        </m:mrow>
                        <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaatuuDJXwAK1uy0HMmaeHbfv3ySLgzG0uy0HgiuD3BaGabaiab=ri8fnaaBaaaleaacuWGubavgaqbaaqabaGccqGGBbWwcqWGNbWzcqGGOaakieqacqGFybawcqGGPaqkcqGGDbqxcqGHijYUdaWcaaqaaiabigdaXaqaaiabd6gaUbaadaaeWbqaamaalaaabaGafmyCaeNbaGaadaWgaaWcbaGafmivaqLbauaaaeqaaOGaeiikaGIae4hwaG1aaSbaaSqaaiabdMgaPbqabaGccqGGPaqkaeaacuWGXbqCgaacamaaBaaaleaacqWGubavaeqaaOGaeiikaGIae4hwaG1aaSbaaSqaaiabdMgaPbqabaGccqGGPaqkaaaaleaacqWGPbqAcqGH9aqpcqaIXaqmaeaacqWGUbGBa0GaeyyeIuoakiabgwSixlabdEgaNjabcIcaOiab+HfaynaaBaaaleaacqWGPbqAaeqaaOGaeiykaKIaeiilaWcaaa@63A2@</m:annotation>
                     </m:semantics>
                  </m:math>
               </display-formula>
            </p>
            <p>and estimate <it>Z </it>from the sample <inline-formula><m:math name="1748-7188-2-9-i21" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mi>Z</m:mi><m:mo>=</m:mo><m:mstyle displaystyle="true"><m:msubsup><m:mo>&#8721;</m:mo><m:mrow><m:mi>k</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:mi>n</m:mi></m:msubsup><m:mrow><m:msub><m:mover accent="true"><m:mi>q</m:mi><m:mo>&#732;</m:mo></m:mover><m:msup><m:mi>T</m:mi><m:mo>&#8242;</m:mo></m:msup></m:msub></m:mrow></m:mstyle><m:mo stretchy="false">(</m:mo><m:msub><m:mi>X</m:mi><m:mi>k</m:mi></m:msub><m:mo stretchy="false">)</m:mo><m:mo>/</m:mo><m:msub><m:mover accent="true"><m:mi>q</m:mi><m:mo>&#732;</m:mo></m:mover><m:mi>T</m:mi></m:msub><m:mo stretchy="false">(</m:mo><m:msub><m:mi>X</m:mi><m:mi>k</m:mi></m:msub><m:mo stretchy="false">)</m:mo></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqWGAbGwcqGH9aqpdaaeWaqaaiqbdghaXzaaiaWaaSbaaSqaaiqbdsfauzaafaaabeaaaeaacqWGRbWAcqGH9aqpcqaIXaqmaeaacqWGUbGBa0GaeyyeIuoakiabcIcaOGqabiab=HfaynaaBaaaleaacqWGRbWAaeqaaOGaeiykaKIaei4la8IafmyCaeNbaGaadaWgaaWcbaGaemivaqfabeaakiabcIcaOiab=HfaynaaBaaaleaacqWGRbWAaeqaaOGaeiykaKcaaa@4556@</m:annotation></m:semantics></m:math></inline-formula>. A detailed discussion about this issue can be found in Ref. <abbrgrp><abbr bid="B31">31</abbr><abbr bid="B32">32</abbr></abbrgrp>. In practice this may work badly as soon as the parameter ranges of the given distribution and the target distribution do not overlap sufficiently. In this case <it>q</it><sub><it>T'</it></sub>(<b>X</b><sub><it>i</it></sub>) is very small, but the configurations where <it>q</it><sub><it>T' </it></sub>(<b>X</b>)/<it>q</it><sub><it>T </it></sub>(<b>X</b>) is sufficiently large are not generated because <it>q</it><sub><it>T </it></sub>(<b>X</b>) is relatively small for those. Therefore we sampled a mixture of many coupled Monte Carlo chains and reweighted the mixture, which is explained in detail in the next section. This allows for large overlap between neighboring distributions and to determine the normalization constants, up to an irrelevant global constant.</p>
         </sec>
         <sec>
            <st>
               <p>Metropolis Coupled MCMC</p>
            </st>
            <p><it>Metropolis Coupled Markov Chain Monte Carlo (MCMCMC) </it>was first invented by Charles Geyer <abbrgrp><abbr bid="B33">33</abbr></abbrgrp> and then reinvented by Hukushima and Nemoto <abbrgrp><abbr bid="B34">34</abbr></abbrgrp> under the term <it>exchange Monte Carlo</it>. In physical literature MCMCMC is often denoted as <it>parallel tempering</it>. The method has become a standard tool in disordered systems with a rough (free) energy landscape <abbrgrp><abbr bid="B35">35</abbr></abbrgrp>. These rough energy landscapes are characterized by high energy barriers and can be found for problems like protein folding <abbrgrp><abbr bid="B36">36</abbr><abbr bid="B37">37</abbr><abbr bid="B38">38</abbr><abbr bid="B39">39</abbr><abbr bid="B40">40</abbr></abbrgrp>, nucleation <abbrgrp><abbr bid="B41">41</abbr></abbrgrp>, spin-glasses <abbrgrp><abbr bid="B42">42</abbr><abbr bid="B43">43</abbr></abbrgrp> and other models characterized by rare events <abbrgrp><abbr bid="B19">19</abbr><abbr bid="B44">44</abbr></abbrgrp>. In the last decade it turned out that MCMCMC accelerates equilibration and mixing remarkably.</p>
            <p>In the framework of MCMCMC <it>m </it>copies <b>X</b><sup>(1)</sup>, ..., <b>X</b><sup>(<it>m</it>) </sup>of the system held at different temperatures <it>T</it><sub>1 </sub>&lt;<it>T</it><sub>2 </sub>&lt; ... &lt;<it>T</it><sub><it>m </it></sub>are simulated in parallel. This means one samples from the product of the state space <inline-formula><m:math name="1748-7188-2-9-i11" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mi mathvariant="script">X</m:mi><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBamrtHrhAL1wy0L2yHvtyaeHbnfgDOvwBHrxAJfwnaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaWaaeGaeaaakeaaimaacqWFxepwaaa@384F@</m:annotation></m:semantics></m:math></inline-formula><sup><it>m </it></sup>weighted with the joint distribution with weights <inline-formula><m:math name="1748-7188-2-9-i22" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mstyle displaystyle="true"><m:msubsup><m:mo>&#8719;</m:mo><m:mrow><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:mi>m</m:mi></m:msubsup><m:mrow><m:msub><m:mi>q</m:mi><m:mrow><m:msub><m:mi>T</m:mi><m:mi>j</m:mi></m:msub></m:mrow></m:msub></m:mrow></m:mstyle></m:mrow><m:annotation encoding="MathType-MTEF">
MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaadaqeWaqaaiabdghaXnaaBaaaleaacqWGubavdaWgaaadbaGaemOAaOgabeaaaSqabaaabaGaemOAaOMaeyypa0JaeGymaedabaGaemyBa0ganiabg+Givdaaaa@37A5@</m:annotation></m:semantics></m:math></inline-formula>. Since the different copies are allowed to exchange temperatures during the simulation, let us define the space of all possible mappings from the <it>m </it>configurations to the <it>m </it>temperatures as <it>temperature space</it>.</p>
            <p>During the simulation, mainly each of the replicated configurations will evolve independently according the underlying MCMC scheme charaterized by the weight Eq. (7) at its current temperature, i.e. according to Eq. (8). In addition to this evolution, every <it>t</it><sub>exchange</sub><it>th </it>step (for each replicated configuration) a flip between two neighboring replicas <it>k </it>and <it>k </it>+ 1 is attempted, i.e. for all <it>k </it>&#8712; {1, ..., <it>m </it>- 1}. If an attempt is successful, the configurations <b>X</b><sup>(<it>k</it>) </sup>and <b>X</b><sup>(<it>k</it>+1) </sup>are exchanged (denoted by <b>X</b><sup>(<it>k</it>) </sup>&#8596; <b>X</b><sup>(<it>k</it>+1)</sup>), i.e. the configurations which has previously evolved at temperature <it>T</it><sub><it>k </it></sub>will now evolve at temperature <it>T</it><sub><it>k </it>+ 1 </sub>and vice versa. This exchange is accepted with the probability</p>
            <p>
               <display-formula id="M10">
                  <m:math name="1748-7188-2-9-i23" xmlns:m="http://www.w3.org/1998/Math/MathML">
                     <m:semantics>
                        <m:mrow>
                           <m:mtable>
                              <m:mtr>
                                 <m:mtd>
                                    <m:mrow>
                                       <m:mover accent="true">
                                          <m:mi>p</m:mi>
                                          <m:mo>&#732;</m:mo>
                                       </m:mover>
                                       <m:mrow>
                                          <m:mo>(</m:mo>
                                          <m:mrow>
                                             <m:msup>
                                                <m:mi>X</m:mi>
                                                <m:mrow>
                                                   <m:mo stretchy="false">(</m:mo>
                                                   <m:mi>k</m:mi>
                                                   <m:mo stretchy="false">)</m:mo>
                                                </m:mrow>
                                             </m:msup>
                                             <m:mo>&#8596;</m:mo>
                                             <m:msup>
                                                <m:mi>X</m:mi>
                                                <m:mrow>
                                                   <m:mo stretchy="false">(</m:mo>
                                                   <m:mi>k</m:mi>
                                                   <m:mo>+</m:mo>
                                                   <m:mn>1</m:mn>
                                                   <m:mo stretchy="false">)</m:mo>
                                                </m:mrow>
                                             </m:msup>
                                          </m:mrow>
                                          <m:mo>)</m:mo>
                                       </m:mrow>
                                       <m:mo>=</m:mo>
                                       <m:mi>max</m:mi>
                                       <m:mo>&#8289;</m:mo>
                                       <m:mrow>
                                          <m:mo>{</m:mo>
                                          <m:mrow>
                                             <m:mn>1</m:mn>
                                             <m:mo>,</m:mo>
                                             <m:mfrac>
                                                <m:mrow>
                                                   <m:msub>
                                                      <m:mi>q</m:mi>
                                                      <m:mrow>
                                                         <m:msub>
                                                            <m:mi>T</m:mi>
                                                            <m:mi>k</m:mi>
                                                         </m:msub>
                                                      </m:mrow>
                                                   </m:msub>
                                                   <m:mo stretchy="false">(</m:mo>
                                                   <m:msup>
                                                      <m:mi>X</m:mi>
                                                      <m:mrow>
                                                         <m:mo stretchy="false">(</m:mo>
                                                         <m:mi>k</m:mi>
                                                         <m:mo>+</m:mo>
                                                         <m:mn>1</m:mn>
                                                         <m:mo stretchy="false">)</m:mo>
                                                      </m:mrow>
                                                   </m:msup>
                                                   <m:mo stretchy="false">)</m:mo>
                                                </m:mrow>
                                                <m:mrow>
                                                   <m:msub>
                                                      <m:mi>q</m:mi>
                                                      <m:mrow>
                                                         <m:msub>
                                                            <m:mi>T</m:mi>
                                                            <m:mi>k</m:mi>
                                                         </m:msub>
                                                      </m:mrow>
                                                   </m:msub>
                                                   <m:mo stretchy="false">(</m:mo>
                                                   <m:msup>
                                                      <m:mi>X</m:mi>
                                                      <m:mrow>
                                                         <m:mo stretchy="false">(</m:mo>
                                                         <m:mi>k</m:mi>
                                                         <m:mo stretchy="false">)</m:mo>
                                                      </m:mrow>
                                                   </m:msup>
                                                   <m:mo stretchy="false">)</m:mo>
                                                </m:mrow>
                                             </m:mfrac>
                                             <m:mo>&#8901;</m:mo>
                                             <m:mfrac>
                                                <m:mrow>
                                                   <m:msub>
                                                      <m:mi>q</m:mi>
                                                      <m:mrow>
                                                         <m:msub>
                                                            <m:mi>T</m:mi>
                                                            <m:mrow>
                                                               <m:mi>k</m:mi>
                                                               <m:mo>+</m:mo>
                                                               <m:mn>1</m:mn>
                                                            </m:mrow>
                                                         </m:msub>
                                                      </m:mrow>
                                                   </m:msub>
                                                   <m:mo stretchy="false">(</m:mo>
                                                   <m:msup>
                                                      <m:mi>X</m:mi>
                                                      <m:mrow>
                                                         <m:mo stretchy="false">(</m:mo>
                                                         <m:mi>k</m:mi>
                                                         <m:mo stretchy="false">)</m:mo>
                                                      </m:mrow>
                                                   </m:msup>
                                                   <m:mo stretchy="false">)</m:mo>
                                                </m:mrow>
                                                <m:mrow>
                                                   <m:msub>
                                                      <m:mi>q</m:mi>
                                                      <m:mrow>
                                                         <m:msub>
                                                            <m:mi>T</m:mi>
                                                            <m:mrow>
                                                               <m:mi>k</m:mi>
                                                               <m:mo>+</m:mo>
                                                               <m:mn>1</m:mn>
                                                            </m:mrow>
                                                         </m:msub>
                                                      </m:mrow>
                                                   </m:msub>
                                                   <m:mo stretchy="false">(</m:mo>
                                                   <m:msup>
                                                      <m:mi>X</m:mi>
                                                      <m:mrow>
                                                         <m:mo stretchy="false">(</m:mo>
                                                         <m:mi>k</m:mi>
                                                         <m:mo>+</m:mo>
                                                         <m:mn>1</m:mn>
                                                         <m:mo stretchy="false">)</m:mo>
                                                      </m:mrow>
                                                   </m:msup>
                                                   <m:mo stretchy="false">)</m:mo>
                                                </m:mrow>
                                             </m:mfrac>
                                          </m:mrow>
                                          <m:mo>}</m:mo>
                                       </m:mrow>
                                    </m:mrow>
                                 </m:mtd>
                              </m:mtr>
                              <m:mtr>
                                 <m:mtd>
                                    <m:mrow>
                                       <m:mo>=</m:mo>
                                       <m:mi>max</m:mi>
                                       <m:mo>&#8289;</m:mo>
                                       <m:mrow>
                                          <m:mo>{</m:mo>
                                          <m:mrow>
                                             <m:mn>1</m:mn>
                                             <m:mo>,</m:mo>
                                             <m:mi>exp</m:mi>
                                             <m:mo>&#8289;</m:mo>
                                             <m:mo stretchy="false">[</m:mo>
                                             <m:mo>&#8722;</m:mo>
                                             <m:mi>&#916;</m:mi>
                                             <m:msub>
                                                <m:mi>&#946;</m:mi>
                                                <m:mi>k</m:mi>
                                             </m:msub>
                                             <m:mi>&#916;</m:mi>
                                             <m:mi>S</m:mi>
                                             <m:mo stretchy="false">]</m:mo>
                                          </m:mrow>
                                          <m:mo>}</m:mo>
                                       </m:mrow>
                                       <m:mo>,</m:mo>
                                    </m:mrow>
                                 </m:mtd>
                              </m:mtr>
                           </m:mtable>
                        </m:mrow>
                        <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaafaqadeGabaaabaGafmiCaaNbaGaadaqadaqaaGqabiab=HfaynaaCaaaleqabaGaeiikaGIaem4AaSMaeiykaKcaaOGaeyiLHSQae8hwaG1aaWbaaSqabeaacqGGOaakcqWGRbWAcqGHRaWkcqaIXaqmcqGGPaqkaaaakiaawIcacaGLPaaacqGH9aqpcyGGTbqBcqGGHbqycqGG4baEdaGadeqaaiabigdaXiabcYcaSmaalaaabaGaemyCae3aaSbaaSqaaiabdsfaunaaBaaameaacqWGRbWAaeqaaaWcbeaakiabcIcaOiab=HfaynaaCaaaleqabaGaeiikaGIaem4AaSMaey4kaSIaeGymaeJaeiykaKcaaOGaeiykaKcabaGaemyCae3aaSbaaSqaaiabdsfaunaaBaaameaacqWGRbWAaeqaaaWcbeaakiabcIcaOiab=HfaynaaCaaaleqabaGaeiikaGIaem4AaSMaeiykaKcaaOGaeiykaKcaaiabgwSixpaalaaabaGaemyCae3aaSbaaSqaaiabdsfaunaaBaaameaacqWGRbWAcqGHRaWkcqaIXaqmaeqaaaWcbeaakiabcIcaOiab=HfaynaaCaaaleqabaGaeiikaGIaem4AaSMaeiykaKcaaOGaeiykaKcabaGaemyCae3aaSbaaSqaaiabdsfaunaaBaaameaacqWGRbWAcqGHRaWkcqaIXaqmaeqaaaWcbeaakiabcIcaOiab=HfaynaaCaaaleqabaGaeiikaGIaem4AaSMaey4kaSIaeGymaeJaeiykaKcaaOGaeiykaKcaaaGaay5Eaiaaw2haaaqaaiabg2da9iGbc2gaTjabcggaHjabcIha4naacmqabaGaeGymaeJaeiilaWIagiyzauMaeiiEaGNaeiiCaaNaei4waSLaeyOeI0IaeuiLdqecciGae4NSdi2aaSbaaSqaaiabdUgaRbqabaGccqqHuoarcqWGtbWucqGGDbqxaiaawUhacaGL9baacqGGSaalaaaaaa@92A4@</m:annotation>
                     </m:semantics>
                  </m:math>
               </display-formula>
            </p>
            <p>where, <inline-formula><m:math name="1748-7188-2-9-i24" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mi>&#916;</m:mi><m:msub><m:mi>&#946;</m:mi><m:mi>k</m:mi></m:msub><m:mo>=</m:mo><m:mfrac><m:mn>1</m:mn><m:mrow><m:msub><m:mi>T</m:mi><m:mrow><m:mi>k</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub></m:mrow></m:mfrac><m:mo>&#8722;</m:mo><m:mfrac><m:mn>1</m:mn><m:mrow><m:msub><m:mi>T</m:mi><m:mi>k</m:mi></m:msub></m:mrow></m:mfrac></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacqqHuoariiGacqWFYoGydaWgaaWcbaGaem4AaSgabeaakiabg2da9maalaaabaGaeGymaedabaGaemivaq1aaSbaaSqaaiabdUgaRjabgUcaRiabigdaXaqabaaaaOGaeyOeI0YaaSaaaeaacqaIXaqmaeaacqWGubavdaWgaaWcbaGaem4AaSgabeaaaaaaaa@3C96@</m:annotation></m:semantics></m:math></inline-formula>, &#916;<it>S </it>= <it>S </it>(<b>X</b><sup>(<it>k </it>+ 1)</sup>) - <it>S </it>(<b>X</b><sup><it>k</it></sup>) and all weights are calculated with the configurations before the flip. This leads to a "random walk in temperature space" of the configurations.</p>
            <p>Note that another possible approach based on Markov chains to compute p-values of a random model with a random variable <it>X</it>, &#8473; [<it>X </it>> <it>b</it>] was introduced by Wilbur <abbrgrp><abbr bid="B45">45</abbr></abbrgrp>. The first step is to sample from an unbiased Markov chain based on the model of interest and compute the median of the (high probability) distribution. In the second iteration the random walk is truncated such that only values larger than the median of the first iteration occur. This corresponds to choosing a lower temperaure <it>T </it>in Eq. (7). The third iteration uses the median of the second iteration and so forth. This is repeated until a fraction of 1/4 of all events lay beyond a certain threshold value leading to a non decreasing sequence of splitting intervals defined by the medians of each iteration. This sequence is used in the second stage of the algorithm, where p-values are computed explicitly by multiplying the p-values of the truncated distribution in each iteration.</p>
            <p>Although this method is easy to implement and errors can be estimated relatively simply, the MCMCMC approach has the advantage that the different configurations are not subjected to a sequence of decreasing temperatures, but perform a random walk in temperature space, i.e. visit all temperatures several times. Thus, mixing is accelerated and hence fewer Monte Carlo steps are required.</p>
         </sec>
         <sec>
            <st>
               <p>Reweighting the mixture</p>
            </st>
            <p>The production run of MCMCMC yield a set of <it>m </it>different chains of lengths <it>n</it><sub><it>j</it></sub>. We denote the <it>ith </it>configuration in the chain of <it>jth </it>temperature as <inline-formula><m:math name="1748-7188-2-9-i25" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msubsup><m:mi>X</m:mi><m:mi>i</m:mi><m:mrow><m:mo stretchy="false">(</m:mo><m:mi>j</m:mi><m:mo stretchy="false">)</m:mo></m:mrow></m:msubsup></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaaieqacqWFybawdaqhaaWcbaGaemyAaKgabaGaeiikaGIaemOAaOMaeiykaKcaaaaa@3282@</m:annotation></m:semantics></m:math></inline-formula>. Of course this leads to a larger parameter range than simple importance reweighting of a single chain, hence Eq. (9) cannot be applied directly to the mixture. Geyer <abbrgrp><abbr bid="B46">46</abbr></abbrgrp> developed a generalization of the importance reweighting formula to mixtures. His idea is based on Eq. (9), where <it>q</it><sub><it>T </it></sub>is replaced by a "mixture weight" <it>q</it><sub>mix</sub>, i.e. (using <it>q</it><sub><it>j </it></sub>&#8801; <inline-formula><m:math name="1748-7188-2-9-i26" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:msub><m:mover accent="true"><m:mi>q</m:mi><m:mo>&#732;</m:mo></m:mover><m:mrow><m:msub><m:mi>T</m:mi><m:mi>j</m:mi></m:msub></m:mrow></m:msub></m:mrow><m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaacuWGXbqCgaacamaaBaaaleaacqWGubavdaWgaaadbaGaemOAaOgabeaaaSqabaaaaa@3118@</m:annotation></m:semantics></m:math></inline-formula>, i.e. <it>q</it><sub><it>j </it></sub>represents the unormalized weights)</p>
            <p>
               <display-formula id="M11">
                  <m:math name="1748-7188-2-9-i27" xmlns:m="http://www.w3.org/1998/Math/MathML">
                     <m:semantics>
                        <m:mrow>
                           <m:msub>
                              <m:mi mathvariant="double-struck">E</m:mi>
                              <m:msup>
                                 <m:mi>T</m:mi>
                                 <m:mo>&#8242;</m:mo>
                              </m:msup>
                           </m:msub>
                           <m:mo stretchy="false">[</m:mo>
                           <m:mi>g</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:mi>X</m:mi>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo stretchy="false">]</m:mo>
                           <m:mo>&#8776;</m:mo>
                           <m:mfrac>
                              <m:mn>1</m:mn>
                              <m:mi>Z</m:mi>
                           </m:mfrac>
                           <m:mstyle displaystyle="true">
                              <m:munderover>
                                 <m:mo>&#8721;</m:mo>
                                 <m:mrow>
                                    <m:mi>j</m:mi>
                                    <m:mo>=</m:mo>
                                    <m:mn>1</m:mn>
                                 </m:mrow>
                                 <m:mi>m</m:mi>
                              </m:munderover>
                              <m:mrow>
                                 <m:mstyle displaystyle="true">
                                    <m:munderover>
                                       <m:mo>&#8721;</m:mo>
                                       <m:mrow>
                                          <m:mi>i</m:mi>
                                          <m:mo>=</m:mo>
                                          <m:mn>1</m:mn>
                                       </m:mrow>
                                       <m:mrow>
                                          <m:msub>
                                             <m:mi>n</m:mi>
                                             <m:mi>j</m:mi>
                                          </m:msub>
                                       </m:mrow>
                                    </m:munderover>
                                    <m:mrow>
                                       <m:mfrac>
                                          <m:mrow>
                                             <m:msub>
                                                <m:mi>q</m:mi>
                                                <m:msup>
                                                   <m:mi>T</m:mi>
                                                   <m:mo>&#8242;</m:mo>
                                                </m:msup>
                                             </m:msub>
                                             <m:mo stretchy="false">(</m:mo>
                                             <m:msubsup>
                                                <m:mi>X</m:mi>
                                                <m:mi>i</m:mi>
                                                <m:mrow>
                                                   <m:mo stretchy="false">(</m:mo>
                                                   <m:mi>j</m:mi>
                                                   <m:mo stretchy="false">)</m:mo>
                                                </m:mrow>
                                             </m:msubsup>
                                             <m:mo stretchy="false">)</m:mo>
                                          </m:mrow>
                                          <m:mrow>
                                             <m:msub>
                                                <m:mi>q</m:mi>
                                                <m:mrow>
                                                   <m:mtext>mix</m:mtext>
                                                </m:mrow>
                                             </m:msub>
                                             <m:mo stretchy="false">(</m:mo>
                                             <m:msubsup>
                                                <m:mi>X</m:mi>
                                                <m:mi>i</m:mi>
                                                <m:mrow>
                                                   <m:mo stretchy="false">(</m:mo>
                                                   <m:mi>j</m:mi>
                                                   <m:mo stretchy="false">)</m:mo>
                                                </m:mrow>
                                             </m:msubsup>
                                             <m:mo stretchy="false">)</m:mo>
                                          </m:mrow>
                                       </m:mfrac>
                                    </m:mrow>
                                 </m:mstyle>
                              </m:mrow>
                           </m:mstyle>
                           <m:mo>&#8901;</m:mo>
                           <m:mi>g</m:mi>
                           <m:mo stretchy="false">(</m:mo>
                           <m:msubsup>
                              <m:mi>X</m:mi>
                              <m:mi>i</m:mi>
                              <m:mrow>
                                 <m:mo stretchy="false">(</m:mo>
                                 <m:mi>j</m:mi>
                                 <m:mo stretchy="false">)</m:mo>
                              </m:mrow>
                           </m:msubsup>
                           <m:mo stretchy="false">)</m:mo>
                           <m:mo>.</m:mo>
                        </m:mrow>
                        <m:annotation encoding="MathType-MTEF">
 MathType@MTEF@5@5@+=feaafiart1ev1aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacH8akY=wiFfYdH8Gipec8Eeeu0xXdbba9frFj0=OqFfea0dXdd9vqai=hGuQ8kuc9pgc9s8qqaq=dirpe0xb9q8qiLsFr0=vr0=vr0dc8meaabaqaciaacaGaaeqabaqabeGadaaakeaatuuDJXwAK1uy0HMmaeHbfv3ySLgzG0uy0HgiuD3BaGabaiab=ri8fnaaBaaaleaacuWGubavgaqbaaqabaGccqGGBbWwcqWGNbWzcqGGOaakieqacqGFybawcqGGPaqkcqGGDbqxcqGHijYUdaWcaaqaaiabigdaXaqaaiabdQfaAbaadaaeWbqaamaaqahabaWaaSaaaeaacqWGXbqCdaWgaaWcbaGafmivaqLbauaaaeqaaOGaeiikaGIae4hwaG1aa0baaSqaaiabdMgaPbqaaiabcIcaOiabdQgaQjabcMcaPaaakiabcMcaPaqaaiabdghaXnaaBaaaleaacqqGTbqBcqqGPbqAcqqG4baEaeqaaOGaeiikaGIae4hwaG1aa0baaSqaaiabdMgaPbqaaiabcIcaOiabdQgaQjabcMcaPaaakiabcMcaPaaaaSqaaiabdMgaPjabg2da9iabigdaXaqaaiabd6gaUnaaBaaameaacqWGQbGAaeqaaaqdcqGHris5aaWcbaGaemOAaOMaeyypa0JaeGymaedabaGaemyBa0ganiabggHiLdGccqGHflY1cqWGNbWzcqGGOaakcqGFybawdaqhaaWcbaGaemyAaKgabaGaeiikaGIaemOAaOMaeiykaKcaaOGaeiykaKIaeiOla4caaa@7812@</m:annotation>
                     </m:semantics>
                  </m:math>
               </display-formula>
            </p>
            <p>The (global) normalization constant is given by <inline-formula><m:math name="1748-7188-2-9-i28" xmlns:m="http://www.w3.org/1998/Math/MathML"><m:semantics><m:mrow><m:mi>Z</m:mi><m:mo>=</m:mo><m:mstyle displaystyle="true"><m:msubsup><m:mo>&#8721;</m:mo><m:mrow><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:mi>m</m:mi></m:msubsup><m:mrow><m:mstyle displaystyle="true"><m:msubsup><m:mo>&