15
|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
2 <!--NewPage-->
|
|
3 <HTML>
|
|
4 <HEAD>
|
|
5 <!-- Generated by javadoc (build 1.6.0_17) on Sat Mar 27 22:46:15 EDT 2010 -->
|
|
6 <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
7 <TITLE>
|
|
8 PolynomialFitter (Commons Math 2.1 API)
|
|
9 </TITLE>
|
|
10
|
|
11 <META NAME="date" CONTENT="2010-03-27">
|
|
12
|
|
13 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
|
|
14
|
|
15 <SCRIPT type="text/javascript">
|
|
16 function windowTitle()
|
|
17 {
|
|
18 if (location.href.indexOf('is-external=true') == -1) {
|
|
19 parent.document.title="PolynomialFitter (Commons Math 2.1 API)";
|
|
20 }
|
|
21 }
|
|
22 </SCRIPT>
|
|
23 <NOSCRIPT>
|
|
24 </NOSCRIPT>
|
|
25
|
|
26 </HEAD>
|
|
27
|
|
28 <BODY BGCOLOR="white" onload="windowTitle();">
|
|
29 <HR>
|
|
30
|
|
31
|
|
32 <!-- ========= START OF TOP NAVBAR ======= -->
|
|
33 <A NAME="navbar_top"><!-- --></A>
|
|
34 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
|
35 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
|
36 <TR>
|
|
37 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
|
38 <A NAME="navbar_top_firstrow"><!-- --></A>
|
|
39 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
|
40 <TR ALIGN="center" VALIGN="top">
|
|
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
|
42 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
|
43 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
|
44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PolynomialFitter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
|
|
45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
|
46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
|
47 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
|
48 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
|
49 </TR>
|
|
50 </TABLE>
|
|
51 </TD>
|
|
52 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
|
53 </EM>
|
|
54 </TD>
|
|
55 </TR>
|
|
56
|
|
57 <TR>
|
|
58 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
59 <A HREF="../../../../../../org/apache/commons/math/optimization/fitting/ParametricRealFunction.html" title="interface in org.apache.commons.math.optimization.fitting"><B>PREV CLASS</B></A>
|
|
60 <A HREF="../../../../../../org/apache/commons/math/optimization/fitting/WeightedObservedPoint.html" title="class in org.apache.commons.math.optimization.fitting"><B>NEXT CLASS</B></A></FONT></TD>
|
|
61 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
62 <A HREF="../../../../../../index.html?org/apache/commons/math/optimization/fitting/PolynomialFitter.html" target="_top"><B>FRAMES</B></A>
|
|
63 <A HREF="PolynomialFitter.html" target="_top"><B>NO FRAMES</B></A>
|
|
64 <SCRIPT type="text/javascript">
|
|
65 <!--
|
|
66 if(window==top) {
|
|
67 document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
|
68 }
|
|
69 //-->
|
|
70 </SCRIPT>
|
|
71 <NOSCRIPT>
|
|
72 <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
|
|
73 </NOSCRIPT>
|
|
74
|
|
75
|
|
76 </FONT></TD>
|
|
77 </TR>
|
|
78 <TR>
|
|
79 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
80 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
81 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
82 DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
|
83 </TR>
|
|
84 </TABLE>
|
|
85 <A NAME="skip-navbar_top"></A>
|
|
86 <!-- ========= END OF TOP NAVBAR ========= -->
|
|
87
|
|
88 <HR>
|
|
89 <!-- ======== START OF CLASS DATA ======== -->
|
|
90 <H2>
|
|
91 <FONT SIZE="-1">
|
|
92 org.apache.commons.math.optimization.fitting</FONT>
|
|
93 <BR>
|
|
94 Class PolynomialFitter</H2>
|
|
95 <PRE>
|
|
96 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
|
|
97 <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.math.optimization.fitting.PolynomialFitter</B>
|
|
98 </PRE>
|
|
99 <HR>
|
|
100 <DL>
|
|
101 <DT><PRE>public class <A HREF="../../../../../../src-html/org/apache/commons/math/optimization/fitting/PolynomialFitter.html#line.34"><B>PolynomialFitter</B></A><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
|
|
102 </PRE>
|
|
103
|
|
104 <P>
|
|
105 This class implements a curve fitting specialized for polynomials.
|
|
106 <p>Polynomial fitting is a very simple case of curve fitting. The
|
|
107 estimated coefficients are the polynomial coefficients. They are
|
|
108 searched by a least square estimator.</p>
|
|
109 <P>
|
|
110
|
|
111 <P>
|
|
112 <DL>
|
|
113 <DT><B>Since:</B></DT>
|
|
114 <DD>2.0</DD>
|
|
115 <DT><B>Version:</B></DT>
|
|
116 <DD>$Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $</DD>
|
|
117 </DL>
|
|
118 <HR>
|
|
119
|
|
120 <P>
|
|
121
|
|
122 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
123
|
|
124 <A NAME="constructor_summary"><!-- --></A>
|
|
125 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
126 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
127 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
|
128 <B>Constructor Summary</B></FONT></TH>
|
|
129 </TR>
|
|
130 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
131 <TD><CODE><B><A HREF="../../../../../../org/apache/commons/math/optimization/fitting/PolynomialFitter.html#PolynomialFitter(int, org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer)">PolynomialFitter</A></B>(int degree,
|
|
132 <A HREF="../../../../../../org/apache/commons/math/optimization/DifferentiableMultivariateVectorialOptimizer.html" title="interface in org.apache.commons.math.optimization">DifferentiableMultivariateVectorialOptimizer</A> optimizer)</CODE>
|
|
133
|
|
134 <BR>
|
|
135 Simple constructor.</TD>
|
|
136 </TR>
|
|
137 </TABLE>
|
|
138
|
|
139 <!-- ========== METHOD SUMMARY =========== -->
|
|
140
|
|
141 <A NAME="method_summary"><!-- --></A>
|
|
142 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
143 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
144 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
|
145 <B>Method Summary</B></FONT></TH>
|
|
146 </TR>
|
|
147 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
148 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
149 <CODE> void</CODE></FONT></TD>
|
|
150 <TD><CODE><B><A HREF="../../../../../../org/apache/commons/math/optimization/fitting/PolynomialFitter.html#addObservedPoint(double, double, double)">addObservedPoint</A></B>(double weight,
|
|
151 double x,
|
|
152 double y)</CODE>
|
|
153
|
|
154 <BR>
|
|
155 Add an observed weighted (x,y) point to the sample.</TD>
|
|
156 </TR>
|
|
157 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
158 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
159 <CODE> <A HREF="../../../../../../org/apache/commons/math/analysis/polynomials/PolynomialFunction.html" title="class in org.apache.commons.math.analysis.polynomials">PolynomialFunction</A></CODE></FONT></TD>
|
|
160 <TD><CODE><B><A HREF="../../../../../../org/apache/commons/math/optimization/fitting/PolynomialFitter.html#fit()">fit</A></B>()</CODE>
|
|
161
|
|
162 <BR>
|
|
163 Get the polynomial fitting the weighted (x, y) points.</TD>
|
|
164 </TR>
|
|
165 </TABLE>
|
|
166 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
|
167 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
168 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
|
169 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
|
|
170 </TR>
|
|
171 <TR BGCOLOR="white" CLASS="TableRowColor">
|
|
172 <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/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://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
|
|
173 </TR>
|
|
174 </TABLE>
|
|
175
|
|
176 <P>
|
|
177
|
|
178 <!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
179
|
|
180 <A NAME="constructor_detail"><!-- --></A>
|
|
181 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
182 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
183 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
|
184 <B>Constructor Detail</B></FONT></TH>
|
|
185 </TR>
|
|
186 </TABLE>
|
|
187
|
|
188 <A NAME="PolynomialFitter(int, org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer)"><!-- --></A><H3>
|
|
189 PolynomialFitter</H3>
|
|
190 <PRE>
|
|
191 public <A HREF="../../../../../../src-html/org/apache/commons/math/optimization/fitting/PolynomialFitter.html#line.48"><B>PolynomialFitter</B></A>(int degree,
|
|
192 <A HREF="../../../../../../org/apache/commons/math/optimization/DifferentiableMultivariateVectorialOptimizer.html" title="interface in org.apache.commons.math.optimization">DifferentiableMultivariateVectorialOptimizer</A> optimizer)</PRE>
|
|
193 <DL>
|
|
194 <DD>Simple constructor.
|
|
195 <p>The polynomial fitter built this way are complete polynomials,
|
|
196 ie. a n-degree polynomial has n+1 coefficients.</p>
|
|
197 <P>
|
|
198 <DL>
|
|
199 <DT><B>Parameters:</B><DD><CODE>degree</CODE> - maximal degree of the polynomial<DD><CODE>optimizer</CODE> - optimizer to use for the fitting</DL>
|
|
200 </DL>
|
|
201
|
|
202 <!-- ============ METHOD DETAIL ========== -->
|
|
203
|
|
204 <A NAME="method_detail"><!-- --></A>
|
|
205 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
|
206 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
|
207 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
|
208 <B>Method Detail</B></FONT></TH>
|
|
209 </TR>
|
|
210 </TABLE>
|
|
211
|
|
212 <A NAME="addObservedPoint(double, double, double)"><!-- --></A><H3>
|
|
213 addObservedPoint</H3>
|
|
214 <PRE>
|
|
215 public void <A HREF="../../../../../../src-html/org/apache/commons/math/optimization/fitting/PolynomialFitter.html#line.59"><B>addObservedPoint</B></A>(double weight,
|
|
216 double x,
|
|
217 double y)</PRE>
|
|
218 <DL>
|
|
219 <DD>Add an observed weighted (x,y) point to the sample.
|
|
220 <P>
|
|
221 <DD><DL>
|
|
222 <DT><B>Parameters:</B><DD><CODE>weight</CODE> - weight of the observed point in the fit<DD><CODE>x</CODE> - abscissa of the point<DD><CODE>y</CODE> - observed value of the point at x, after fitting we should
|
|
223 have P(x) as close as possible to this value</DL>
|
|
224 </DD>
|
|
225 </DL>
|
|
226 <HR>
|
|
227
|
|
228 <A NAME="fit()"><!-- --></A><H3>
|
|
229 fit</H3>
|
|
230 <PRE>
|
|
231 public <A HREF="../../../../../../org/apache/commons/math/analysis/polynomials/PolynomialFunction.html" title="class in org.apache.commons.math.analysis.polynomials">PolynomialFunction</A> <A HREF="../../../../../../src-html/org/apache/commons/math/optimization/fitting/PolynomialFitter.html#line.67"><B>fit</B></A>()
|
|
232 throws <A HREF="../../../../../../org/apache/commons/math/optimization/OptimizationException.html" title="class in org.apache.commons.math.optimization">OptimizationException</A></PRE>
|
|
233 <DL>
|
|
234 <DD>Get the polynomial fitting the weighted (x, y) points.
|
|
235 <P>
|
|
236 <DD><DL>
|
|
237
|
|
238 <DT><B>Returns:</B><DD>polynomial function best fitting the observed points
|
|
239 <DT><B>Throws:</B>
|
|
240 <DD><CODE><A HREF="../../../../../../org/apache/commons/math/optimization/OptimizationException.html" title="class in org.apache.commons.math.optimization">OptimizationException</A></CODE> - if the algorithm failed to converge</DL>
|
|
241 </DD>
|
|
242 </DL>
|
|
243 <!-- ========= END OF CLASS DATA ========= -->
|
|
244 <HR>
|
|
245
|
|
246
|
|
247 <!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
248 <A NAME="navbar_bottom"><!-- --></A>
|
|
249 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
|
250 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
|
251 <TR>
|
|
252 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
|
253 <A NAME="navbar_bottom_firstrow"><!-- --></A>
|
|
254 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
|
255 <TR ALIGN="center" VALIGN="top">
|
|
256 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
|
257 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
|
258 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
|
259 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PolynomialFitter.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
|
|
260 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
|
261 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
|
262 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
|
263 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
|
264 </TR>
|
|
265 </TABLE>
|
|
266 </TD>
|
|
267 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
|
268 </EM>
|
|
269 </TD>
|
|
270 </TR>
|
|
271
|
|
272 <TR>
|
|
273 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
274 <A HREF="../../../../../../org/apache/commons/math/optimization/fitting/ParametricRealFunction.html" title="interface in org.apache.commons.math.optimization.fitting"><B>PREV CLASS</B></A>
|
|
275 <A HREF="../../../../../../org/apache/commons/math/optimization/fitting/WeightedObservedPoint.html" title="class in org.apache.commons.math.optimization.fitting"><B>NEXT CLASS</B></A></FONT></TD>
|
|
276 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
277 <A HREF="../../../../../../index.html?org/apache/commons/math/optimization/fitting/PolynomialFitter.html" target="_top"><B>FRAMES</B></A>
|
|
278 <A HREF="PolynomialFitter.html" target="_top"><B>NO FRAMES</B></A>
|
|
279 <SCRIPT type="text/javascript">
|
|
280 <!--
|
|
281 if(window==top) {
|
|
282 document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
|
283 }
|
|
284 //-->
|
|
285 </SCRIPT>
|
|
286 <NOSCRIPT>
|
|
287 <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
|
|
288 </NOSCRIPT>
|
|
289
|
|
290
|
|
291 </FONT></TD>
|
|
292 </TR>
|
|
293 <TR>
|
|
294 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
295 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
296 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
297 DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
|
298 </TR>
|
|
299 </TABLE>
|
|
300 <A NAME="skip-navbar_bottom"></A>
|
|
301 <!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
302
|
|
303 <HR>
|
|
304 Copyright © 2003-2010 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
|
|
305 </BODY>
|
|
306 </HTML>
|