Tab police
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1499813 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a6dfb27d91
commit
99db22a8df
|
@ -97,7 +97,7 @@
|
||||||
|
|
||||||
<!-- Should Java compilations set the 'optimize' compiler option? -->
|
<!-- Should Java compilations set the 'optimize' compiler option? -->
|
||||||
<property name="compile.optimize" value="true"/>
|
<property name="compile.optimize" value="true"/>
|
||||||
|
|
||||||
<!-- File encoding -->
|
<!-- File encoding -->
|
||||||
<property name="source.encoding" value="UTF-8"/>
|
<property name="source.encoding" value="UTF-8"/>
|
||||||
|
|
||||||
|
@ -241,9 +241,9 @@
|
||||||
author="true"
|
author="true"
|
||||||
private="true"
|
private="true"
|
||||||
version="true"
|
version="true"
|
||||||
encoding="${source.encoding}"
|
encoding="${source.encoding}"
|
||||||
charset="${source.encoding}"
|
charset="${source.encoding}"
|
||||||
docencoding="${source.encoding}"
|
docencoding="${source.encoding}"
|
||||||
doctitle="<h1>${component.title} ${component.version}</h1>"
|
doctitle="<h1>${component.title} ${component.version}</h1>"
|
||||||
windowtitle="${component.title} ${component.version}"
|
windowtitle="${component.title} ${component.version}"
|
||||||
bottom="Copyright (c) 2003-${current.year} Apache Software Foundation"
|
bottom="Copyright (c) 2003-${current.year} Apache Software Foundation"
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<!-- The following equality test is intentional and needed for rounding purposes -->
|
<!-- The following equality test is intentional and needed for rounding purposes -->
|
||||||
<Match>
|
<Match>
|
||||||
<Class name="org.apache.commons.math3.util.Precision" />
|
<Class name="org.apache.commons.math3.util.Precision" />
|
||||||
<Method name="roundUnscaled" params="double,double,int" returns="double" />
|
<Method name="roundUnscaled" params="double,double,int" returns="double" />
|
||||||
<Bug pattern="FE_FLOATING_POINT_EQUALITY" />
|
<Bug pattern="FE_FLOATING_POINT_EQUALITY" />
|
||||||
</Match>
|
</Match>
|
||||||
|
|
||||||
|
|
|
@ -707,17 +707,17 @@ counterpart in either Math or StrictMath (cf. MATH-740).
|
||||||
Removed "MathRuntimeException" (from package "o.a.c.math").
|
Removed "MathRuntimeException" (from package "o.a.c.math").
|
||||||
</action>
|
</action>
|
||||||
<action dev="tn" type="fix" issue="MATH-739">
|
<action dev="tn" type="fix" issue="MATH-739">
|
||||||
Merged interface and implementation of statistical tests in
|
Merged interface and implementation of statistical tests in
|
||||||
o.a.c.m.stat.inference package.
|
o.a.c.m.stat.inference package.
|
||||||
</action>
|
</action>
|
||||||
<action dev="tn" type="update" issue="MATH-670">
|
<action dev="tn" type="update" issue="MATH-670">
|
||||||
Merged interface and implementation of EmpiricalDistribution.
|
Merged interface and implementation of EmpiricalDistribution.
|
||||||
</action>
|
</action>
|
||||||
<action dev="tn" type="fix" issue="MATH-588">
|
<action dev="tn" type="fix" issue="MATH-588">
|
||||||
Relaxed test for equality in UnivariateStatisticAbstractTest.
|
Relaxed test for equality in UnivariateStatisticAbstractTest.
|
||||||
</action>
|
</action>
|
||||||
<action dev="tn" type="update" issue="MATH-575">
|
<action dev="tn" type="update" issue="MATH-575">
|
||||||
Modified the genetics package to use localized exception messages.
|
Modified the genetics package to use localized exception messages.
|
||||||
</action>
|
</action>
|
||||||
<action dev="tn" type="fix" issue="MATH-652" due-to="Greg Sterijevski">
|
<action dev="tn" type="fix" issue="MATH-652" due-to="Greg Sterijevski">
|
||||||
Fixed a faulty test for zero in TridiagonalTransformer.
|
Fixed a faulty test for zero in TridiagonalTransformer.
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class MidPointIntegrator extends BaseAbstractUnivariateIntegrator {
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
protected double doIntegrate()
|
protected double doIntegrate()
|
||||||
throws MathIllegalArgumentException, TooManyEvaluationsException, MaxCountExceededException {
|
throws MathIllegalArgumentException, TooManyEvaluationsException, MaxCountExceededException {
|
||||||
|
|
||||||
final double min = getMin();
|
final double min = getMin();
|
||||||
|
|
|
@ -41,22 +41,22 @@
|
||||||
MeasurementModel</a>, which contain the corresponding transformation and noise covariance matrices.
|
MeasurementModel</a>, which contain the corresponding transformation and noise covariance matrices.
|
||||||
The parameter names used in the respective models correspond to the following names commonly used
|
The parameter names used in the respective models correspond to the following names commonly used
|
||||||
in the mathematical literature:
|
in the mathematical literature:
|
||||||
<ul>
|
<ul>
|
||||||
<li>A - state transition matrix</li>
|
<li>A - state transition matrix</li>
|
||||||
<li>B - control input matrix</li>
|
<li>B - control input matrix</li>
|
||||||
<li>H - measurement matrix</li>
|
<li>H - measurement matrix</li>
|
||||||
<li>Q - process noise covariance matrix</li>
|
<li>Q - process noise covariance matrix</li>
|
||||||
<li>R - measurement noise covariance matrix</li>
|
<li>R - measurement noise covariance matrix</li>
|
||||||
<li>P - error covariance matrix</li>
|
<li>P - error covariance matrix</li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Initialization</dt>
|
<dt>Initialization</dt>
|
||||||
<dd> The following code will create a Kalman filter using the provided
|
<dd> The following code will create a Kalman filter using the provided
|
||||||
DefaultMeasurementModel and DefaultProcessModel classes. To support dynamically changing
|
DefaultMeasurementModel and DefaultProcessModel classes. To support dynamically changing
|
||||||
process and measurement noises, simply implement your own models.
|
process and measurement noises, simply implement your own models.
|
||||||
<source>
|
<source>
|
||||||
// A = [ 1 ]
|
// A = [ 1 ]
|
||||||
RealMatrix A = new Array2DRowRealMatrix(new double[] { 1d });
|
RealMatrix A = new Array2DRowRealMatrix(new double[] { 1d });
|
||||||
// no control input
|
// no control input
|
||||||
|
@ -72,11 +72,11 @@ ProcessModel pm
|
||||||
= new DefaultProcessModel(A, B, Q, new ArrayRealVector(new double[] { 0 }), null);
|
= new DefaultProcessModel(A, B, Q, new ArrayRealVector(new double[] { 0 }), null);
|
||||||
MeasurementModel mm = new DefaultMeasurementModel(H, R);
|
MeasurementModel mm = new DefaultMeasurementModel(H, R);
|
||||||
KalmanFilter filter = new KalmanFilter(pm, mm);
|
KalmanFilter filter = new KalmanFilter(pm, mm);
|
||||||
</source>
|
</source>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Iteration</dt>
|
<dt>Iteration</dt>
|
||||||
<dd>The following code illustrates how to perform the predict/correct cycle:
|
<dd>The following code illustrates how to perform the predict/correct cycle:
|
||||||
<source>
|
<source>
|
||||||
for (;;) {
|
for (;;) {
|
||||||
// predict the state estimate one time-step ahead
|
// predict the state estimate one time-step ahead
|
||||||
// optionally provide some control input
|
// optionally provide some control input
|
||||||
|
@ -91,9 +91,9 @@ for (;;) {
|
||||||
double[] stateEstimate = filter.getStateEstimation();
|
double[] stateEstimate = filter.getStateEstimation();
|
||||||
// do something with it
|
// do something with it
|
||||||
}
|
}
|
||||||
</source>
|
</source>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Constant Voltage Example</dt>
|
<dt>Constant Voltage Example</dt>
|
||||||
<dd>The following example creates a Kalman filter for a static process: a system with a
|
<dd>The following example creates a Kalman filter for a static process: a system with a
|
||||||
constant voltage as internal state. We observe this process with an artificially
|
constant voltage as internal state. We observe this process with an artificially
|
||||||
imposed measurement noise of 0.1V and assume an internal process noise of 1e-5V.
|
imposed measurement noise of 0.1V and assume an internal process noise of 1e-5V.
|
||||||
|
@ -148,7 +148,7 @@ for (int i = 0; i < 60; i++) {
|
||||||
}
|
}
|
||||||
</source>
|
</source>
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Increasing Speed Vehicle Example</dt>
|
<dt>Increasing Speed Vehicle Example</dt>
|
||||||
<dd>The following example creates a Kalman filter for a simple linear process: a
|
<dd>The following example creates a Kalman filter for a simple linear process: a
|
||||||
vehicle driving along a street with a velocity increasing at a constant rate. The process
|
vehicle driving along a street with a velocity increasing at a constant rate. The process
|
||||||
state is modeled as (position, velocity) and we only observe the position. A measurement
|
state is modeled as (position, velocity) and we only observe the position. A measurement
|
||||||
|
|
|
@ -164,7 +164,7 @@
|
||||||
</p>
|
</p>
|
||||||
</subsection>
|
</subsection>
|
||||||
<subsection name="11.3 Binary Space Partitioning" href="partitioning">
|
<subsection name="11.3 Binary Space Partitioning" href="partitioning">
|
||||||
<p>
|
<p>
|
||||||
<a href="../apidocs/org/apache/commons/math3/geometry/partitioning/BSPTree.html">
|
<a href="../apidocs/org/apache/commons/math3/geometry/partitioning/BSPTree.html">
|
||||||
BSP trees</a> are an efficient way to represent space partitions and
|
BSP trees</a> are an efficient way to represent space partitions and
|
||||||
to associate attributes with each cell. Each node in a BSP tree
|
to associate attributes with each cell. Each node in a BSP tree
|
||||||
|
|
|
@ -253,11 +253,11 @@
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Quadratic Problem Example</dt>
|
<dt>Quadratic Problem Example</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
||||||
|
|
||||||
We are looking to find the best parameters [a, b, c] for the quadratic function
|
We are looking to find the best parameters [a, b, c] for the quadratic function
|
||||||
<b><code>f(x) = a x<sup>2</sup> + b x + c</code></b>.
|
<b><code>f(x) = a x<sup>2</sup> + b x + c</code></b>.
|
||||||
The data set below was generated using [a = 8, b = 10, c = 16].
|
The data set below was generated using [a = 8, b = 10, c = 16].
|
||||||
A random number between zero and one was added to each y value calculated.
|
A random number between zero and one was added to each y value calculated.
|
||||||
|
|
||||||
<table cellspacing="0" cellpadding="3">
|
<table cellspacing="0" cellpadding="3">
|
||||||
|
@ -323,9 +323,9 @@ We'll tackle the implementation of the <code>MultivariateMatrixFunction jacobian
|
||||||
In this case the Jacobian is the partial derivative of the function with respect
|
In this case the Jacobian is the partial derivative of the function with respect
|
||||||
to the parameters a, b and c. These derivatives are computed as follows:
|
to the parameters a, b and c. These derivatives are computed as follows:
|
||||||
<ul>
|
<ul>
|
||||||
<li>d(ax<sup>2</sup> + bx + c)/da = x<sup>2</sup></li>
|
<li>d(ax<sup>2</sup> + bx + c)/da = x<sup>2</sup></li>
|
||||||
<li>d(ax<sup>2</sup> + bx + c)/db = x</li>
|
<li>d(ax<sup>2</sup> + bx + c)/db = x</li>
|
||||||
<li>d(ax<sup>2</sup> + bx + c)/dc = 1</li>
|
<li>d(ax<sup>2</sup> + bx + c)/dc = 1</li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -478,11 +478,11 @@ private static class QuadraticProblem
|
||||||
}
|
}
|
||||||
|
|
||||||
public double[] calculateTarget() {
|
public double[] calculateTarget() {
|
||||||
double[] target = new double[y.size()];
|
double[] target = new double[y.size()];
|
||||||
for (int i = 0; i < y.size(); i++) {
|
for (int i = 0; i < y.size(); i++) {
|
||||||
target[i] = y.get(i).doubleValue();
|
target[i] = y.get(i).doubleValue();
|
||||||
}
|
}
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double[][] jacobian(double[] variables) {
|
private double[][] jacobian(double[] variables) {
|
||||||
|
|
|
@ -81,8 +81,8 @@ public abstract class GaussianQuadratureAbstractTest {
|
||||||
*/
|
*/
|
||||||
public abstract double getExpectedValue(final int n);
|
public abstract double getExpectedValue(final int n);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks that the value of the integral of each monomial
|
* Checks that the value of the integral of each monomial
|
||||||
* <code>x<sup>0</sup>, ... , x<sup>p</sup></code>
|
* <code>x<sup>0</sup>, ... , x<sup>p</sup></code>
|
||||||
* returned by the quadrature rule under test conforms with the expected
|
* returned by the quadrature rule under test conforms with the expected
|
||||||
* value.
|
* value.
|
||||||
|
@ -104,7 +104,7 @@ public abstract class GaussianQuadratureAbstractTest {
|
||||||
" with a " +
|
" with a " +
|
||||||
integrator.getNumberOfPoints() + "-point quadrature rule",
|
integrator.getNumberOfPoints() + "-point quadrature rule",
|
||||||
expected, actual, eps);
|
expected, actual, eps);
|
||||||
} else {
|
} else {
|
||||||
double err = Math.abs(actual - expected) / Math.ulp(expected);
|
double err = Math.abs(actual - expected) / Math.ulp(expected);
|
||||||
Assert.assertEquals("while integrating monomial x**" + n + " with a " +
|
Assert.assertEquals("while integrating monomial x**" + n + " with a " +
|
||||||
+ integrator.getNumberOfPoints() + "-point quadrature rule, " +
|
+ integrator.getNumberOfPoints() + "-point quadrature rule, " +
|
||||||
|
|
|
@ -955,7 +955,7 @@ public class RandomDataGeneratorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] labels = {"{0, 1, 2}", "{ 0, 2, 1 }", "{ 1, 0, 2 }",
|
String[] labels = {"{0, 1, 2}", "{ 0, 2, 1 }", "{ 1, 0, 2 }",
|
||||||
"{ 1, 2, 0 }", "{ 2, 0, 1 }", "{ 2, 1, 0 }"};
|
"{ 1, 2, 0 }", "{ 2, 0, 1 }", "{ 2, 1, 0 }"};
|
||||||
TestUtils.assertChiSquareAccept(labels, expected, observed, 0.001);
|
TestUtils.assertChiSquareAccept(labels, expected, observed, 0.001);
|
||||||
|
|
||||||
// Check size = 1 boundary case
|
// Check size = 1 boundary case
|
||||||
|
|
Loading…
Reference in New Issue