<?xml-stylesheet type="text/xsl" href="../styles/pmathml.xsl"?>
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dsi="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xml:space="preserve"><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"/><title>G07BBF : NAG Library, Mark 22</title><link rel="stylesheet" href="../styles/libdoc.css" type="text/css"/><script type="text/javascript">
   function showLevel(_levelId){
    var thisLevel = document.getElementById(_levelId);
    var thisplus = document.getElementById( _levelId.concat('plus'));
    var thisminus = document.getElementById( _levelId.concat('minus'));
    if(thisLevel.style.display != "block"){
     thisLevel.style.display = "block";
     thisplus.style.display = "none";
     thisminus.style.display = "inline";
     }
    else{
     thisLevel.style.display = "none";
     thisminus.style.display = "none";
     thisplus.style.display = "inline";
     }
    }
  </script></head><body><hr/><div><a class="rout" href="../../pdf/G07/g07bbf.pdf">G07BBF (PDF version)</a></div><div><a class="chap" href="g07conts.xml">G07 Chapter Contents</a></div><div><a class="chapint" href="g07intro.xml">G07 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div><hr/><h1 class="libdoc">NAG Library Routine Document<br/><br/>G07BBF</h1><div class="paramtext"><div class="header"><b>Note:</b>&#160; before using this routine, please read the Users' Note for your implementation to check the interpretation of <span class="bitalic">bold italicised</span> terms and other implementation-dependent details.</div></div> 
<div class="htmltoc">
<h2 class="htmltoc"><span class="htmltochead" onclick="showLevel('htmltoc');"><span class="htmltocplus" id="htmltocplus">+</span><span class="htmltocminus" id="htmltocminus">&#8722;</span></span>&#160;Contents</h2>
<div class="htmltocitem" id="htmltoc">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#purpose">1&#160;&#160;<b>Purpose</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#specification">2&#160;&#160;<b>Specification</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#description">3&#160;&#160;<b>Description</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#references">4&#160;&#160;<b>References</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#parameters">5&#160;&#160;<b>Parameters</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#errors">6&#160;&#160;<b>Error Indicators and Warnings</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#accuracy">7&#160;&#160;<b>Accuracy</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments">8&#160;&#160;<b>Further Comments</b></a>
</div><div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocexample');"><span class="htmltocplus" id="tocexampleplus">+</span><span class="htmltocminus" id="tocexampleminus">&#8722;</span></span>
<a class="htmltoc" href="#example">9&#160;&#160;<b>Example</b></a>
<div class="htmltocitem" id="tocexample">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examtext">9.1&#160;&#160;<b>Program Text</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examdata">9.2&#160;&#160;<b>Program Data</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examresults">9.3&#160;&#160;<b>Program Results</b></a>
</div>
</div>
</div>
</div>
</div><h2 class="standard"><a class="sec" name="purpose" id="purpose"/>1&#160;&#160;Purpose</h2>
<div class="paramtext">G07BBF computes maximum likelihood estimates and their standard errors for parameters of the Normal distribution from grouped and/or censored data.</div><h2 class="standard"><a class="sec" name="specification" id="specification"/>2&#160;&#160;Specification</h2>
<table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;G07BBF&#160;(</td><td class="tdfspec2"><a class="arg" href="#METHOD">METHOD</a>, <a class="arg" href="#N">N</a>, <a class="arg" href="#X">X</a>, <a class="arg" href="#XC">XC</a>, <a class="arg" href="#IC">IC</a>, <a class="arg" href="#XMU">XMU</a>, <a class="arg" href="#XSIG">XSIG</a>, <a class="arg" href="#TOL">TOL</a>, <a class="arg" href="#MAXIT">MAXIT</a>, <a class="arg" href="#SEXMU">SEXMU</a>, <a class="arg" href="#SEXSIG">SEXSIG</a>, <a class="arg" href="#CORR">CORR</a>, <a class="arg" href="#DEV">DEV</a>, <a class="arg" href="#NOBS">NOBS</a>, <a class="arg" href="#NIT">NIT</a>, <a class="arg" href="#WK">WK</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">N, IC(N), MAXIT, NOBS(4), NIT, IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">X(N), XC(N), XMU, XSIG, TOL, SEXMU, SEXSIG, CORR, DEV, WK(2*N)</td></tr><tr><td class="tdfspec1">CHARACTER*1</td><td class="tdfspec2">METHOD</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">A sample of size <m:math><m:mi>n</m:mi></m:math>&#160;is taken from a Normal distribution with mean <m:math><m:mi>&#956;</m:mi></m:math>&#160;and variance <m:math><m:msup><m:mi>&#963;</m:mi><m:mn>2</m:mn></m:msup></m:math>&#160;and consists of grouped and/or censored data.  Each of the <m:math><m:mi>n</m:mi></m:math>&#160;observations is known by a pair of values <m:math><m:mfenced separators=""><m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:math>&#160;such that:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>&#8804;</m:mo><m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

The data is represented as particular cases of this form:
<ul class="listind"><li class="listind">exactly specified observations occur when <m:math><m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo><m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>,</li><li class="listind">right-censored observations, known only by a lower bound, occur when <m:math><m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub><m:mo>&#8594;</m:mo><m:mi>&#8734;</m:mi></m:math>,</li><li class="listind">left-censored observations, known only by a upper bound, occur when <m:math><m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub><m:mo>&#8594;</m:mo><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow></m:math>,</li><li class="listind">and interval-censored observations when <m:math><m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub><m:mo>&lt;</m:mo><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>&lt;</m:mo><m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub></m:math>.</li></ul>
</div><div class="paramtext">Let the set <m:math><m:mi>A</m:mi></m:math>&#160;identify the exactly specified observations, sets <m:math><m:mi>B</m:mi></m:math>&#160;and <m:math><m:mi>C</m:mi></m:math>&#160;identify the observations censored on the right and left respectively, and set <m:math><m:mi>D</m:mi></m:math>&#160;identify the observations confined between two finite limits.  Also let there be <m:math><m:mi>r</m:mi></m:math>&#160;exactly specified observations, i.e., the number in <m:math><m:mi>A</m:mi></m:math>.  The probability density function for the standard Normal distribution is

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>Z</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>=</m:mo><m:mfrac><m:mn>1</m:mn><m:msqrt><m:mn>2</m:mn><m:mi>&#960;</m:mi></m:msqrt></m:mfrac><m:mrow><m:mi>exp</m:mi><m:mfenced separators=""><m:mo>-</m:mo><m:mfrac other="small"><m:mn>1</m:mn><m:mn>2</m:mn></m:mfrac><m:msup><m:mi>x</m:mi><m:mn>2</m:mn></m:msup></m:mfenced></m:mrow>
<m:mtext>, &#8195;</m:mtext><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow><m:mo>&lt;</m:mo><m:mi>x</m:mi><m:mo>&lt;</m:mo><m:mi>&#8734;</m:mi>
</m:math></td><td class="formula2"/></tr></table></div>

