422 lines
18 KiB
HTML
422 lines
18 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>NormalFit (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="NormalFit (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/NormalFit.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/NonNegativeLeastSquares.html" title="class in edu.rit.numeric"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../edu/rit/numeric/NormalPrng.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/NormalFit.html" target="_top">Frames</a></li>
|
|
<li><a href="NormalFit.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: </li>
|
|
<li>Nested | </li>
|
|
<li><a href="#field_summary">Field</a> | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method_summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li><a href="#field_detail">Field</a> | </li>
|
|
<li>Constr | </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 NormalFit" class="title">Class NormalFit</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.NormalFit</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<hr>
|
|
<br>
|
|
<pre>public class <span class="strong">NormalFit</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 NormalFit fits a series of data points to a normal distribution. The
|
|
null hypothesis is that the data points are drawn from a normal distribution
|
|
<I>N</I>(<I>μ,σ</I>) with unknown mean <I>μ</I> and unknown
|
|
standard deviation <I>σ</I>. The values of <I>μ</I> and
|
|
<I>σ</I> are fitted so as to minimize the maximum absolute difference
|
|
between the cumulative distribution of the data points and the cumulative
|
|
distribution of <I>N</I>(<I>μ,σ</I>). A Kolmogorov-Smirnov (K-S)
|
|
test is performed to determine the <I>p</I>-value of the null hypothesis with
|
|
the fitted <I>μ</I> and <I>σ</I> parameters.
|
|
<P>
|
|
To do the fitting procedure, call the static <a href="../../../edu/rit/numeric/NormalFit.html#fit(edu.rit.numeric.Series)"><code>NormalFit.fit(Series)</code></a> or the static <a href="../../../edu/rit/numeric/NormalFit.html#fit(double[])"><code>NormalFit.fit(double[])</code></a> method, passing in the data points. The method
|
|
returns an instance of class NormalFit whose fields contain the fitting
|
|
procedure's results.</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"> </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>double[]</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/NormalFit.html#cumulDist">cumulDist</a></strong></code>
|
|
<div class="block">The cumulative distribution of the data points.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/NormalFit.html#D">D</a></strong></code>
|
|
<div class="block">The K-S statistic.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>double[]</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/NormalFit.html#data">data</a></strong></code>
|
|
<div class="block">The original data points in ascending order.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/NormalFit.html#mu">mu</a></strong></code>
|
|
<div class="block">The mean of the fitted normal distribution.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/NormalFit.html#N">N</a></strong></code>
|
|
<div class="block">The number of original data points.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/NormalFit.html#pvalue">pvalue</a></strong></code>
|
|
<div class="block">The <I>p</I>-value of the K-S statistic.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/NormalFit.html#sigma">sigma</a></strong></code>
|
|
<div class="block">The standard deviation of the fitted normal distribution.</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"> </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>static <a href="../../../edu/rit/numeric/NormalFit.html" title="class in edu.rit.numeric">NormalFit</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/NormalFit.html#fit(double[])">fit</a></strong>(double[] data)</code>
|
|
<div class="block">Fit the data in the given array to a normal distribution.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static <a href="../../../edu/rit/numeric/NormalFit.html" title="class in edu.rit.numeric">NormalFit</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/NormalFit.html#fit(edu.rit.numeric.Series)">fit</a></strong>(<a href="../../../edu/rit/numeric/Series.html" title="class in edu.rit.numeric">Series</a> data)</code>
|
|
<div class="block">Fit the data in the given series to a normal distribution.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/numeric/NormalFit.html#main(java.lang.String[])">main</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] args)</code>
|
|
<div class="block">Unit test main program.</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 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="N">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>N</h4>
|
|
<pre>public int N</pre>
|
|
<div class="block">The number of original data points.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="data">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>data</h4>
|
|
<pre>public double[] data</pre>
|
|
<div class="block">The original data points in ascending order.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="cumulDist">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>cumulDist</h4>
|
|
<pre>public double[] cumulDist</pre>
|
|
<div class="block">The cumulative distribution of the data points.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="mu">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>mu</h4>
|
|
<pre>public double mu</pre>
|
|
<div class="block">The mean of the fitted normal distribution.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="sigma">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>sigma</h4>
|
|
<pre>public double sigma</pre>
|
|
<div class="block">The standard deviation of the fitted normal distribution.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="D">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>D</h4>
|
|
<pre>public double D</pre>
|
|
<div class="block">The K-S statistic.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="pvalue">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>pvalue</h4>
|
|
<pre>public double pvalue</pre>
|
|
<div class="block">The <I>p</I>-value of the K-S statistic.</div>
|
|
</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.Series)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>fit</h4>
|
|
<pre>public static <a href="../../../edu/rit/numeric/NormalFit.html" title="class in edu.rit.numeric">NormalFit</a> fit(<a href="../../../edu/rit/numeric/Series.html" title="class in edu.rit.numeric">Series</a> data)</pre>
|
|
<div class="block">Fit the data in the given series to a normal distribution.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - Data series.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>A NormalFit object containing the fitting procedure's results.</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>data</TT> is null.</dd>
|
|
<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>data</TT> is empty.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="fit(double[])">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>fit</h4>
|
|
<pre>public static <a href="../../../edu/rit/numeric/NormalFit.html" title="class in edu.rit.numeric">NormalFit</a> fit(double[] data)</pre>
|
|
<div class="block">Fit the data in the given array to a normal distribution.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - Data array.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>A NormalFit object containing the fitting procedure's results.</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>data</TT> is null.</dd>
|
|
<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>data</TT> is zero length.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="main(java.lang.String[])">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>main</h4>
|
|
<pre>public static void main(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] args)</pre>
|
|
<div class="block">Unit test main program. Generates <I>N</I> random data points from a
|
|
normal distribution with mean <I>μ</I> and standard deviation
|
|
<I>σ</I>, then fits the data to a normal distribution.
|
|
<P>
|
|
Usage: <TT>java edu.rit.numeric.NormalFit <I>seed</I> <I>N</I> <I>mu</I>
|
|
<I>sigma</I></TT></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/NormalFit.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/NonNegativeLeastSquares.html" title="class in edu.rit.numeric"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../edu/rit/numeric/NormalPrng.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/NormalFit.html" target="_top">Frames</a></li>
|
|
<li><a href="NormalFit.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: </li>
|
|
<li>Nested | </li>
|
|
<li><a href="#field_summary">Field</a> | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method_summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li><a href="#field_detail">Field</a> | </li>
|
|
<li>Constr | </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 © 2013–2016 by Alan Kaminsky. All rights reserved. Send comments to ark</FONT><FONT SIZE="1" COLOR="#FFFFFF">­</FONT><FONT SIZE="-2">@</FONT><FONT SIZE="1" COLOR="#FFFFFF">­</FONT><FONT SIZE="-2">cs.rit.edu.</FONT></small></p>
|
|
</body>
|
|
</html>
|