Files
2016-04-27 01:07:35 -04:00

703 lines
32 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_51) on Wed Apr 06 13:11:04 EDT 2016 -->
<title>RobustFit (Parallel Java 2 Library Documentation)</title>
<meta name="date" content="2016-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="RobustFit (Parallel Java 2 Library Documentation)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RobustFit.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../edu/rit/numeric/Rational.html" title="class in edu.rit.numeric"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../edu/rit/numeric/Root.html" title="class in edu.rit.numeric"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?edu/rit/numeric/RobustFit.html" target="_top">Frames</a></li>
<li><a href="RobustFit.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">edu.rit.numeric</div>
<h2 title="Class RobustFit" class="title">Class RobustFit</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>edu.rit.numeric.RobustFit</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">RobustFit</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Class RobustFit uses a robust estimation procedure to fit a series of
(<I>x,y</I>) data points to a model. The data series is an instance of class
<a href="../../../edu/rit/numeric/XYSeries.html" title="class in edu.rit.numeric">XYSeries</a>. The model is represented by a <a href="../../../edu/rit/numeric/ParameterizedFunction.html" title="interface in edu.rit.numeric">ParameterizedFunction</a> that computes the <I>y</I> value, given an <I>x</I>
value. The model also has <I>parameters</I>.
<P>
Given a data series, a model function, and an initial guess for the parameter
values, class RobustFit's <TT>fit()</TT> method finds parameter values that
minimize the following <I>metric:</I>
<P>
&nbsp;&nbsp;&nbsp;&nbsp;<B>&Sigma;</B><SUB><I>i</I></SUB>
<I>&rho;</I> (<I>y</I><SUB><I>i</I></SUB> &minus;
<I>f</I> (<I>x</I><SUB><I>i</I></SUB>, parameters))
<P>
where <I>f</I> is the model function and <I>&rho;</I> is one of these metric
functions:
<UL>
<P><LI>
Normal: <I>&rho;</I> (<I>z</I>) = <I>z</I><SUP>2</SUP>/2
<P><LI>
Exponential: <I>&rho;</I> (<I>z</I>) = |<I>z</I>|
<P><LI>
Cauchy (default): <I>&rho;</I> (<I>z</I>) = log (1 + <I>z</I><SUP>2</SUP>/2)
</UL>
<P>
In other words, the <TT>fit()</TT> method <I>fits</I> the model to the data
by adjusting the parameters to minimize the metric.
<P>
The metric function is the negative logarithm of the probability distribution
of the errors in the <I>y</I> values. The above metric functions correspond
to normal, two-sided exponential, and Cauchy error distributions.
<P>
The metric functions differ in how they treat <I>outliers,</I> i.e., data
points that deviate from the model. The normal metric function gives
increasing weights to points with increasing deviations. However, because of
the increasing weights, outlier points may skew the fit (hence, this is not
really a "robust" metric function). The exponential metric function gives
equal weights to all points, regardless of deviation. This reduces the
influence of outliers on the fit, yielding a more robust fit. With the
Cauchy metric function, the weights first increase, then decrease as the
deviations increase. This reduces the influence of outliers even further.
<P>
The <TT>fit()</TT> method uses class <a href="../../../edu/rit/numeric/MDMinimizationDownhillSimplex.html" title="class in edu.rit.numeric">MDMinimizationDownhillSimplex</a> to find the parameter values that minimize the
metric. The inputs to and outputs from the <TT>fit()</TT> method are stored
in fields of an instance of class RobustFit.
<P>
The <TT>fitWithDistribution()</TT> method uses the <I>bootstrapping</I>
technique to determine the distribution of the model parameters, which
depends on the error distribution of the data points. Bootstrapping performs
multiple iterations of the model fitting procedure. On each iteration, a
trial data set the same size as the original data set is created by sampling
the original data points with replacement, and model parameters for the trial
data set are computed. The <TT>fitWithDistribution()</TT> method outputs a
series of the parameter values found at each iteration; the confidence region
for the parameters; and the goodness-of-fit <I>p</I>-value.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../edu/rit/numeric/Function.html" title="interface in edu.rit.numeric">Function</a></code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#CAUCHY">CAUCHY</a></strong></code>
<div class="block">The Cauchy metric function.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#confidenceRegionLowerBound">confidenceRegionLowerBound</a></strong></code>
<div class="block">The lower bound of the confidence region for the model parameters.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#confidenceRegionUpperBound">confidenceRegionUpperBound</a></strong></code>
<div class="block">The upper bound of the confidence region for the model parameters.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../edu/rit/numeric/XYSeries.html" title="class in edu.rit.numeric">XYSeries</a></code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#data">data</a></strong></code>
<div class="block">The data series.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../edu/rit/numeric/Function.html" title="interface in edu.rit.numeric">Function</a></code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#EXPONENTIAL">EXPONENTIAL</a></strong></code>
<div class="block">The exponential metric function.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#M">M</a></strong></code>
<div class="block">The number of parameters in the model, <I>M</I>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../edu/rit/numeric/Function.html" title="interface in edu.rit.numeric">Function</a></code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#metric">metric</a></strong></code>
<div class="block">The metric function.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#metricSeries">metricSeries</a></strong></code>
<div class="block">The metric values for the model parameter distribution.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#metricValue">metricValue</a></strong></code>
<div class="block">The metric value.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../edu/rit/numeric/ParameterizedFunction.html" title="interface in edu.rit.numeric">ParameterizedFunction</a></code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#model">model</a></strong></code>
<div class="block">The model function.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../edu/rit/numeric/Function.html" title="interface in edu.rit.numeric">Function</a></code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#NORMAL">NORMAL</a></strong></code>
<div class="block">The normal metric function.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#param">param</a></strong></code>
<div class="block">The model parameters.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double[][]</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#paramSeries">paramSeries</a></strong></code>
<div class="block">The model parameter distribution.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#pValue">pValue</a></strong></code>
<div class="block">The goodness-of-fit <I>p</I>-value.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#RobustFit(edu.rit.numeric.ParameterizedFunction)">RobustFit</a></strong>(<a href="../../../edu/rit/numeric/ParameterizedFunction.html" title="interface in edu.rit.numeric">ParameterizedFunction</a>&nbsp;model)</code>
<div class="block">Construct a new robust fitting object for the given model.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#fit(edu.rit.numeric.XYSeries)">fit</a></strong>(<a href="../../../edu/rit/numeric/XYSeries.html" title="class in edu.rit.numeric">XYSeries</a>&nbsp;data)</code>
<div class="block">Fit the given data series to the model.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#fitWithDistribution(edu.rit.numeric.XYSeries, int, edu.rit.util.Random, double)">fitWithDistribution</a></strong>(<a href="../../../edu/rit/numeric/XYSeries.html" title="class in edu.rit.numeric">XYSeries</a>&nbsp;data,
int&nbsp;T,
<a href="../../../edu/rit/util/Random.html" title="class in edu.rit.util">Random</a>&nbsp;prng,
double&nbsp;conf)</code>
<div class="block">Fit the given data series to the model and compute the distribution of
the model parameters.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/RobustFit.html#initializeSimplex(edu.rit.numeric.MDMinimizationDownhillSimplex)">initializeSimplex</a></strong>(<a href="../../../edu/rit/numeric/MDMinimizationDownhillSimplex.html" title="class in edu.rit.numeric">MDMinimizationDownhillSimplex</a>&nbsp;minimizer)</code>
<div class="block">Initialize the simplex in the given downhill simplex minimizer object.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="model">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>model</h4>
<pre>public final&nbsp;<a href="../../../edu/rit/numeric/ParameterizedFunction.html" title="interface in edu.rit.numeric">ParameterizedFunction</a> model</pre>
<div class="block">The model function. When <TT>model.f()</TT> is called, the <TT>x</TT>
argument is <I>x</I><SUB><I>i</I></SUB>, the <I>x</I> value of a data
point; the <TT>p</TT> argument contains the model parameters; and the
return value is
<I>f</I>&nbsp;(<I>x</I><SUB><I>i</I></SUB>,&nbsp;parameters).</div>
</li>
</ul>
<a name="M">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>M</h4>
<pre>public final&nbsp;int M</pre>
<div class="block">The number of parameters in the model, <I>M</I>.</div>
</li>
</ul>
<a name="metric">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>metric</h4>
<pre>public&nbsp;<a href="../../../edu/rit/numeric/Function.html" title="interface in edu.rit.numeric">Function</a> metric</pre>
<div class="block">The metric function. By default, this is <TT>CAUCHY</TT>. It can instead
be set to <TT>NORMAL</TT>, <TT>EXPONENTIAL</TT>, or some other metric
function.</div>
</li>
</ul>
<a name="param">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>param</h4>
<pre>public final&nbsp;double[] param</pre>
<div class="block">The model parameters. On input to the <TT>fit()</TT> and
<TT>fitWithDistribution()</TT> methods, <TT>param</TT> contains the
initial guess for the model parameters. On output from the <TT>fit()</TT>
and <TT>fitWithDistribution()</TT> methods, <TT>param</TT> contains the
fitted parameter values.</div>
</li>
</ul>
<a name="data">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>data</h4>
<pre>public&nbsp;<a href="../../../edu/rit/numeric/XYSeries.html" title="class in edu.rit.numeric">XYSeries</a> data</pre>
<div class="block">The data series. It contains the (<I>x,y</I>) data points to be fitted to
the model. It is specified as an argument of the <TT>fit()</TT> and
<TT>fitWithDistribution()</TT> methods.</div>
</li>
</ul>
<a name="metricValue">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>metricValue</h4>
<pre>public&nbsp;double metricValue</pre>
<div class="block">The metric value. An output of the <TT>fit()</TT> and
<TT>fitWithDistribution()</TT> methods. It is set to the value of the
metric for the model with the fitted parameters stored in <TT>param</TT>.</div>
</li>
</ul>
<a name="paramSeries">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>paramSeries</h4>
<pre>public&nbsp;double[][] paramSeries</pre>
<div class="block">The model parameter distribution. An output of the
<TT>fitWithDistribution()</TT> method. <TT>paramSeries</TT> is a
<I>T</I>-element array, where <I>T</I> is the number of trials. Each
element of <TT>paramSeries</TT> is an <I>M</I>-element array giving the
fitted parameter values for the corresponding trial.</div>
</li>
</ul>
<a name="metricSeries">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>metricSeries</h4>
<pre>public&nbsp;double[] metricSeries</pre>
<div class="block">The metric values for the model parameter distribution. An output of the
<TT>fitWithDistribution()</TT> method. <TT>metricSeries</TT> is a
<I>T</I>-element array, where <I>T</I> is the number of trials. Each
element of <TT>metricSeries</TT> gives the value of the metric for the
model with the parameters stored in the corresponding element of
<TT>paramSeries</TT>.</div>
</li>
</ul>
<a name="confidenceRegionLowerBound">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>confidenceRegionLowerBound</h4>
<pre>public&nbsp;double[] confidenceRegionLowerBound</pre>
<div class="block">The lower bound of the confidence region for the model parameters. An
output of the <TT>fitWithDistribution()</TT> method. The confidence level
is specified as an argument of the <TT>fitWithDistribution()</TT> method;
for example, 0.90 specifies a 90% confidence level. The confidence region
is an <I>M</I>-dimensional rectangular hyperprism centered on the fitted
parameters stored in <TT>param</TT>, such that the given fraction of the
model parameter distribution stored in <TT>paramSeries</TT> falls within
the hyperprism. <TT>confidenceRegionLowerBound</TT> gives the lower bound
of each dimension of the confidence region hyperprism.</div>
</li>
</ul>
<a name="confidenceRegionUpperBound">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>confidenceRegionUpperBound</h4>
<pre>public&nbsp;double[] confidenceRegionUpperBound</pre>
<div class="block">The upper bound of the confidence region for the model parameters. An
output of the <TT>fitWithDistribution()</TT> method.
<TT>confidenceRegionUpperBound</TT> gives the upper bound of each
dimension of the confidence region hyperprism.</div>
</li>
</ul>
<a name="pValue">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>pValue</h4>
<pre>public&nbsp;double pValue</pre>
<div class="block">The goodness-of-fit <I>p</I>-value. An output of the
<TT>fitWithDistribution()</TT> method. This gives the probability that a
metric value greater than or equal to <TT>metricValue</TT> would occur by
chance, even if the model with parameters <TT>params</TT> is correct.</div>
</li>
</ul>
<a name="NORMAL">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>NORMAL</h4>
<pre>public static final&nbsp;<a href="../../../edu/rit/numeric/Function.html" title="interface in edu.rit.numeric">Function</a> NORMAL</pre>
<div class="block">The normal metric function.</div>
</li>
</ul>
<a name="EXPONENTIAL">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>EXPONENTIAL</h4>
<pre>public static final&nbsp;<a href="../../../edu/rit/numeric/Function.html" title="interface in edu.rit.numeric">Function</a> EXPONENTIAL</pre>
<div class="block">The exponential metric function.</div>
</li>
</ul>
<a name="CAUCHY">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CAUCHY</h4>
<pre>public static final&nbsp;<a href="../../../edu/rit/numeric/Function.html" title="interface in edu.rit.numeric">Function</a> CAUCHY</pre>
<div class="block">The Cauchy metric function.</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="RobustFit(edu.rit.numeric.ParameterizedFunction)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>RobustFit</h4>
<pre>public&nbsp;RobustFit(<a href="../../../edu/rit/numeric/ParameterizedFunction.html" title="interface in edu.rit.numeric">ParameterizedFunction</a>&nbsp;model)</pre>
<div class="block">Construct a new robust fitting object for the given model. The
<TT>model</TT> field is set to the corresponding argument. The <TT>M</TT>
field is set by calling the model function's <TT>parameterLength()</TT>
method. The <TT>param</TT> field is allocated with <I>M</I> elements;
initially, the elements are 0.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>model</code> - Model function.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - (unchecked exception) Thrown if <TT>model</TT> is null.</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="fit(edu.rit.numeric.XYSeries)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fit</h4>
<pre>public&nbsp;void&nbsp;fit(<a href="../../../edu/rit/numeric/XYSeries.html" title="class in edu.rit.numeric">XYSeries</a>&nbsp;data)</pre>
<div class="block">Fit the given data series to the model. The data series is stored in the
<TT>data</TT> field. The model function was specified to the constructor,
and is also stored in the <TT>model</TT> field. On input to the
<TT>fit()</TT> method, <TT>param</TT> contains the initial guess for the
model parameters. On output from the <TT>fit()</TT> method,
<TT>param</TT> contains the fitted parameter values and
<TT>metricValue</TT> contains the value of the metric for the fitted
parameters.
<P>
The <TT>fit()</TT> method uses the downhill simplex technique to find the
model parameters that minimize the metric. This involves initializing the
<I>simplex</I> in an <a href="../../../edu/rit/numeric/MDMinimizationDownhillSimplex.html" title="class in edu.rit.numeric">MDMinimizationDownhillSimplex</a> object.
The <TT>initializeSimplex()</TT> method is called to initialize the
simplex.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - Data series.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../edu/rit/numeric/TooManyIterationsException.html" title="class in edu.rit.numeric">TooManyIterationsException</a></code> - (unchecked exception) Thrown if too many iterations occurred without
finding parameters that minimize the metric function.</dd></dl>
</li>
</ul>
<a name="fitWithDistribution(edu.rit.numeric.XYSeries, int, edu.rit.util.Random, double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fitWithDistribution</h4>
<pre>public&nbsp;void&nbsp;fitWithDistribution(<a href="../../../edu/rit/numeric/XYSeries.html" title="class in edu.rit.numeric">XYSeries</a>&nbsp;data,
int&nbsp;T,
<a href="../../../edu/rit/util/Random.html" title="class in edu.rit.util">Random</a>&nbsp;prng,
double&nbsp;conf)</pre>
<div class="block">Fit the given data series to the model and compute the distribution of
the model parameters. The data series is stored in the <TT>data</TT>
field. The bootstrapping technique with <I>T</I> trials using the given
pseudorandom number generator is used to compute the distribution. The
given confidence level is used to compute the confidence region; for
example, 0.90 specifies a 90% confidence level. The model function was
specified to the constructor, and is also stored in the <TT>model</TT>
field. On input to the <TT>fitWithDistribution()</TT> method,
<TT>param</TT> contains the initial guess for the model parameters. On
output from the <TT>fit()</TT> method, <TT>param</TT> contains the fitted
parameter values, <TT>metricValue</TT> contains the value of the metric
for the fitted parameters, <TT>paramSeries</TT> contains the series of
fitted parameter values from all the trials, <TT>metricSeries</TT>
contains the metric values from all the trials,
<TT>confidenceRegionLowerBound</TT> and
<TT>confidenceRegionUpperBound</TT> contain the lower and upper bounds of
the confidence region hyperprism, and <TT>pValue</TT> contains the
goodness-of-fit.
<P>
The <TT>fitWithDistribution()</TT> method uses the downhill simplex
technique to find the model parameters that minimize the metric. This
involves initializing the <I>simplex</I> in an <a href="../../../edu/rit/numeric/MDMinimizationDownhillSimplex.html" title="class in edu.rit.numeric">MDMinimizationDownhillSimplex</a> object. The <TT>initializeSimplex()</TT>
method is called to initialize the simplex.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - Data series.</dd><dd><code>T</code> - Number of trials.</dd><dd><code>prng</code> - Pseudorandom number generator.</dd><dd><code>conf</code> - Confidence level, in the range 0.0 .. 1.0.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - (unchecked exception) Thrown if <TT>conf</TT> is out of bounds.</dd>
<dd><code><a href="../../../edu/rit/numeric/TooManyIterationsException.html" title="class in edu.rit.numeric">TooManyIterationsException</a></code> - (unchecked exception) Thrown if too many iterations occurred without
finding parameters that minimize the metric function.</dd></dl>
</li>
</ul>
<a name="initializeSimplex(edu.rit.numeric.MDMinimizationDownhillSimplex)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>initializeSimplex</h4>
<pre>protected&nbsp;void&nbsp;initializeSimplex(<a href="../../../edu/rit/numeric/MDMinimizationDownhillSimplex.html" title="class in edu.rit.numeric">MDMinimizationDownhillSimplex</a>&nbsp;minimizer)</pre>
<div class="block">Initialize the simplex in the given downhill simplex minimizer object.
The simplex points must be set based on the initial guess for the
parameter values stored in the <TT>param</TT> field. For further
information about initializing the simplex, see class <a href="../../../edu/rit/numeric/MDMinimizationDownhillSimplex.html" title="class in edu.rit.numeric">MDMinimizationDownhillSimplex</a>.
<P>
The default implementation of this method sets the first simplex point to
<TT>param</TT>, sets the second simplex point to <TT>param</TT> except
element 0 is set to perturb(<TT>param[0]</TT>), sets the third simplex
point to <TT>param</TT> except element 1 is set to
perturb(<TT>param[1]</TT>), and so on. perturb(<I>x</I>) = 1.01<I>x</I>
if <I>x</I> &ne; 0; perturb(0) = 0.01. This method can be overridden to
initialize the simplex differently.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RobustFit.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../edu/rit/numeric/Rational.html" title="class in edu.rit.numeric"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../edu/rit/numeric/Root.html" title="class in edu.rit.numeric"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?edu/rit/numeric/RobustFit.html" target="_top">Frames</a></li>
<li><a href="RobustFit.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><FONT SIZE="-2">Copyright &copy; 2013&ndash;2016 by Alan Kaminsky. All rights reserved. Send comments to ark</FONT><FONT SIZE="1" COLOR="#FFFFFF">&shy;</FONT><FONT SIZE="-2">&#64;</FONT><FONT SIZE="1" COLOR="#FFFFFF">&shy;</FONT><FONT SIZE="-2">cs.rit.edu.</FONT></small></p>
</body>
</html>