and the cumulative distribution function is

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>P</m:mi><m:mfenced separators=""><m:mi>X</m:mi></m:mfenced><m:mo>=</m:mo> <m:mn>1</m:mn><m:mo>-</m:mo><m:mi>Q</m:mi><m:mfenced separators=""><m:mi>X</m:mi></m:mfenced><m:mo>=</m:mo><m:munderover><m:mo>&#8747;</m:mo><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow><m:mi>X</m:mi></m:munderover><m:mi>Z</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

The log-likelihood of the sample can be written as:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>L</m:mi>
 <m:mfenced separators=""><m:mi>&#956;</m:mi><m:mo>,</m:mo><m:mi>&#963;</m:mi></m:mfenced>
 <m:mo>=</m:mo><m:mo>-</m:mo><m:mi>r</m:mi>
 <m:mrow><m:mi>log</m:mi><m:mo>&#8289;</m:mo><m:mi>&#963;</m:mi></m:mrow>
 <m:mo>-</m:mo><m:mfrac other="small">
  <m:mn>1</m:mn>
  <m:mn>2</m:mn>
 </m:mfrac>
 <m:msub>
  <m:mo>&#8721;</m:mo>
  <m:mi>A</m:mi>
 </m:msub>
 <m:msup>
  <m:mfenced open="{" close="}" separators="">
   <m:mfenced separators="">
    <m:msub>
     <m:mi>x</m:mi>
     <m:mi>i</m:mi>
    </m:msub>
    <m:mo>-</m:mo><m:mi>&#956;</m:mi>
   </m:mfenced>
   <m:mo>/</m:mo>
   <m:mi>&#963;</m:mi> 
  </m:mfenced>
  <m:mn>2</m:mn>
 </m:msup>
 <m:mo>+</m:mo><m:msub><m:mo>&#8721;</m:mo><m:mi>B</m:mi></m:msub>
 <m:mrow><m:mi>log</m:mi><m:mfenced separators="">
   <m:mi>Q</m:mi>
   <m:mfenced separators="">
    <m:msub>
     <m:mi>l</m:mi>
     <m:mi>i</m:mi>
    </m:msub>
   </m:mfenced>
  </m:mfenced></m:mrow>
 <m:mo>+</m:mo><m:msub>
  <m:mo>&#8721;</m:mo>
  <m:mi>C</m:mi>
 </m:msub>
 <m:mrow><m:mi>log</m:mi><m:mfenced separators="">
   <m:mi>P</m:mi>
   <m:mfenced separators="">
    <m:msub>
     <m:mi>u</m:mi>
     <m:mi>i</m:mi>
    </m:msub>
   </m:mfenced>
  </m:mfenced></m:mrow>
 <m:mo>+</m:mo><m:msub>
  <m:mo>&#8721;</m:mo>
  <m:mi>D</m:mi>
 </m:msub>
 <m:mrow><m:mi>log</m:mi><m:mfenced separators="">
   <m:msub>
    <m:mi>p</m:mi>
    <m:mi>i</m:mi>
   </m:msub>
  </m:mfenced></m:mrow>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:msub><m:mi>p</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo><m:mi>P</m:mi><m:mfenced separators=""><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>-</m:mo><m:mi>P</m:mi><m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:math>&#160;and <m:math><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo><m:mfenced separators=""><m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub><m:mo>-</m:mo><m:mi>&#956;</m:mi></m:mfenced><m:mo>/</m:mo><m:mi>&#963;</m:mi><m:mtext>, &#8195;</m:mtext><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo><m:mfenced separators=""><m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub><m:mo>-</m:mo><m:mi>&#956;</m:mi></m:mfenced><m:mo>/</m:mo><m:mi>&#963;</m:mi></m:math>.</div><div class="paramtext">Let

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>S</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>=</m:mo><m:mfrac><m:mrow><m:mi>Z</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:mrow>
  <m:mrow><m:mi>Q</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:mrow>
 </m:mfrac><m:mtext>, &#8195;</m:mtext><m:msub><m:mi>S</m:mi><m:mn>1</m:mn></m:msub><m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>=</m:mo><m:mfrac><m:mrow><m:mi>Z</m:mi><m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>-</m:mo><m:mi>Z</m:mi><m:mfenced separators=""><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:mrow><m:msub><m:mi>p</m:mi><m:mi>i</m:mi></m:msub></m:mfrac>
</m:math></td><td class="formula2"/></tr></table></div>


and

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msub><m:mi>S</m:mi><m:mn>2</m:mn></m:msub><m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>=</m:mo><m:mfrac><m:mrow><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub><m:mi>Z</m:mi><m:mfenced separators=""><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>-</m:mo><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub><m:mi>Z</m:mi><m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:mrow><m:msub><m:mi>p</m:mi><m:mi>i</m:mi></m:msub></m:mfrac><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

then the first derivatives of the log-likelihood can be written as:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>L</m:mi><m:mfenced separators=""><m:mi>&#956;</m:mi><m:mo>,</m:mo><m:mi>&#963;</m:mi></m:mfenced></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>&#956;</m:mi></m:mrow>
 </m:mfrac><m:mo>=</m:mo><m:msub><m:mi>L</m:mi><m:mn>1</m:mn></m:msub><m:mfenced separators=""><m:mi>&#956;</m:mi><m:mo>,</m:mo><m:mi>&#963;</m:mi></m:mfenced><m:mo>=</m:mo><m:msup><m:mi>&#963;</m:mi><m:mrow><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:msup><m:msub><m:mo>&#8721;</m:mo><m:mi>A</m:mi></m:msub><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>-</m:mo><m:mi>&#956;</m:mi></m:mfenced><m:mo>+</m:mo><m:msup><m:mi>&#963;</m:mi><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msup><m:msub><m:mo>&#8721;</m:mo><m:mi>B</m:mi></m:msub><m:mi>S</m:mi><m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>-</m:mo><m:msup><m:mi>&#963;</m:mi><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msup><m:msub><m:mo>&#8721;</m:mo><m:mi>C</m:mi></m:msub><m:mi>S</m:mi><m:mfenced separators=""><m:mo>-</m:mo><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>+</m:mo><m:msup><m:mi>&#963;</m:mi><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msup><m:msub><m:mo>&#8721;</m:mo><m:mi>D</m:mi></m:msub><m:msub><m:mi>S</m:mi><m:mn>1</m:mn></m:msub><m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced>
</m:math></td><td class="formula2"/></tr></table></div>

and

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mfrac other="display">
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>L</m:mi><m:mfenced separators=""><m:mi>&#956;</m:mi><m:mo>,</m:mo><m:mi>&#963;</m:mi></m:mfenced></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>&#963;</m:mi></m:mrow>
 </m:mfrac><m:mo>=</m:mo><m:msub><m:mi>L</m:mi><m:mn>2</m:mn></m:msub><m:mfenced separators=""><m:mi>&#956;</m:mi><m:mo>,</m:mo><m:mi>&#963;</m:mi></m:mfenced><m:mo>=</m:mo><m:mo>-</m:mo><m:mi>r</m:mi><m:msup><m:mi>&#963;</m:mi><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msup><m:mo>+</m:mo><m:msup><m:mi>&#963;</m:mi><m:mrow><m:mo>-</m:mo><m:mn>3</m:mn></m:mrow></m:msup><m:msub><m:mo>&#8721;</m:mo><m:mi>A</m:mi></m:msub><m:msup>
<m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>-</m:mo><m:mi>&#956;</m:mi></m:mfenced>
<m:mn>2</m:mn></m:msup><m:mo>+</m:mo><m:msup><m:mi>&#963;</m:mi><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msup><m:msub><m:mo>&#8721;</m:mo><m:mi>B</m:mi></m:msub><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub><m:mi>S</m:mi><m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>-</m:mo><m:msup><m:mi>&#963;</m:mi><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msup><m:msub><m:mo>&#8721;</m:mo><m:mi>C</m:mi></m:msub><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub><m:mi>S</m:mi><m:mfenced separators=""><m:mo>-</m:mo><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced>
</m:math></td><td class="formula2"/></tr></table></div><div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block"><m:mo>-</m:mo><m:msup><m:mi>&#963;</m:mi><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msup><m:msub><m:mo>&#8721;</m:mo><m:mi>D</m:mi></m:msub><m:msub><m:mi>S</m:mi><m:mn>2</m:mn></m:msub><m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced>
</m:math></td><td class="formula2"/></tr></table></div>

The maximum likelihood estimates, <m:math><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover></m:math>&#160;and <m:math><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover></m:math>, are the solution to the equations:

<div class="formula-eqn"><a name="eqn1" id="eqn1"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block">
<m:msub><m:mi>L</m:mi><m:mn>1</m:mn></m:msub><m:mfenced separators=""><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover><m:mo>,</m:mo><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover></m:mfenced><m:mo>=</m:mo><m:mn>0</m:mn>
</m:math></td><td class="formula-eqn2">
      (1)
     </td></tr></table></div>

and

<div class="formula-eqn"><a name="eqn2" id="eqn2"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block">
<m:msub><m:mi>L</m:mi><m:mn>2</m:mn></m:msub><m:mfenced separators=""><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover><m:mo>,</m:mo><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover></m:mfenced><m:mo>=</m:mo><m:mn>0</m:mn>
</m:math></td><td class="formula-eqn2">
      (2)
     </td></tr></table></div>

and if the second derivatives <m:math>
 <m:mfrac other="display">
  <m:mrow><m:msup><m:mo>&#8706;</m:mo><m:mn>2</m:mn></m:msup>
<m:mi>L</m:mi></m:mrow>
  <m:mrow><m:msup><m:mo>&#8706;</m:mo><m:mn>2</m:mn></m:msup>
<m:mi>&#956;</m:mi></m:mrow>
 </m:mfrac>
</m:math>, <m:math>
 <m:mfrac other="display">
  <m:mrow><m:msup><m:mo>&#8706;</m:mo><m:mn>2</m:mn></m:msup>
<m:mi>L</m:mi></m:mrow>
  <m:mrow><m:mrow><m:mo>&#8706;</m:mo><m:mi>&#956;</m:mi></m:mrow>
  <m:mrow><m:mo>&#8706;</m:mo><m:mi>&#963;</m:mi></m:mrow></m:mrow>
 </m:mfrac>
</m:math>&#160;and <m:math>
 <m:mfrac other="display">
  <m:mrow><m:msup><m:mo>&#8706;</m:mo><m:mn>2</m:mn></m:msup><m:mi>L</m:mi></m:mrow>
  <m:mrow><m:msup><m:mo>&#8706;</m:mo><m:mn>2</m:mn></m:msup><m:mi>&#963;</m:mi></m:mrow>
 </m:mfrac>
</m:math>&#160;are denoted by <m:math><m:msub><m:mi>L</m:mi><m:mn>11</m:mn></m:msub></m:math>, <m:math><m:msub><m:mi>L</m:mi><m:mn>12</m:mn></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>L</m:mi><m:mn>22</m:mn></m:msub></m:math>&#160;respectively, then estimates of the standard errors of <m:math><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover></m:math>&#160;and <m:math><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover></m:math>&#160;are given by:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mrow><m:mi>se</m:mi><m:mfenced separators=""><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover></m:mfenced></m:mrow><m:mo>=</m:mo><m:msqrt><m:mfrac><m:mrow><m:mo>-</m:mo><m:msub><m:mi>L</m:mi><m:mn>22</m:mn></m:msub></m:mrow>
  <m:mrow><m:msub><m:mi>L</m:mi><m:mn>11</m:mn></m:msub><m:msub><m:mi>L</m:mi><m:mn>22</m:mn></m:msub><m:mo>-</m:mo><m:msubsup><m:mi>L</m:mi><m:mn>12</m:mn><m:mn>2</m:mn></m:msubsup></m:mrow>
 </m:mfrac></m:msqrt><m:mtext>, &#8195;</m:mtext><m:mrow><m:mi>se</m:mi><m:mfenced separators=""><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover></m:mfenced></m:mrow><m:mo>=</m:mo><m:msqrt><m:mfrac><m:mrow><m:mo>-</m:mo><m:msub><m:mi>L</m:mi><m:mn>11</m:mn></m:msub></m:mrow>
  <m:mrow><m:msub><m:mi>L</m:mi><m:mn>11</m:mn></m:msub><m:msub><m:mi>L</m:mi><m:mn>22</m:mn></m:msub><m:mo>-</m:mo><m:msubsup><m:mi>L</m:mi><m:mn>12</m:mn><m:mn>2</m:mn></m:msubsup></m:mrow>
 </m:mfrac></m:msqrt>
</m:math></td><td class="formula2"/></tr></table></div>

and an estimate of the correlation of <m:math><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover></m:math>&#160;and <m:math><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover></m:math>&#160;is given by:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mfrac><m:msub><m:mi>L</m:mi><m:mn>12</m:mn></m:msub><m:msqrt><m:msub><m:mi>L</m:mi><m:mn>12</m:mn></m:msub><m:msub><m:mi>L</m:mi><m:mn>22</m:mn></m:msub></m:msqrt>
 </m:mfrac><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

To obtain the maximum likelihood estimates the equations <a class="eqn" href="#eqn1">(1)</a> and <a class="eqn" href="#eqn2">(2)</a> can be solved using either the Newton&#8211;Raphson method or the Expectation-maximization <m:math><m:mfenced separators=""><m:mi>E</m:mi><m:mi>M</m:mi></m:mfenced></m:math>&#160;algorithm of <a class="ref" href="#ref410">Dempster <span class="italic">et al.</span> (1977)</a>.</div><div class="paramtext"><b>Newton&#8211;Raphson Method</b></div><div class="paramtext">This consists of using approximate estimates <m:math><m:mover><m:mi>&#956;</m:mi><m:mo>~</m:mo></m:mover></m:math>&#160;and <m:math><m:mover><m:mi>&#963;</m:mi><m:mo>~</m:mo></m:mover></m:math>&#160;to obtain improved estimates <m:math><m:mover><m:mi>&#956;</m:mi><m:mo>~</m:mo></m:mover><m:mo>+</m:mo><m:mi>&#948;</m:mi><m:mover><m:mi>&#956;</m:mi><m:mo>~</m:mo></m:mover></m:math>&#160;and <m:math><m:mover><m:mi>&#963;</m:mi><m:mo>~</m:mo></m:mover><m:mo>+</m:mo><m:mi>&#948;</m:mi><m:mover><m:mi>&#963;</m:mi><m:mo>~</m:mo></m:mover></m:math>&#160;by solving

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mtable columnalign="left">
 <m:mtr>
  <m:mtd><m:mi>&#948;</m:mi><m:mover><m:mi>&#956;</m:mi><m:mo>~</m:mo></m:mover><m:msub><m:mi>L</m:mi><m:mn>11</m:mn></m:msub><m:mo>+</m:mo><m:mi>&#948;</m:mi><m:mover><m:mi>&#963;</m:mi><m:mo>~</m:mo></m:mover><m:msub><m:mi>L</m:mi><m:mn>12</m:mn></m:msub><m:mo>+</m:mo><m:msub><m:mi>L</m:mi><m:mn>1</m:mn></m:msub><m:mo>=</m:mo><m:mn>0</m:mn><m:mtext>,</m:mtext></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd/></m:mtr><m:mtr>
  <m:mtd><m:mi>&#948;</m:mi><m:mover><m:mi>&#956;</m:mi><m:mo>~</m:mo></m:mover><m:msub><m:mi>L</m:mi><m:mn>12</m:mn></m:msub><m:mo>+</m:mo><m:mi>&#948;</m:mi><m:mover><m:mi>&#963;</m:mi><m:mo>~</m:mo></m:mover><m:msub><m:mi>L</m:mi><m:mn>22</m:mn></m:msub><m:mo>+</m:mo><m:msub><m:mi>L</m:mi><m:mn>2</m:mn></m:msub><m:mo>=</m:mo><m:mn>0</m:mn><m:mtext>,</m:mtext></m:mtd>
 </m:mtr>
</m:mtable>
</m:math></td><td class="formula2"/></tr></table></div>

for the corrections <m:math><m:mi>&#948;</m:mi><m:mover><m:mi>&#956;</m:mi><m:mo>~</m:mo></m:mover></m:math>&#160;and <m:math><m:mi>&#948;</m:mi><m:mover><m:mi>&#963;</m:mi><m:mo>~</m:mo></m:mover></m:math>.</div><div class="paramtext"><b>EM Algorithm</b></div><div class="paramtext">The expectation step consists of constructing the variable <m:math><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;as follows:

<div class="formula-eqn"><a name="eqn3" id="eqn3"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block">
 <m:mtext>if &#8195;</m:mtext> 
 <m:mi>i</m:mi><m:mo>&#8712;</m:mo><m:mi>A</m:mi><m:mtext>, &#8195;</m:mtext> 
 <m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo>
 <m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub>
 <m:mphantom>
  <m:mi>E</m:mi>
  <m:mfenced separators=""><m:mo>&#8739;</m:mo>
   <m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub><m:mo>&lt;</m:mo>
   <m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>&lt;</m:mo>
   <m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub>
  </m:mfenced><m:mo>=</m:mo> 
  <m:mi>&#956;</m:mi><m:mo>+</m:mo><m:mi>&#963;</m:mi> 
  <m:msub><m:mi>S</m:mi><m:mn>1</m:mn></m:msub>
  <m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced>
 </m:mphantom>
</m:math></td><td class="formula-eqn2">
      (3)
     </td></tr></table></div><div class="formula-eqn"><a name="eqn4" id="eqn4"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block">
 <m:mtext>if &#8195;</m:mtext> 
 <m:mi>i</m:mi><m:mo>&#8712;</m:mo><m:mi>B</m:mi><m:mtext>, &#8195;</m:mtext> 
 <m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo>
 <m:mi>E</m:mi>
 <m:mfenced separators="">
  <m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>&#8739;</m:mo> 
  <m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>&gt;</m:mo>
  <m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub>
 </m:mfenced><m:mo>=</m:mo><m:mi>&#956;</m:mi><m:mo>+</m:mo><m:mi>&#963;</m:mi><m:mi>S</m:mi>
 <m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub></m:mfenced> 
 <m:mphantom>
  <m:msub><m:mi>S</m:mi><m:mn>1</m:mn></m:msub>
  <m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced>
 </m:mphantom>
</m:math></td><td class="formula-eqn2">
      (4)
     </td></tr></table></div><div class="formula-eqn"><a name="eqn5" id="eqn5"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block">
 <m:mtext>if &#8195;</m:mtext> 
 <m:mi>i</m:mi><m:mo>&#8712;</m:mo><m:mi>C</m:mi><m:mtext>, &#8195;</m:mtext> 
 <m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo> 
 <m:mi>E</m:mi>
 <m:mfenced separators="">
  <m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>&#8739;</m:mo> 
  <m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>&lt;</m:mo> 
  <m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub>
 </m:mfenced><m:mo>=</m:mo><m:mi>&#956;</m:mi><m:mo>-</m:mo><m:mi>&#963;</m:mi><m:mi>S</m:mi>
 <m:mfenced separators=""><m:mo>-</m:mo><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced> 
 <m:mphantom>
  <m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced>
 </m:mphantom>
</m:math></td><td class="formula-eqn2">
      (5)
     </td></tr></table></div><div class="formula-eqn"><a name="eqn6" id="eqn6"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block">
 <m:mtext>if &#8195;</m:mtext> 
 <m:mi>i</m:mi><m:mo>&#8712;</m:mo><m:mi>D</m:mi><m:mtext>, &#8195;</m:mtext> 
 <m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo> 
 <m:mi>E</m:mi>
 <m:mfenced separators="">
  <m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>&#8739;</m:mo>
  <m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub><m:mo>&lt;</m:mo>
  <m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>&lt;</m:mo>
  <m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub>
 </m:mfenced><m:mo>=</m:mo><m:mi>&#956;</m:mi><m:mo>+</m:mo><m:mi>&#963;</m:mi> 
 <m:msub><m:mi>S</m:mi><m:mn>1</m:mn></m:msub>
 <m:mfenced separators=""><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:mfenced>
</m:math></td><td class="formula-eqn2">
      (6)
     </td></tr></table></div>

the maximization step consists of substituting <a class="eqn" href="#eqn3">(3)</a>, <a class="eqn" href="#eqn4">(4)</a>, <a class="eqn" href="#eqn5">(5)</a> and <a class="eqn" href="#eqn6">(6)</a> into <a class="eqn" href="#eqn1">(1)</a> and <a class="eqn" href="#eqn2">(2)</a> giving:

<div class="formula-eqn"><a name="eqn7" id="eqn7"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block">
<m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover><m:mo>=</m:mo><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:msub><m:mover><m:mi>w</m:mi><m:mo>^</m:mo></m:mover><m:mi>i</m:mi></m:msub><m:mo>/</m:mo><m:mi>n</m:mi>
</m:math></td><td class="formula-eqn2">
      (7)
     </td></tr></table></div>

and

<div class="formula-eqn"><a name="eqn8" id="eqn8"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math display="block">
<m:msup><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover><m:mn>2</m:mn></m:msup><m:mo>=</m:mo><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:msup><m:mfenced separators=""><m:msub><m:mover><m:mi>w</m:mi><m:mo>^</m:mo></m:mover><m:mi>i</m:mi></m:msub><m:mo>-</m:mo><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover></m:mfenced><m:mn>2</m:mn></m:msup><m:mo>/</m:mo>
<m:mfenced open="{" close="}" separators=""><m:mi>r</m:mi><m:mo>+</m:mo><m:msub><m:mo>&#8721;</m:mo><m:mi>B</m:mi></m:msub><m:mi>T</m:mi><m:mfenced separators=""><m:msub><m:mover><m:mi>l</m:mi><m:mo>^</m:mo></m:mover><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>+</m:mo><m:msub><m:mo>&#8721;</m:mo><m:mi>C</m:mi></m:msub><m:mi>T</m:mi><m:mfenced separators=""><m:mo>-</m:mo><m:msub><m:mover><m:mi>u</m:mi><m:mo>^</m:mo></m:mover><m:mi>i</m:mi></m:msub></m:mfenced><m:mo>+</m:mo><m:msub><m:mo>&#8721;</m:mo><m:mi>D</m:mi></m:msub><m:msub><m:mi>T</m:mi><m:mn>1</m:mn></m:msub><m:mfenced separators=""><m:msub><m:mover><m:mi>l</m:mi><m:mo>^</m:mo></m:mover><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mover><m:mi>u</m:mi><m:mo>^</m:mo></m:mover><m:mi>i</m:mi></m:msub></m:mfenced></m:mfenced>
</m:math></td><td class="formula-eqn2">
      (8)
     </td></tr></table></div>

where

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>T</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>=</m:mo><m:mi>S</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mfenced open="{" close="}" separators=""><m:mi>S</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>-</m:mo><m:mi>x</m:mi></m:mfenced> <m:mtext>, &#8195;</m:mtext> <m:msub><m:mi>T</m:mi><m:mn>1</m:mn></m:msub><m:mfenced separators=""><m:mi>l</m:mi><m:mo>,</m:mo><m:mi>u</m:mi></m:mfenced><m:mo>=</m:mo><m:msubsup><m:mi>S</m:mi><m:mn>1</m:mn><m:mn>2</m:mn></m:msubsup><m:mfenced separators=""><m:mi>l</m:mi><m:mo>,</m:mo><m:mi>u</m:mi></m:mfenced><m:mo>+</m:mo><m:msub><m:mi>S</m:mi><m:mn>2</m:mn></m:msub><m:mfenced separators=""><m:mi>l</m:mi><m:mo>,</m:mo><m:mi>u</m:mi></m:mfenced>
</m:math></td><td class="formula2"/></tr></table></div>

and where <m:math><m:msub><m:mover><m:mi>w</m:mi><m:mo>^</m:mo></m:mover><m:mi>i</m:mi></m:msub></m:math>,
<m:math><m:msub><m:mover><m:mi>l</m:mi><m:mo>^</m:mo></m:mover><m:mi>i</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mover><m:mi>u</m:mi><m:mo>^</m:mo></m:mover><m:mi>i</m:mi></m:msub></m:math>&#160;are <m:math><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub></m:math>,
<m:math><m:msub><m:mi>l</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>u</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;evaluated at <m:math><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover></m:math>&#160;and <m:math><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover></m:math>.  Equations <a class="eqn" href="#eqn3">(3)</a> to <a class="eqn" href="#eqn8">(8)</a> are the basis of the <m:math><m:mi>E</m:mi><m:mi>M</m:mi></m:math>&#160;iterative procedure for finding <m:math><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover></m:math>&#160;and <m:math><m:msup><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover><m:mn>2</m:mn></m:msup></m:math>.  The procedure consists of alternately estimating <m:math><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover></m:math>&#160;and <m:math><m:msup><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover><m:mn>2</m:mn></m:msup></m:math>&#160;using
<a class="eqn" href="#eqn7">(7)</a> and <a class="eqn" href="#eqn8">(8)</a> and estimating <m:math><m:mfenced open="{" close="}" separators=""><m:msub><m:mover><m:mi>w</m:mi><m:mo>^</m:mo></m:mover><m:mi>i</m:mi></m:msub></m:mfenced></m:math>&#160;using <a class="eqn" href="#eqn3">(3)</a> to <a class="eqn" href="#eqn6">(6)</a>.</div><div class="paramtext">In choosing between the two methods a general rule is that the Newton&#8211;Raphson method converges more quickly but requires good initial estimates whereas the <m:math><m:mi>E</m:mi><m:mi>M</m:mi></m:math>&#160;algorithm converges slowly but is robust to the initial values.  In the case of the censored Normal distribution, if only a small proportion of the observations are censored then estimates based on the exact observations should give good enough initial estimates for the Newton&#8211;Raphson method to be used.  If there are a high proportion of censored observations then the <m:math><m:mi>E</m:mi><m:mi>M</m:mi></m:math>&#160;algorithm should be used and if high accuracy is required the subsequent use of the Newton&#8211;Raphson method to refine the estimates obtained from the <m:math><m:mi>E</m:mi><m:mi>M</m:mi></m:math>&#160;algorithm should be considered.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref410" id="ref410"/>Dempster A P, Laird N M and Rubin D B (1977)  Maximum likelihood from incomplete data via the <m:math><m:mrow><m:mi>E</m:mi><m:mi>M</m:mi></m:mrow></m:math>&#160;algorithm (with discussion) <i>J. Roy. Statist. Soc. Ser. B</i> <b>39</b> 1&#8211;38 </div>
<div class="paramtext"><a name="ref411" id="ref411"/>Swan A V (1969)  Algorithm AS 16. Maximum likelihood estimation from grouped and censored normal data <i>Appl. Statist.</i> <b>18</b> 110&#8211;114 </div>
<div class="paramtext"><a name="ref412" id="ref412"/>Wolynetz M S (1979)  Maximum likelihood estimation from confined and censored normal data <i>Appl. Statist.</i> <b>28</b> 185&#8211;195 </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="METHOD" id="METHOD"/>1: &#160;&#160;&#8194; METHOD &#8211; CHARACTER*1<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: indicates whether the Newton&#8211;Raphson or <m:math><m:mi>E</m:mi><m:mi>M</m:mi></m:math>&#160;algorithm should be used.
<ul class="listind"><li class="listind">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#METHOD"><m:mi mathcolor="#EE0000" mathvariant="bold">METHOD</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math>, then the Newton&#8211;Raphson algorithm is used.</li><li class="listind">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#METHOD"><m:mi mathcolor="#EE0000" mathvariant="bold">METHOD</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'E'</m:mtext></m:math>, then the <m:math><m:mi>E</m:mi><m:mi>M</m:mi></m:math>&#160;algorithm is used.</li></ul>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#METHOD"><m:mi mathcolor="#EE0000" mathvariant="bold">METHOD</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math>&#160;or <m:math><m:mtext>'E'</m:mtext></m:math>.
</div></dd><dt class="paramhead"><a name="N" id="N"/>2: &#160;&#160;&#8194; N &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: 

<m:math><m:mi>n</m:mi></m:math>, the number of observations.</div>
<div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>2</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="X" id="X"/>3: &#160;&#160;&#8194; X(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the observations <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>, <m:math><m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;or <m:math><m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>.
<div class="paramtext">If the observation is exactly specified &#8211; the exact value, <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>.</div>
<div class="paramtext">If the observation is right-censored &#8211; the lower value, <m:math><m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub></m:math>.</div>
<div class="paramtext">If the observation is left-censored &#8211; the upper value, <m:math><m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub></m:math>.</div>
<div class="paramtext">If the observation is interval-censored &#8211; the lower or upper value, <m:math><m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;or <m:math><m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub></m:math>, (see <a class="arg" href="#XC">XC</a>).</div>
</div></dd><dt class="paramhead"><a name="XC" id="XC"/>4: &#160;&#160;&#8194; XC(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: if the <m:math><m:mi>j</m:mi></m:math>th observation, for <m:math><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>&#160;is an interval-censored observation then <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XC"><m:mi mathcolor="#EE0000" mathvariant="bold">XC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;should contain the complementary value to <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>, that is, if <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow><m:mo>&lt;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XC"><m:mi mathcolor="#EE0000" mathvariant="bold">XC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>, then <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XC"><m:mi mathcolor="#EE0000" mathvariant="bold">XC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;contains upper value, <m:math><m:msub><m:mi>U</m:mi><m:mi>i</m:mi></m:msub></m:math>, and if <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow><m:mo>&gt;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XC"><m:mi mathcolor="#EE0000" mathvariant="bold">XC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>, then <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XC"><m:mi mathcolor="#EE0000" mathvariant="bold">XC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;contains lower value, <m:math><m:msub><m:mi>L</m:mi><m:mi>i</m:mi></m:msub></m:math>. Otherwise if the <m:math><m:mi>j</m:mi></m:math>th observation is exact or right- or left-censored <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XC"><m:mi mathcolor="#EE0000" mathvariant="bold">XC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;need not be set.</div>
<div class="paramtext"><b>Note:</b> if <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#X"><m:mi mathcolor="#EE0000" mathvariant="bold">X</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#XC"><m:mi mathcolor="#EE0000" mathvariant="bold">XC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;then the observation is ignored.</div></dd><dt class="paramhead"><a name="IC" id="IC"/>5: &#160;&#160;&#8194; IC(<a class="arg" href="#N">N</a>) &#8211; INTEGER array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IC"><m:mi mathcolor="#EE0000" mathvariant="bold">IC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;contains the censoring codes for the <m:math><m:mi>i</m:mi></m:math>th observation, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>.
<div class="paramtext">If <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IC"><m:mi mathcolor="#EE0000" mathvariant="bold">IC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>0</m:mn></m:math>, the observation is exactly specified.</div>
<div class="paramtext">If <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IC"><m:mi mathcolor="#EE0000" mathvariant="bold">IC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>1</m:mn></m:math>, the observation is right-censored.</div>
<div class="paramtext">If <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IC"><m:mi mathcolor="#EE0000" mathvariant="bold">IC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>2</m:mn></m:math>, the observation is left-censored.</div>
<div class="paramtext">If <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IC"><m:mi mathcolor="#EE0000" mathvariant="bold">IC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>3</m:mn></m:math>, the observation is interval-censored.</div>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IC"><m:mi mathcolor="#EE0000" mathvariant="bold">IC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>0</m:mn></m:math>, <m:math><m:mn>1</m:mn></m:math>, <m:math><m:mn>2</m:mn></m:math>&#160;or <m:math><m:mn>3</m:mn></m:math>, for <m:math><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>.
</div></dd><dt class="paramhead"><a name="XMU" id="XMU"/>6: &#160;&#160;&#8194; XMU &#8211; <span class="bitalic">double precision</span><span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On entry</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#XSIG"><m:mi mathcolor="#EE0000" mathvariant="bold">XSIG</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0.0</m:mn></m:math>&#160;the initial estimate of the mean, <m:math><m:mi>&#956;</m:mi></m:math>; otherwise <a class="arg" href="#XMU">XMU</a> need not be set.</div>
<div class="paramtext"><i>On exit</i>: the maximum likelihood estimate, <m:math><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover></m:math>, of <m:math><m:mi>&#956;</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="XSIG" id="XSIG"/>7: &#160;&#160;&#8194; XSIG &#8211; <span class="bitalic">double precision</span><span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On entry</i>: specifies whether an initial estimate of <m:math><m:mi>&#956;</m:mi></m:math>&#160;and <m:math><m:mi>&#963;</m:mi></m:math>&#160;are to be supplied. 

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#XSIG"><m:mi mathcolor="#EE0000" mathvariant="bold">XSIG</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0.0</m:mn></m:math></dt>
<dd><a class="arg" href="#XSIG">XSIG</a> is the initial estimate of <m:math><m:mi>&#963;</m:mi></m:math>&#160;and <a class="arg" href="#XMU">XMU</a> must contain an initial estimate of <m:math><m:mi>&#956;</m:mi></m:math>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#XSIG"><m:mi mathcolor="#EE0000" mathvariant="bold">XSIG</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>0.0</m:mn></m:math></dt>
<dd>Onitial estimates of <a class="arg" href="#XMU">XMU</a> and <a class="arg" href="#XSIG">XSIG</a> are calculated internally from: 
<table class="standard-90"><tr>
<td style="width:2.1em;" valign="baseline">(a)</td>
<td valign="top">the exact observations, if the number of exactly specified observations is <m:math><m:mtext/><m:mo>&#8805;</m:mo><m:mn>2</m:mn></m:math>; or</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(b)</td>
<td valign="top">the interval-censored observations; if the number of interval-censored observations is <m:math><m:mtext/><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>; or</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(c)</td>
<td valign="top">they are set to <m:math><m:mn>0.0</m:mn></m:math>&#160;and <m:math><m:mn>1.0</m:mn></m:math>&#160;respectively.</td>
</tr></table></dd></dl>
</div>
<div class="paramtext"><i>On exit</i>: the maximum likelihood estimate, <m:math><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover></m:math>, of <m:math><m:mi>&#963;</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="TOL" id="TOL"/>8: &#160;&#160;&#8194; TOL &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the relative precision required for the final estimates of <m:math><m:mi>&#956;</m:mi></m:math>&#160;and <m:math><m:mi>&#963;</m:mi></m:math>. Convergence is assumed when the absolute relative changes in the estimates of both <m:math><m:mi>&#956;</m:mi></m:math>&#160;and <m:math><m:mi>&#963;</m:mi></m:math>&#160;are less than <a class="arg" href="#TOL">TOL</a>.
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOL"><m:mi mathcolor="#EE0000" mathvariant="bold">TOL</m:mi></m:maction><m:mo>=</m:mo><m:mn>0.0</m:mn></m:math>, then a relative precision of <m:math><m:mn>0.000005</m:mn></m:math>&#160;is used.</div>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:mi mathvariant="bold-italic">machine&#160;precision</m:mi><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOL"><m:mi mathcolor="#EE0000" mathvariant="bold">TOL</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>1.0</m:mn></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOL"><m:mi mathcolor="#EE0000" mathvariant="bold">TOL</m:mi></m:maction><m:mo>=</m:mo><m:mn>0.0</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="MAXIT" id="MAXIT"/>9: &#160;&#160;&#8194; MAXIT &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the maximum number of iterations.
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MAXIT"><m:mi mathcolor="#EE0000" mathvariant="bold">MAXIT</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>0</m:mn></m:math>, then a value of <m:math><m:mn>25</m:mn></m:math>&#160;is used.</div>
</div></dd><dt class="paramhead"><a name="SEXMU" id="SEXMU"/>10: &#8194; SEXMU &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the estimate of the standard error of <m:math><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover></m:math>.</div></dd><dt class="paramhead"><a name="SEXSIG" id="SEXSIG"/>11: &#8194; SEXSIG &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the estimate of the standard error of <m:math><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover></m:math>.</div></dd><dt class="paramhead"><a name="CORR" id="CORR"/>12: &#8194; CORR &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the estimate of the correlation between <m:math><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover></m:math>&#160;and <m:math><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover></m:math>.</div></dd><dt class="paramhead"><a name="DEV" id="DEV"/>13: &#8194; DEV &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the maximized log-likelihood, <m:math><m:mi>L</m:mi><m:mfenced separators=""><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover><m:mo>,</m:mo><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover></m:mfenced></m:math>.</div></dd><dt class="paramhead"><a name="NOBS" id="NOBS"/>14: &#8194; NOBS(<m:math><m:mn>4</m:mn></m:math>) &#8211; INTEGER array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the number of the different types of each observation;
<div class="paramtext"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NOBS"><m:mi mathcolor="#EE0000" mathvariant="bold">NOBS</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;contains number of right-censored observations.</div>
<div class="paramtext"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NOBS"><m:mi mathcolor="#EE0000" mathvariant="bold">NOBS</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow></m:math>&#160;contains number of left-censored observations.</div>
<div class="paramtext"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NOBS"><m:mi mathcolor="#EE0000" mathvariant="bold">NOBS</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>3</m:mn></m:mfenced></m:mrow></m:math>&#160;contains number of interval-censored observations.</div>
<div class="paramtext"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NOBS"><m:mi mathcolor="#EE0000" mathvariant="bold">NOBS</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>4</m:mn></m:mfenced></m:mrow></m:math>&#160;contains number of exactly specified observations.</div>
</div></dd><dt class="paramhead"><a name="NIT" id="NIT"/>15: &#8194; NIT &#8211; INTEGER<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the number of iterations performed.</div></dd><dt class="paramhead"><a name="WK" id="WK"/>16: &#8194; WK(<m:math><m:mn>2</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Workspace</span></dt><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>17: &#8194; IFAIL &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <a class="arg" href="#IFAIL">IFAIL</a> must be set to <m:math><m:mn>0</m:mn></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>. If you are unfamiliar with this parameter you should refer to <a class="sec" href="../GENINT/essint.xml#library3">Section 3.3</a> in  the Essential Introduction for details.</div>
<div class="paramtext"><i>On exit</i>: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;unless the routine detects an error (see <a class="sec" href="#errors">Section 6</a>). <div class="paramtext">For environments where it might be inappropriate to halt program execution when an error is detected, the value <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>&#160;is recommended.  If the output of error messages is undesirable, then the value <m:math><m:mn>1</m:mn></m:math>&#160;is recommended.  Otherwise, if you are not familiar with this parameter, the recommended value is <m:math><m:mn>0</m:mn></m:math>.  <b>When the value <m:math><m:mrow><m:mo>-</m:mo><m:mn mathvariant="bold">1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn mathvariant="bold">1</m:mn></m:math>&#160;is used it is essential to test the value of <a class="arg" href="#IFAIL">IFAIL</a> on exit.</b></div></div></dd></dl><h2 class="standard"><a class="sec" name="errors" id="errors"/>6&#160;&#160;Error Indicators and Warnings</h2>
<div class="paramtext">If on entry <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">-1</m:mn></m:maction></m:math>, explanatory error messages are output on the current error message unit (as defined by <a class="rout" href="../X04/x04aaf.xml">X04AAF</a>).</div><div class="paramtext">Errors or warnings detected by the routine:</div>
<dl class="ifail">
<dt class="errorhead"><a name="IFeq1" id="IFeq1"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#METHOD"><m:mi mathcolor="#EE0000" mathvariant="bold">METHOD</m:mi></m:maction><m:mo>&#8800;</m:mo><m:mtext>'N'</m:mtext></m:math>&#160;or <m:math><m:mtext>'E'</m:mtext></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>2</m:mn></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IC"><m:mi mathcolor="#EE0000" mathvariant="bold">IC</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>&#8800;</m:mo><m:mn>0</m:mn></m:math>, <m:math><m:mn>1</m:mn></m:math>, <m:math><m:mn>2</m:mn></m:math>&#160;or <m:math><m:mn>3</m:mn></m:math>, for some <m:math><m:mi>i</m:mi></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOL"><m:mi mathcolor="#EE0000" mathvariant="bold">TOL</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0.0</m:mn></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:mn>0.0</m:mn><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOL"><m:mi mathcolor="#EE0000" mathvariant="bold">TOL</m:mi></m:maction><m:mo>&lt;</m:mo><m:mi mathvariant="bold-italic">machine&#160;precision</m:mi></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#TOL"><m:mi mathcolor="#EE0000" mathvariant="bold">TOL</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>1.0</m:mn></m:math>.</td></tr></table>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq2" id="IFeq2"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>2</m:mn></m:math></dt>
<dd>
<div class="paramtext">The chosen method failed to converge in <a class="arg" href="#MAXIT">MAXIT</a> iterations.  You should either increase <a class="arg" href="#TOL">TOL</a> or <a class="arg" href="#MAXIT">MAXIT</a> or, if using the <m:math><m:mi>E</m:mi><m:mi>M</m:mi></m:math>&#160;algorithm try using the Newton&#8211;Raphson method with initial values those returned by the current call to G07BBF.  All returned values will be reasonable approximations to the correct results if <a class="arg" href="#MAXIT">MAXIT</a> is not very small.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq3" id="IFeq3"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>3</m:mn></m:math></dt>
<dd>
<div class="paramtext">The chosen method is diverging.  This will be due to poor initial values.  You should try different initial values.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq4" id="IFeq4"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>4</m:mn></m:math></dt>
<dd>
<div class="paramtext">G07BBF was unable to calculate the standard errors.  This can be caused by the method starting to diverge when the maximum number of iterations was reached.</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">The accuracy is controlled by the parameter <a class="arg" href="#TOL">TOL</a>.</div><div class="paramtext">If high precision is requested with the <m:math><m:mi>E</m:mi><m:mi>M</m:mi></m:math>&#160;algorithm then there is a possibility that, due to the slow convergence, before the correct solution has been reached the increments of <m:math><m:mover><m:mi>&#956;</m:mi><m:mo>^</m:mo></m:mover></m:math>&#160;and <m:math><m:mover><m:mi>&#963;</m:mi><m:mo>^</m:mo></m:mover></m:math>&#160;may be smaller than <a class="arg" href="#TOL">TOL</a> and the process will prematurely assume convergence.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">The process is deemed divergent if three successive increments of <m:math><m:mi>&#956;</m:mi></m:math>&#160;or <m:math><m:mi>&#963;</m:mi></m:math>&#160;increase.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">A sample of <m:math><m:mn>18</m:mn></m:math>&#160;observations and their censoring codes are read in and the Newton&#8211;Raphson method used to compute the estimates.</div><h3 class="standard"><a class="sec" name="examtext" id="examtext"/>9.1&#160;&#160;Program Text</h3>
<p><a class="verbatimref" href="../../examples/source/g07bbfe.f">Program Text (g07bbfe.f)</a></p><h3 class="standard"><a class="sec" name="examdata" id="examdata"/>9.2&#160;&#160;Program Data</h3>
<p><a class="verbatimref" href="../../examples/data/g07bbfe.d">Program&#160;Data (g07bbfe.d)</a></p><h3 class="standard"><a class="sec" name="examresults" id="examresults"/>9.3&#160;&#160;Program Results</h3>
<p><a class="verbatimref" href="../../examples/baseresults/g07bbfe.r">Program Results (g07bbfe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/G07/g07bbf.pdf">G07BBF (PDF version)</a></div><div><a class="chap" href="g07conts.xml">G07 Chapter Contents</a></div><div><a class="chapint" href="g07intro.xml">G07 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div>
<div><hr/><a class="genint" href="../FRONTMATTER/copyright.xml">&#169; The Numerical Algorithms Group Ltd, Oxford, UK. 2009</a></div></body></html>
