From 53ec46ba272e23c0c96ada42f26f4e70e96f3115 Mon Sep 17 00:00:00 2001 From: Ray DeCampo Date: Sun, 7 May 2017 12:35:54 -0400 Subject: [PATCH] Fix some javadoc issues. --- .../interpolation/SplineInterpolator.java | 2 +- .../commons/math4/complex/Quaternion.java | 2 +- .../commons/math4/complex/RootsOfUnity.java | 2 +- .../org/apache/commons/math4/dfp/Dfp.java | 8 +- .../commons/math4/dfp/package-info.java | 4 +- .../distribution/EmpiricalDistribution.java | 24 +-- .../EnumeratedIntegerDistribution.java | 2 +- .../math4/distribution/GammaDistribution.java | 1 - .../distribution/ParetoDistribution.java | 1 - .../distribution/PascalDistribution.java | 10 +- .../math4/distribution/ZipfDistribution.java | 1 - ...eNormalMixtureExpectationMaximization.java | 2 +- .../math4/fitting/AbstractCurveFitter.java | 4 +- .../math4/fitting/GaussianCurveFitter.java | 2 +- .../math4/fitting/HarmonicCurveFitter.java | 2 +- .../math4/fitting/PolynomialCurveFitter.java | 2 +- .../leastsquares/AbstractEvaluation.java | 2 +- .../leastsquares/GaussNewtonOptimizer.java | 10 +- .../leastsquares/LeastSquaresAdapter.java | 2 +- .../leastsquares/LeastSquaresBuilder.java | 2 +- .../leastsquares/LeastSquaresProblem.java | 2 +- .../LevenbergMarquardtOptimizer.java | 6 +- .../fitting/leastsquares/package-info.java | 4 +- .../commons/math4/fraction/BigFraction.java | 2 - .../commons/math4/fraction/Fraction.java | 2 - .../math4/genetics/GeneticAlgorithm.java | 1 - .../euclidean/threed/FieldVector3D.java | 2 +- .../geometry/euclidean/threed/Vector3D.java | 2 +- .../math4/linear/AbstractFieldMatrix.java | 2 +- .../math4/linear/Array2DRowFieldMatrix.java | 4 +- .../math4/linear/BlockFieldMatrix.java | 5 +- .../commons/math4/linear/BlockRealMatrix.java | 1 - .../math4/linear/ConjugateGradient.java | 7 +- .../commons/math4/linear/DiagonalMatrix.java | 4 +- .../commons/math4/linear/FieldMatrix.java | 3 +- .../commons/math4/linear/MatrixUtils.java | 2 - .../PreconditionedIterativeLinearSolver.java | 2 +- .../math4/linear/RRQRDecomposition.java | 2 +- .../math4/linear/RealLinearOperator.java | 2 +- .../commons/math4/linear/RealMatrix.java | 2 +- .../commons/math4/linear/RealVector.java | 4 +- .../RectangularCholeskyDecomposition.java | 2 +- .../math4/linear/SparseFieldMatrix.java | 2 +- .../apache/commons/math4/linear/SymmLQ.java | 8 +- .../ml/clustering/FuzzyKMeansClusterer.java | 4 +- .../commons/math4/ml/neuralnet/Neuron.java | 4 +- .../ml/neuralnet/SquareNeighbourhood.java | 4 +- .../math4/ml/neuralnet/oned/NeuronString.java | 4 +- .../neuralnet/sofm/KohonenUpdateAction.java | 6 +- .../sofm/util/ExponentialDecayFunction.java | 2 +- .../sofm/util/QuasiSigmoidDecayFunction.java | 2 +- .../ml/neuralnet/twod/NeuronSquareMesh2D.java | 6 +- .../twod/util/SmoothedDataHistogram.java | 4 +- .../commons/math4/ode/JacobianMatrices.java | 1 - .../math4/ode/MultistepFieldIntegrator.java | 10 +- .../math4/ode/MultistepIntegrator.java | 10 +- .../math4/ode/events/EventHandler.java | 2 +- .../math4/ode/events/FieldEventHandler.java | 2 +- .../AdamsBashforthFieldIntegrator.java | 29 ++- .../nonstiff/AdamsBashforthIntegrator.java | 29 ++- .../ode/nonstiff/AdamsFieldIntegrator.java | 12 +- .../math4/ode/nonstiff/AdamsIntegrator.java | 12 +- .../nonstiff/AdamsMoultonFieldIntegrator.java | 29 ++- .../ode/nonstiff/AdamsMoultonIntegrator.java | 29 ++- .../AdamsNordsieckFieldTransformer.java | 43 ++-- .../nonstiff/AdamsNordsieckTransformer.java | 43 ++-- .../AdaptiveStepsizeFieldIntegrator.java | 6 +- .../nonstiff/AdaptiveStepsizeIntegrator.java | 6 +- .../ClassicalRungeKuttaFieldIntegrator.java | 1 - ...ssicalRungeKuttaFieldStepInterpolator.java | 1 - .../ClassicalRungeKuttaIntegrator.java | 1 - .../ClassicalRungeKuttaStepInterpolator.java | 1 - .../DormandPrince54FieldIntegrator.java | 2 +- .../nonstiff/DormandPrince54Integrator.java | 2 +- .../EmbeddedRungeKuttaFieldIntegrator.java | 1 - .../EmbeddedRungeKuttaIntegrator.java | 1 - .../nonstiff/EulerFieldStepInterpolator.java | 1 - .../ode/nonstiff/EulerStepInterpolator.java | 1 - .../ode/nonstiff/GillFieldIntegrator.java | 2 +- .../nonstiff/GillFieldStepInterpolator.java | 1 - .../math4/ode/nonstiff/GillIntegrator.java | 2 +- .../ode/nonstiff/GillStepInterpolator.java | 1 - .../GraggBulirschStoerIntegrator.java | 17 +- .../ode/nonstiff/LutherFieldIntegrator.java | 2 +- .../math4/ode/nonstiff/LutherIntegrator.java | 2 +- .../ode/nonstiff/MidpointFieldIntegrator.java | 1 - .../MidpointFieldStepInterpolator.java | 1 - .../ode/nonstiff/MidpointIntegrator.java | 1 - .../nonstiff/MidpointStepInterpolator.java | 1 - .../nonstiff/RungeKuttaFieldIntegrator.java | 1 - .../ode/nonstiff/RungeKuttaIntegrator.java | 1 - .../ThreeEighthesFieldIntegrator.java | 1 - .../ThreeEighthesFieldStepInterpolator.java | 1 - .../ode/nonstiff/ThreeEighthesIntegrator.java | 1 - .../ThreeEighthesStepInterpolator.java | 1 - .../commons/math4/ode/package-info.java | 15 +- .../ode/sampling/FieldStepNormalizer.java | 10 +- .../math4/ode/sampling/StepNormalizer.java | 10 +- .../BaseMultiStartMultivariateOptimizer.java | 6 +- .../math4/optim/ConvergenceChecker.java | 4 +- .../commons/math4/optim/InitialGuess.java | 2 +- .../commons/math4/optim/SimpleBounds.java | 2 +- .../math4/optim/SimplePointChecker.java | 2 +- .../math4/optim/SimpleValueChecker.java | 2 +- .../math4/optim/SimpleVectorValueChecker.java | 2 +- .../math4/optim/linear/LinearConstraint.java | 21 +- .../optim/linear/LinearObjectiveFunction.java | 5 +- .../scalar/LeastSquaresConverter.java | 18 +- .../MultivariateFunctionPenaltyAdapter.java | 6 +- .../NonLinearConjugateGradientOptimizer.java | 4 +- .../scalar/noderiv/AbstractSimplex.java | 4 +- .../scalar/noderiv/BOBYQAOptimizer.java | 10 +- .../scalar/noderiv/CMAESOptimizer.java | 6 +- .../scalar/noderiv/PowellOptimizer.java | 10 +- .../scalar/noderiv/SimplexOptimizer.java | 4 +- .../commons/math4/optim/package-info.java | 2 +- .../optim/univariate/BrentOptimizer.java | 2 +- .../MultiStartUnivariateOptimizer.java | 4 +- .../optim/univariate/SearchInterval.java | 2 +- .../SimpleUnivariateValueChecker.java | 2 +- .../commons/math4/random/RngAdaptor.java | 2 +- .../apache/commons/math4/special/BesselJ.java | 7 +- .../org/apache/commons/math4/special/Erf.java | 10 +- .../apache/commons/math4/stat/Frequency.java | 2 +- .../apache/commons/math4/stat/StatUtils.java | 6 - .../stat/correlation/KendallsCorrelation.java | 6 +- .../stat/correlation/PearsonsCorrelation.java | 8 +- .../descriptive/DescriptiveStatistics.java | 2 +- .../MultivariateSummaryStatistics.java | 14 +- .../stat/descriptive/SummaryStatistics.java | 16 +- .../stat/descriptive/moment/FirstMoment.java | 3 +- .../descriptive/moment/GeometricMean.java | 4 +- .../math4/stat/descriptive/moment/Mean.java | 4 +- .../stat/descriptive/moment/SecondMoment.java | 2 +- .../stat/descriptive/moment/SemiVariance.java | 4 +- .../stat/descriptive/moment/Variance.java | 24 +-- .../math4/stat/descriptive/package-info.java | 26 +-- .../math4/stat/descriptive/rank/Max.java | 6 +- .../math4/stat/descriptive/rank/Min.java | 6 +- .../descriptive/rank/PSquarePercentile.java | 2 +- .../stat/descriptive/rank/Percentile.java | 19 +- .../stat/descriptive/summary/Product.java | 4 +- .../math4/stat/descriptive/summary/Sum.java | 8 +- .../stat/descriptive/summary/SumOfLogs.java | 2 +- .../math4/stat/inference/BinomialTest.java | 2 +- .../math4/stat/inference/ChiSquareTest.java | 20 +- .../commons/math4/stat/inference/GTest.java | 26 +-- .../stat/inference/InferenceTestUtils.java | 198 +++++++++++++++++- .../stat/inference/KolmogorovSmirnovTest.java | 40 ++-- .../stat/inference/MannWhitneyUTest.java | 4 +- .../math4/stat/inference/OneWayAnova.java | 16 +- .../commons/math4/stat/inference/TTest.java | 75 ++++--- .../inference/WilcoxonSignedRankTest.java | 8 +- .../interval/BinomialConfidenceInterval.java | 1 - .../stat/interval/ConfidenceInterval.java | 1 - .../math4/stat/interval/IntervalUtils.java | 1 - .../math4/stat/ranking/NaturalRanking.java | 4 +- .../AbstractMultipleLinearRegression.java | 4 +- .../regression/MillerUpdatingRegression.java | 4 +- .../OLSMultipleLinearRegression.java | 6 +- .../stat/regression/RegressionResults.java | 8 +- .../stat/regression/SimpleRegression.java | 20 +- .../transform/FastCosineTransformer.java | 2 +- .../transform/FastHadamardTransformer.java | 18 +- .../math4/transform/FastSineTransformer.java | 2 +- .../commons/math4/util/Combinations.java | 4 +- .../math4/util/CombinatoricsUtils.java | 9 +- .../commons/math4/util/ContinuedFraction.java | 2 - .../apache/commons/math4/util/FastMath.java | 28 +-- .../commons/math4/util/IntegerSequence.java | 14 +- .../apache/commons/math4/util/MathArrays.java | 42 ++-- .../apache/commons/math4/util/MathUtils.java | 6 +- .../math4/util/MultidimensionalCounter.java | 2 +- .../org/apache/commons/math4/util/Pair.java | 2 +- .../math4/util/ResizableDoubleArray.java | 2 +- ...ractLeastSquaresOptimizerAbstractTest.java | 2 +- .../EvaluationTestValidation.java | 14 +- ...nLinearConjugateGradientOptimizerTest.java | 2 +- .../util/FastMathStrictComparisonTest.java | 6 +- .../sofm/ChineseRingsClassifier.java | 2 +- 180 files changed, 778 insertions(+), 667 deletions(-) diff --git a/src/main/java/org/apache/commons/math4/analysis/interpolation/SplineInterpolator.java b/src/main/java/org/apache/commons/math4/analysis/interpolation/SplineInterpolator.java index 77dc7b19f..9515dde87 100644 --- a/src/main/java/org/apache/commons/math4/analysis/interpolation/SplineInterpolator.java +++ b/src/main/java/org/apache/commons/math4/analysis/interpolation/SplineInterpolator.java @@ -42,7 +42,7 @@ import org.apache.commons.math4.util.MathArrays; * corresponding y value. *
  • Adjacent polynomials are equal through two derivatives at the knot points (i.e., adjacent polynomials * "match up" at the knot points, as do their first and second derivatives).
  • - *

    + * *

    * The cubic spline interpolation algorithm implemented is as described in R.L. Burden, J.D. Faires, * Numerical Analysis, 4th Ed., 1989, PWS-Kent, ISBN 0-53491-585-X, pp 126-131. diff --git a/src/main/java/org/apache/commons/math4/complex/Quaternion.java b/src/main/java/org/apache/commons/math4/complex/Quaternion.java index 0394d18b2..f5f22cc72 100644 --- a/src/main/java/org/apache/commons/math4/complex/Quaternion.java +++ b/src/main/java/org/apache/commons/math4/complex/Quaternion.java @@ -29,7 +29,7 @@ import org.apache.commons.numbers.core.Precision; /** * This class implements * quaternions (Hamilton's hypercomplex numbers). - *
    + *
    * Instance of this class are guaranteed to be immutable. * * @since 3.1 diff --git a/src/main/java/org/apache/commons/math4/complex/RootsOfUnity.java b/src/main/java/org/apache/commons/math4/complex/RootsOfUnity.java index 80fcb4bc0..9d4079e98 100644 --- a/src/main/java/org/apache/commons/math4/complex/RootsOfUnity.java +++ b/src/main/java/org/apache/commons/math4/complex/RootsOfUnity.java @@ -107,7 +107,7 @@ public class RootsOfUnity implements Serializable { *

    * * @param n the (signed) number of roots of unity to be computed diff --git a/src/main/java/org/apache/commons/math4/dfp/Dfp.java b/src/main/java/org/apache/commons/math4/dfp/Dfp.java index 4c02ac0fa..22f2868d8 100644 --- a/src/main/java/org/apache/commons/math4/dfp/Dfp.java +++ b/src/main/java/org/apache/commons/math4/dfp/Dfp.java @@ -39,7 +39,7 @@ import org.apache.commons.math4.util.FastMath; * algebraic operation *
  • Comply with IEEE 854-1987 as much as possible. * (See IEEE 854-1987 notes below)
  • - *

    + * * *

    Trade offs: *

      @@ -48,15 +48,15 @@ import org.apache.commons.math4.util.FastMath; *
    1. Digits are bigger, so rounding is a greater loss. So, if you * really need 12 decimal digits, better use 4 base 10000 digits * there can be one partially filled.
    2. - *

    + * * *

    Numbers are represented in the following form: *

    - *  n  =  sign × mant × (radix)exp;

    + * n = sign × mant × (radix)exp; *
    * where sign is ±1, mantissa represents a fractional number between * zero and one. mant[0] is the least significant digit. - * exp is in the range of -32767 to 32768

    + * exp is in the range of -32767 to 32768 * *

    IEEE 854-1987 Notes and differences

    * diff --git a/src/main/java/org/apache/commons/math4/dfp/package-info.java b/src/main/java/org/apache/commons/math4/dfp/package-info.java index 4013231cf..7ad965a7e 100644 --- a/src/main/java/org/apache/commons/math4/dfp/package-info.java +++ b/src/main/java/org/apache/commons/math4/dfp/package-info.java @@ -31,7 +31,7 @@ * algebraic operation *
  • Comply with IEEE 854-1987 as much as possible. * (See IEEE 854-1987 notes below)
  • - *

    + * * *

    Trade offs: *

      @@ -40,7 +40,7 @@ *
    1. Digits are bigger, so rounding is a greater loss. So, if you * really need 12 decimal digits, better use 4 base 10000 digits * there can be one partially filled.
    2. - *

    + * * *

    Numbers are represented in the following form: *

    diff --git a/src/main/java/org/apache/commons/math4/distribution/EmpiricalDistribution.java b/src/main/java/org/apache/commons/math4/distribution/EmpiricalDistribution.java
    index 755d97edd..567c7c204 100644
    --- a/src/main/java/org/apache/commons/math4/distribution/EmpiricalDistribution.java
    +++ b/src/main/java/org/apache/commons/math4/distribution/EmpiricalDistribution.java
    @@ -76,7 +76,7 @@ import org.apache.commons.math4.util.MathUtils;
      * 
  • Generate a uniformly distributed value in (0,1)
  • *
  • Select the subinterval to which the value belongs. *
  • Generate a random Gaussian value with mean = mean of the associated - * bin and std dev = std dev of associated bin.
  • + * bin and std dev = std dev of associated bin. * *

    EmpiricalDistribution implements the {@link RealDistribution} interface * as follows. Given x within the range of values in the dataset, let B @@ -94,7 +94,7 @@ import org.apache.commons.math4.util.MathUtils; * by 10. *

  • The input file must be a plain text file containing one valid numeric * entry per line.
  • - *

    + * * */ public class EmpiricalDistribution extends AbstractRealDistribution { @@ -434,7 +434,7 @@ public class EmpiricalDistribution extends AbstractRealDistribution { /** *

    Returns a fresh copy of the array of upper bounds for the bins. - * Bins are:
    + * Bins are:
    * [min,upperBounds[0]],(upperBounds[0],upperBounds[1]],..., * (upperBounds[binCount-2], upperBounds[binCount-1] = max].

    * @@ -508,7 +508,7 @@ public class EmpiricalDistribution extends AbstractRealDistribution { *
  • Compute K(B) = the mass of B with respect to the within-bin kernel (i.e., the * integral of the kernel density over B).
  • *
  • Return k(x) * P(B) / K(B), where k is the within-bin kernel density - * and P(B) is the mass of B.
  • + * and P(B) is the mass of B. * @since 3.1 */ @Override @@ -569,16 +569,16 @@ public class EmpiricalDistribution extends AbstractRealDistribution { *
  • Find the smallest i such that the sum of the masses of the bins * through i is at least p.
  • *
  • - * Let K be the within-bin kernel distribution for bin i.
    - * Let K(B) be the mass of B under K.
    + * Let K be the within-bin kernel distribution for bin i.
    + * Let K(B) be the mass of B under K.
    * Let K(B-) be K evaluated at the lower endpoint of B (the combined - * mass of the bins below B under K).
    - * Let P(B) be the probability of bin i.
    - * Let P(B-) be the sum of the bin masses below bin i.
    - * Let pCrit = p - P(B-)
    - *
  • Return the inverse of K evaluated at
    + * mass of the bins below B under K).
    + * Let P(B) be the probability of bin i.
    + * Let P(B-) be the sum of the bin masses below bin i.
    + * Let pCrit = p - P(B-)
    + *
  • Return the inverse of K evaluated at
    * K(B-) + pCrit * K(B) / P(B)
  • - *

    + * * * @since 3.1 */ diff --git a/src/main/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistribution.java b/src/main/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistribution.java index f507a5375..25ef0f23b 100644 --- a/src/main/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistribution.java @@ -34,7 +34,7 @@ import org.apache.commons.math4.util.Pair; *

    Implementation of an integer-valued {@link EnumeratedDistribution}.

    * *

    Values with zero-probability are allowed but they do not extend the - * support.
    + * support.
    * Duplicate values are allowed. Probabilities of duplicate values are combined * when computing cumulative probabilities and statistics.

    * diff --git a/src/main/java/org/apache/commons/math4/distribution/GammaDistribution.java b/src/main/java/org/apache/commons/math4/distribution/GammaDistribution.java index db6feb6a7..1f9d5eecc 100644 --- a/src/main/java/org/apache/commons/math4/distribution/GammaDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/GammaDistribution.java @@ -375,7 +375,6 @@ public class GammaDistribution extends AbstractRealDistribution { * * * - *

    */ @Override public RealDistribution.Sampler createSampler(final UniformRandomProvider rng) { diff --git a/src/main/java/org/apache/commons/math4/distribution/ParetoDistribution.java b/src/main/java/org/apache/commons/math4/distribution/ParetoDistribution.java index 10fbaad1e..b4bff1c68 100644 --- a/src/main/java/org/apache/commons/math4/distribution/ParetoDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/ParetoDistribution.java @@ -33,7 +33,6 @@ import org.apache.commons.rng.sampling.distribution.InverseTransformParetoSample *
      *  α * k^α / x^(α + 1)
      * 
    - *

    *

    * {@code H(N,s)} is the normalizing constant * which corresponds to the generalized harmonic number of order N of s. - *

    *

    - *

    * * @param value * the double value to convert to a fraction. diff --git a/src/main/java/org/apache/commons/math4/fraction/Fraction.java b/src/main/java/org/apache/commons/math4/fraction/Fraction.java index 834573c8a..d41000087 100644 --- a/src/main/java/org/apache/commons/math4/fraction/Fraction.java +++ b/src/main/java/org/apache/commons/math4/fraction/Fraction.java @@ -109,7 +109,6 @@ public class Fraction *
  • * Continued Fraction equations (11) and (22)-(26)
  • * - *

    * @param value the double value to convert to a fraction. * @param epsilon maximum error allowed. The resulting fraction is within * {@code epsilon} of {@code value}, in absolute terms. @@ -131,7 +130,6 @@ public class Fraction *
  • * Continued Fraction equations (11) and (22)-(26)
  • * - *

    * @param value the double value to convert to a fraction. * @param maxDenominator The maximum allowed value for denominator * @throws FractionConversionException if the continued fraction failed to diff --git a/src/main/java/org/apache/commons/math4/genetics/GeneticAlgorithm.java b/src/main/java/org/apache/commons/math4/genetics/GeneticAlgorithm.java index e4fcf4cb7..5dd2be209 100644 --- a/src/main/java/org/apache/commons/math4/genetics/GeneticAlgorithm.java +++ b/src/main/java/org/apache/commons/math4/genetics/GeneticAlgorithm.java @@ -125,7 +125,6 @@ public class GeneticAlgorithm { /** * Evolve the given population into the next generation. - *

    *

      *
    1. Get nextGeneration population to fill from current * generation, using its nextGeneration method
    2. diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3D.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3D.java index bec2d74e8..4f04edfa8 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3D.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3D.java @@ -538,7 +538,7 @@ public class FieldVector3D> implements Serializabl * Vector3D k = u.normalize(); * Vector3D i = k.orthogonal(); * Vector3D j = Vector3D.crossProduct(k, i); - *

      + * * @return a new normalized vector orthogonal to the instance * @exception MathArithmeticException if the norm of the instance is null */ diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3D.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3D.java index 7e43245b0..1d00387c1 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3D.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3D.java @@ -323,7 +323,7 @@ public class Vector3D implements Serializable, Vector { * Vector3D k = u.normalize(); * Vector3D i = k.orthogonal(); * Vector3D j = Vector3D.crossProduct(k, i); - *

      + * * @return a new normalized vector orthogonal to the instance * @exception MathArithmeticException if the norm of the instance is null */ diff --git a/src/main/java/org/apache/commons/math4/linear/AbstractFieldMatrix.java b/src/main/java/org/apache/commons/math4/linear/AbstractFieldMatrix.java index a182e49a9..c2f3b1803 100644 --- a/src/main/java/org/apache/commons/math4/linear/AbstractFieldMatrix.java +++ b/src/main/java/org/apache/commons/math4/linear/AbstractFieldMatrix.java @@ -61,7 +61,7 @@ public abstract class AbstractFieldMatrix> } /** - * Create a new FieldMatrix with the supplied row and column dimensions. + * Create a new {@code FieldMatrix} with the supplied row and column dimensions. * * @param field Field to which the elements belong. * @param rowDimension Number of rows in the new matrix. diff --git a/src/main/java/org/apache/commons/math4/linear/Array2DRowFieldMatrix.java b/src/main/java/org/apache/commons/math4/linear/Array2DRowFieldMatrix.java index 7a7093190..f49f88860 100644 --- a/src/main/java/org/apache/commons/math4/linear/Array2DRowFieldMatrix.java +++ b/src/main/java/org/apache/commons/math4/linear/Array2DRowFieldMatrix.java @@ -33,11 +33,11 @@ import org.apache.commons.math4.util.MathArrays; import org.apache.commons.math4.util.MathUtils; /** - * Implementation of FieldMatrix using a {@link FieldElement}[][] array to store entries. + * Implementation of {@code FieldMatrix} using a {@link FieldElement}[][] array to store entries. *

      * As specified in the {@link FieldMatrix} interface, matrix element indexing * is 0-based -- e.g., getEntry(0, 0) - * returns the element in the first row, first column of the matrix. + * returns the element in the first row, first column of the matrix. *

      * * @param the type of the field elements diff --git a/src/main/java/org/apache/commons/math4/linear/BlockFieldMatrix.java b/src/main/java/org/apache/commons/math4/linear/BlockFieldMatrix.java index 74c6fe8d3..03417a3d2 100644 --- a/src/main/java/org/apache/commons/math4/linear/BlockFieldMatrix.java +++ b/src/main/java/org/apache/commons/math4/linear/BlockFieldMatrix.java @@ -115,9 +115,8 @@ public class BlockFieldMatrix> extends AbstractFieldMa * Create a new dense matrix copying entries from raw layout data. *

      The input array must already be in raw layout.

      *

      Calling this constructor is equivalent to call: - *

      matrix = new BlockFieldMatrix(getField(), rawData.length, rawData[0].length,
      -     *                                   toBlocksLayout(rawData), false);
      - *

      + * {@code matrix = new BlockFieldMatrix(getField(), rawData.length, rawData[0].length, + * toBlocksLayout(rawData), false);} * * @param rawData Data for the new matrix, in raw layout. * @throws DimensionMismatchException if the {@code blockData} shape is diff --git a/src/main/java/org/apache/commons/math4/linear/BlockRealMatrix.java b/src/main/java/org/apache/commons/math4/linear/BlockRealMatrix.java index 7554007d1..20192aded 100644 --- a/src/main/java/org/apache/commons/math4/linear/BlockRealMatrix.java +++ b/src/main/java/org/apache/commons/math4/linear/BlockRealMatrix.java @@ -112,7 +112,6 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable *

      Calling this constructor is equivalent to call: *

      matrix = new BlockRealMatrix(rawData.length, rawData[0].length,
            *                                   toBlocksLayout(rawData), false);
      - *

      * * @param rawData data for new matrix, in raw layout * @throws DimensionMismatchException if the shape of {@code blockData} is diff --git a/src/main/java/org/apache/commons/math4/linear/ConjugateGradient.java b/src/main/java/org/apache/commons/math4/linear/ConjugateGradient.java index de831ff13..3681a7d62 100644 --- a/src/main/java/org/apache/commons/math4/linear/ConjugateGradient.java +++ b/src/main/java/org/apache/commons/math4/linear/ConjugateGradient.java @@ -53,9 +53,9 @@ import org.apache.commons.math4.util.IterationManager; *
        *
      • key {@code "operator"} points to the offending linear operator, say L,
      • *
      • key {@code "vector"} points to the offending vector, say x, such that - * xT · L · x < 0.
      • + * xT · L · x < 0. *
      - *

      + * *

      References

      *
      *
      Barret et al. (1994)
      @@ -64,8 +64,7 @@ import org.apache.commons.math4.util.IterationManager; * * Templates for the Solution of Linear Systems: Building Blocks for Iterative * Methods, SIAM - *
      Strakos and Tichy (2002) - *
      + *
      Strakos and Tichy (2002)
      *
      Z. Strakos and P. Tichy, * On error estimation in the conjugate gradient method and why it works diff --git a/src/main/java/org/apache/commons/math4/linear/DiagonalMatrix.java b/src/main/java/org/apache/commons/math4/linear/DiagonalMatrix.java index 1b3520412..d85052947 100644 --- a/src/main/java/org/apache/commons/math4/linear/DiagonalMatrix.java +++ b/src/main/java/org/apache/commons/math4/linear/DiagonalMatrix.java @@ -54,7 +54,7 @@ public class DiagonalMatrix extends AbstractRealMatrix /** * Creates a matrix using the input array as the underlying data. - *
      + *
      * The input array is copied, not referenced. * * @param d Data for the new matrix. @@ -65,7 +65,7 @@ public class DiagonalMatrix extends AbstractRealMatrix /** * Creates a matrix using the input array as the underlying data. - *
      + *
      * If an array is created specially in order to be embedded in a * this instance and not used directly, the {@code copyArray} may be * set to {@code false}. diff --git a/src/main/java/org/apache/commons/math4/linear/FieldMatrix.java b/src/main/java/org/apache/commons/math4/linear/FieldMatrix.java index 7cab1d2a6..16f529a03 100644 --- a/src/main/java/org/apache/commons/math4/linear/FieldMatrix.java +++ b/src/main/java/org/apache/commons/math4/linear/FieldMatrix.java @@ -45,7 +45,7 @@ public interface FieldMatrix> extends AnyMatrix { Field getField(); /** - * Create a new FieldMatrix of the same type as the instance with + * Create a new {@code FieldMatrix} of the same type as the instance with * the supplied row and column dimensions. * * @param rowDimension the number of rows in the new matrix @@ -238,7 +238,6 @@ public interface FieldMatrix> extends AnyMatrix { * 9 5 6 2 * * - *

      * * @param subMatrix Array containing the submatrix replacement data. * @param row Row coordinate of the top-left element to be replaced. diff --git a/src/main/java/org/apache/commons/math4/linear/MatrixUtils.java b/src/main/java/org/apache/commons/math4/linear/MatrixUtils.java index cb71b375b..1f97a5e0d 100644 --- a/src/main/java/org/apache/commons/math4/linear/MatrixUtils.java +++ b/src/main/java/org/apache/commons/math4/linear/MatrixUtils.java @@ -746,7 +746,6 @@ public class MatrixUtils { * * } * - *

      * * @param vector real vector to serialize * @param oos stream where the real vector should be written @@ -847,7 +846,6 @@ public class MatrixUtils { * * } * - *

      * * @param matrix real matrix to serialize * @param oos stream where the real matrix should be written diff --git a/src/main/java/org/apache/commons/math4/linear/PreconditionedIterativeLinearSolver.java b/src/main/java/org/apache/commons/math4/linear/PreconditionedIterativeLinearSolver.java index 4110a0c49..a02c8916f 100644 --- a/src/main/java/org/apache/commons/math4/linear/PreconditionedIterativeLinearSolver.java +++ b/src/main/java/org/apache/commons/math4/linear/PreconditionedIterativeLinearSolver.java @@ -39,7 +39,7 @@ import org.apache.commons.math4.util.MathUtils; * while matrix-vector products of the type M · y remain comparatively * easy to compute. In this library, M (not M-1!) is called the * preconditionner. - *

      + * *

      * Concrete implementations of this abstract class must be provided with the * preconditioner M, as a {@link RealLinearOperator}. diff --git a/src/main/java/org/apache/commons/math4/linear/RRQRDecomposition.java b/src/main/java/org/apache/commons/math4/linear/RRQRDecomposition.java index f85b22e8a..9f41ea62d 100644 --- a/src/main/java/org/apache/commons/math4/linear/RRQRDecomposition.java +++ b/src/main/java/org/apache/commons/math4/linear/RRQRDecomposition.java @@ -152,7 +152,7 @@ public class RRQRDecomposition extends QRDecomposition { * bottom right submatrices. When a large fall in norm is seen, * the rank is returned. The drop is computed as:

      *
      -     *   (thisNorm/lastNorm) * rNorm < dropThreshold
      +     *   (thisNorm/lastNorm) * rNorm < dropThreshold
            * 
      *

      * where thisNorm is the Frobenius norm of the current submatrix, diff --git a/src/main/java/org/apache/commons/math4/linear/RealLinearOperator.java b/src/main/java/org/apache/commons/math4/linear/RealLinearOperator.java index 06ff43c88..5ad4421a4 100644 --- a/src/main/java/org/apache/commons/math4/linear/RealLinearOperator.java +++ b/src/main/java/org/apache/commons/math4/linear/RealLinearOperator.java @@ -35,7 +35,7 @@ import org.apache.commons.math4.exception.DimensionMismatchException; * supply a subroutine for computing y (and perhaps z) given x, which permits * full exploitation of the sparsity or other special structure of A. * - *
      + *
      * *

      *
      Barret et al. (1994)
      diff --git a/src/main/java/org/apache/commons/math4/linear/RealMatrix.java b/src/main/java/org/apache/commons/math4/linear/RealMatrix.java index 1cafe3e31..c41d83942 100644 --- a/src/main/java/org/apache/commons/math4/linear/RealMatrix.java +++ b/src/main/java/org/apache/commons/math4/linear/RealMatrix.java @@ -244,7 +244,7 @@ public interface RealMatrix extends AnyMatrix { * 1 2 3 4 * 5 3 4 8 * 9 5 6 2 - *

      + * * * @param subMatrix array containing the submatrix replacement data * @param row row coordinate of the top, left element to be replaced diff --git a/src/main/java/org/apache/commons/math4/linear/RealVector.java b/src/main/java/org/apache/commons/math4/linear/RealVector.java index 545a521ce..f4fa84396 100644 --- a/src/main/java/org/apache/commons/math4/linear/RealVector.java +++ b/src/main/java/org/apache/commons/math4/linear/RealVector.java @@ -803,12 +803,12 @@ public abstract class RealVector { /** * Acts as if it is implemented as: - *
      +     * {@code
            *  Entry e = null;
            *  for(Iterator it = iterator(); it.hasNext(); e = it.next()) {
            *      e.setValue(function.value(e.getValue()));
            *  }
      -     * 
      + * } * Entries of this vector are modified in-place by this method. * * @param function Function to apply to each entry. diff --git a/src/main/java/org/apache/commons/math4/linear/RectangularCholeskyDecomposition.java b/src/main/java/org/apache/commons/math4/linear/RectangularCholeskyDecomposition.java index b32a5da90..16e446f87 100644 --- a/src/main/java/org/apache/commons/math4/linear/RectangularCholeskyDecomposition.java +++ b/src/main/java/org/apache/commons/math4/linear/RectangularCholeskyDecomposition.java @@ -30,7 +30,7 @@ import org.apache.commons.math4.util.FastMath; * of the traditional triangular shape) and there is a threshold to ignore * small diagonal elements. This is used for example to generate {@link * org.apache.commons.math4.random.CorrelatedRandomVectorGenerator correlated - * random n-dimensions vectors} in a p-dimension subspace (p < n). + * random n-dimensions vectors} in a p-dimension subspace (p < n). * In other words, it allows generating random vectors from a covariance * matrix that is only positive semidefinite, and not positive definite.

      *

      Rectangular Cholesky decomposition is not suited for solving diff --git a/src/main/java/org/apache/commons/math4/linear/SparseFieldMatrix.java b/src/main/java/org/apache/commons/math4/linear/SparseFieldMatrix.java index 70d599908..a3ae81d5c 100644 --- a/src/main/java/org/apache/commons/math4/linear/SparseFieldMatrix.java +++ b/src/main/java/org/apache/commons/math4/linear/SparseFieldMatrix.java @@ -55,7 +55,7 @@ public class SparseFieldMatrix> extends AbstractFieldM } /** - * Create a new SparseFieldMatrix with the supplied row and column + * Create a new {@code SparseFieldMatrix} with the supplied row and column * dimensions. * * @param field Field to which the elements belong. diff --git a/src/main/java/org/apache/commons/math4/linear/SymmLQ.java b/src/main/java/org/apache/commons/math4/linear/SymmLQ.java index ef5290417..0e92aa71e 100644 --- a/src/main/java/org/apache/commons/math4/linear/SymmLQ.java +++ b/src/main/java/org/apache/commons/math4/linear/SymmLQ.java @@ -113,7 +113,7 @@ import org.apache.commons.math4.util.MathUtils; * initial phase. If x0 is known to be a good approximation to x, one * should compute r0 = b - A · x, solve A · dx = r0, * and set x = x0 + dx. - *

      + * *

      Exception context

      *

      * Besides standard {@link DimensionMismatchException}, this class might throw @@ -127,7 +127,7 @@ import org.apache.commons.math4.util.MathUtils; * that xT · L · y ≠ yT · L * · x (within a certain accuracy). * - *

      + * *

      * {@link NonPositiveDefiniteOperatorException} might also be thrown in case the * preconditioner is not positive definite. The relevant keys to the @@ -136,9 +136,9 @@ import org.apache.commons.math4.util.MathUtils; *

    3. key {@code "operator"}, which points to the offending linear operator, * say L,
    4. *
    5. key {@code "vector"}, which points to the offending vector, say x, such - * that xT · L · x < 0.
    6. + * that xT · L · x < 0. * - *

      + * *

      References

      *
      *
      Paige and Saunders (1975)
      diff --git a/src/main/java/org/apache/commons/math4/ml/clustering/FuzzyKMeansClusterer.java b/src/main/java/org/apache/commons/math4/ml/clustering/FuzzyKMeansClusterer.java index ee3d5908f..a21410710 100644 --- a/src/main/java/org/apache/commons/math4/ml/clustering/FuzzyKMeansClusterer.java +++ b/src/main/java/org/apache/commons/math4/ml/clustering/FuzzyKMeansClusterer.java @@ -43,9 +43,9 @@ import org.apache.commons.math4.util.MathUtils; * to the cluster j. *

      * The algorithm then tries to minimize the objective function: - *

      + * 
      * J = ∑i=1..Ck=1..N uikmdik2 - *
      + * * with dik being the distance between data point i and the cluster center k. *

      * The algorithm requires two parameters: diff --git a/src/main/java/org/apache/commons/math4/ml/neuralnet/Neuron.java b/src/main/java/org/apache/commons/math4/ml/neuralnet/Neuron.java index 409e55335..6e58760fc 100644 --- a/src/main/java/org/apache/commons/math4/ml/neuralnet/Neuron.java +++ b/src/main/java/org/apache/commons/math4/ml/neuralnet/Neuron.java @@ -51,7 +51,7 @@ public class Neuron implements Serializable { * Creates a neuron. * The size of the feature set is fixed to the length of the given * argument. - *
      + *
      * Constructor is package-private: Neurons must be * {@link Network#createNeuron(double[]) created} by the network * instance to which they will belong. @@ -113,7 +113,7 @@ public class Neuron implements Serializable { /** * Tries to atomically update the neuron's features. * Update will be performed only if the expected values match the - * current values.
      + * current values.
      * In effect, when concurrent threads call this method, the state * could be modified by one, so that it does not correspond to the * the state assumed by another. diff --git a/src/main/java/org/apache/commons/math4/ml/neuralnet/SquareNeighbourhood.java b/src/main/java/org/apache/commons/math4/ml/neuralnet/SquareNeighbourhood.java index 4f2c17512..3600ee5cb 100644 --- a/src/main/java/org/apache/commons/math4/ml/neuralnet/SquareNeighbourhood.java +++ b/src/main/java/org/apache/commons/math4/ml/neuralnet/SquareNeighbourhood.java @@ -24,13 +24,13 @@ package org.apache.commons.math4.ml.neuralnet; */ public enum SquareNeighbourhood { /** - * * Von Neumann neighbourhood: in two dimensions, each (internal) * neuron has four neighbours. */ VON_NEUMANN, /** - * * Moore neighbourhood: in two dimensions, each (internal) * neuron has eight neighbours. */ diff --git a/src/main/java/org/apache/commons/math4/ml/neuralnet/oned/NeuronString.java b/src/main/java/org/apache/commons/math4/ml/neuralnet/oned/NeuronString.java index ba454caa1..864b62a46 100644 --- a/src/main/java/org/apache/commons/math4/ml/neuralnet/oned/NeuronString.java +++ b/src/main/java/org/apache/commons/math4/ml/neuralnet/oned/NeuronString.java @@ -83,11 +83,11 @@ public class NeuronString implements Serializable { * Creates a one-dimensional network: * Each neuron not located on the border of the mesh has two * neurons linked to it. - *
      + *
      * The links are bi-directional. * Neurons created successively are neighbours (i.e. there are * links between them). - *
      + *
      * The topology of the network can also be a circle (if the * dimension is wrapped). * diff --git a/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenUpdateAction.java b/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenUpdateAction.java index 1c49d0638..691fd9045 100644 --- a/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenUpdateAction.java +++ b/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenUpdateAction.java @@ -32,7 +32,7 @@ import org.apache.commons.math4.ml.neuralnet.UpdateAction; /** * Update formula for * Kohonen's Self-Organizing Map. - *
      + *
      * The {@link #update(Network,double[]) update} method modifies the * features {@code w} of the "winning" neuron and its neighbours * according to the following rule: @@ -46,12 +46,12 @@ import org.apache.commons.math4.ml.neuralnet.UpdateAction; *

    7. {@code d} is the number of links to traverse in order to reach * the neuron from the winning neuron.
    8. * - *
      + *
      * This class is thread-safe as long as the arguments passed to the * {@link #KohonenUpdateAction(DistanceMeasure,LearningFactorFunction, * NeighbourhoodSizeFunction) constructor} are instances of thread-safe * classes. - *
      + *
      * Each call to the {@link #update(Network,double[]) update} method * will increment the internal counter used to compute the current * values for diff --git a/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/util/ExponentialDecayFunction.java b/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/util/ExponentialDecayFunction.java index d914bf17e..c1321ea99 100644 --- a/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/util/ExponentialDecayFunction.java +++ b/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/util/ExponentialDecayFunction.java @@ -24,7 +24,7 @@ import org.apache.commons.math4.util.FastMath; /** * Exponential decay function: a e-x / b, * where {@code x} is the (integer) independent variable. - *
      + *
      * Class is immutable. * * @since 3.3 diff --git a/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/util/QuasiSigmoidDecayFunction.java b/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/util/QuasiSigmoidDecayFunction.java index 4abef6f8d..e71a9bf89 100644 --- a/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/util/QuasiSigmoidDecayFunction.java +++ b/src/main/java/org/apache/commons/math4/ml/neuralnet/sofm/util/QuasiSigmoidDecayFunction.java @@ -23,7 +23,7 @@ import org.apache.commons.math4.exception.NumberIsTooLargeException; /** * Decay function whose shape is similar to a sigmoid. - *
      + *
      * Class is immutable. * * @since 3.3 diff --git a/src/main/java/org/apache/commons/math4/ml/neuralnet/twod/NeuronSquareMesh2D.java b/src/main/java/org/apache/commons/math4/ml/neuralnet/twod/NeuronSquareMesh2D.java index e42491d63..3a5a126a2 100644 --- a/src/main/java/org/apache/commons/math4/ml/neuralnet/twod/NeuronSquareMesh2D.java +++ b/src/main/java/org/apache/commons/math4/ml/neuralnet/twod/NeuronSquareMesh2D.java @@ -34,7 +34,7 @@ import org.apache.commons.math4.ml.neuralnet.SquareNeighbourhood; /** * Neural network with the topology of a two-dimensional surface. * Each neuron defines one surface element. - *
      + *
      * This network is primarily intended to represent a * * Self Organizing Feature Map. @@ -141,9 +141,9 @@ public class NeuronSquareMesh2D * Creates a two-dimensional network composed of square cells: * Each neuron not located on the border of the mesh has four * neurons linked to it. - *
      + *
      * The links are bi-directional. - *
      + *
      * The topology of the network can also be a cylinder (if one * of the dimensions is wrapped) or a torus (if both dimensions * are wrapped). diff --git a/src/main/java/org/apache/commons/math4/ml/neuralnet/twod/util/SmoothedDataHistogram.java b/src/main/java/org/apache/commons/math4/ml/neuralnet/twod/util/SmoothedDataHistogram.java index 6db74d901..13270552d 100644 --- a/src/main/java/org/apache/commons/math4/ml/neuralnet/twod/util/SmoothedDataHistogram.java +++ b/src/main/java/org/apache/commons/math4/ml/neuralnet/twod/util/SmoothedDataHistogram.java @@ -26,11 +26,11 @@ import org.apache.commons.math4.exception.NumberIsTooSmallException; /** * Visualization of high-dimensional data projection on a 2D-map. * The method is described in - * + *
      * Using Smoothed Data Histograms for Cluster Visualization in Self-Organizing Maps *
      * by Elias Pampalk, Andreas Rauber and Dieter Merkl. - * + *
      * @since 3.6 */ public class SmoothedDataHistogram implements MapDataVisualization { diff --git a/src/main/java/org/apache/commons/math4/ode/JacobianMatrices.java b/src/main/java/org/apache/commons/math4/ode/JacobianMatrices.java index 2efed92c6..175d060b2 100644 --- a/src/main/java/org/apache/commons/math4/ode/JacobianMatrices.java +++ b/src/main/java/org/apache/commons/math4/ode/JacobianMatrices.java @@ -43,7 +43,6 @@ import org.apache.commons.math4.exception.util.LocalizedFormats; *
    9. a {@link ParameterJacobianProvider}
    10. *
    11. a {@link ParameterizedODE}
    12. * - *

      * * @see ExpandableStatefulODE * @see FirstOrderDifferentialEquations diff --git a/src/main/java/org/apache/commons/math4/ode/MultistepFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/MultistepFieldIntegrator.java index edd65e261..a5e21b639 100644 --- a/src/main/java/org/apache/commons/math4/ode/MultistepFieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/MultistepFieldIntegrator.java @@ -38,20 +38,20 @@ import org.apache.commons.math4.util.MathUtils; * This class is the base class for multistep integrators for Ordinary * Differential Equations. *

      We define scaled derivatives si(n) at step n as: - *

      + * 
      * s1(n) = h y'n for first derivative * s2(n) = h2/2 y''n for second derivative * s3(n) = h3/6 y'''n for third derivative * ... * sk(n) = hk/k! y(k)n for kth derivative - *

      + * *

      Rather than storing several previous steps separately, this implementation uses * the Nordsieck vector with higher degrees scaled derivatives all taken at the same * step (yn, s1(n) and rn) where rn is defined as: - *

      + * 
      * rn = [ s2(n), s3(n) ... sk(n) ]T - *
      - * (we omit the k index in the notation for clarity)

      + *
      + * (we omit the k index in the notation for clarity) *

      * Multistep integrators with Nordsieck representation are highly sensitive to * large step changes because when the step is multiplied by factor a, the diff --git a/src/main/java/org/apache/commons/math4/ode/MultistepIntegrator.java b/src/main/java/org/apache/commons/math4/ode/MultistepIntegrator.java index 354db491e..14736efcf 100644 --- a/src/main/java/org/apache/commons/math4/ode/MultistepIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/MultistepIntegrator.java @@ -34,20 +34,20 @@ import org.apache.commons.math4.util.FastMath; * This class is the base class for multistep integrators for Ordinary * Differential Equations. *

      We define scaled derivatives si(n) at step n as: - *

      + * 
      * s1(n) = h y'n for first derivative * s2(n) = h2/2 y''n for second derivative * s3(n) = h3/6 y'''n for third derivative * ... * sk(n) = hk/k! y(k)n for kth derivative - *

      + * *

      Rather than storing several previous steps separately, this implementation uses * the Nordsieck vector with higher degrees scaled derivatives all taken at the same * step (yn, s1(n) and rn) where rn is defined as: - *

      + * 
      * rn = [ s2(n), s3(n) ... sk(n) ]T - *
      - * (we omit the k index in the notation for clarity)

      + *
      + * (we omit the k index in the notation for clarity) *

      * Multistep integrators with Nordsieck representation are highly sensitive to * large step changes because when the step is multiplied by factor a, the diff --git a/src/main/java/org/apache/commons/math4/ode/events/EventHandler.java b/src/main/java/org/apache/commons/math4/ode/events/EventHandler.java index f1900f7e2..1012b5312 100644 --- a/src/main/java/org/apache/commons/math4/ode/events/EventHandler.java +++ b/src/main/java/org/apache/commons/math4/ode/events/EventHandler.java @@ -110,7 +110,7 @@ public interface EventHandler { *

      Also note that the integrator expect that once an event has occurred, * the sign of the switching function at the start of the next step (i.e. * just after the event) is the opposite of the sign just before the event. - * This consistency between the steps must be preserved, + * This consistency between the steps must be preserved, * otherwise {@link org.apache.commons.math4.exception.NoBracketingException * exceptions} related to root not being bracketed will occur.

      *

      This need for consistency is sometimes tricky to achieve. A typical diff --git a/src/main/java/org/apache/commons/math4/ode/events/FieldEventHandler.java b/src/main/java/org/apache/commons/math4/ode/events/FieldEventHandler.java index 07bae2382..f22c3bd3a 100644 --- a/src/main/java/org/apache/commons/math4/ode/events/FieldEventHandler.java +++ b/src/main/java/org/apache/commons/math4/ode/events/FieldEventHandler.java @@ -74,7 +74,7 @@ public interface FieldEventHandler> { *

      Also note that the integrator expect that once an event has occurred, * the sign of the switching function at the start of the next step (i.e. * just after the event) is the opposite of the sign just before the event. - * This consistency between the steps must be preserved, + * This consistency between the steps must be preserved, * otherwise {@link org.apache.commons.math4.exception.NoBracketingException * exceptions} related to root not being bracketed will occur.

      *

      This need for consistency is sometimes tricky to achieve. A typical diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsBashforthFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsBashforthFieldIntegrator.java index ebb31f0aa..64c2a1f67 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsBashforthFieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsBashforthFieldIntegrator.java @@ -56,19 +56,19 @@ import org.apache.commons.math4.util.MathArrays; *

      Implementation details

      * *

      We define scaled derivatives si(n) at step n as: - *

      + * 
      * s1(n) = h y'n for first derivative * s2(n) = h2/2 y''n for second derivative * s3(n) = h3/6 y'''n for third derivative * ... * sk(n) = hk/k! y(k)n for kth derivative - *

      + * * *

      The definitions above use the classical representation with several previous first * derivatives. Lets define - *

      + * 
      * qn = [ s1(n-1) s1(n-2) ... s1(n-(k-1)) ]T - *
      + * * (we omit the k index in the notation for clarity). With these definitions, * Adams-Bashforth methods can be written: *
        @@ -77,30 +77,29 @@ import org.apache.commons.math4.util.MathArrays; *
      • k = 3: yn+1 = yn + 23/12 s1(n) + [ -16/12 5/12 ] qn
      • *
      • k = 4: yn+1 = yn + 55/24 s1(n) + [ -59/24 37/24 -9/24 ] qn
      • *
      • ...
      • - *

      + * * *

      Instead of using the classical representation with first derivatives only (yn, * s1(n) and qn), our implementation uses the Nordsieck vector with * higher degrees scaled derivatives all taken at the same step (yn, s1(n) * and rn) where rn is defined as: - *

      + * 
      * rn = [ s2(n), s3(n) ... sk(n) ]T - *
      + * * (here again we omit the k index in the notation for clarity) - *

      * *

      Taylor series formulas show that for any index offset i, s1(n-i) can be * computed from s1(n), s2(n) ... sk(n), the formula being exact * for degree k polynomials. - *

      + * 
      * s1(n-i) = s1(n) + ∑j>0 (j+1) (-i)j sj+1(n) - *
      + * * The previous formula can be used with several values for i to compute the transform between * classical representation and Nordsieck vector. The transform between rn * and qn resulting from the Taylor series formulas above is: - *
      + * 
      * qn = s1(n) u + P rn - *
      + * * where u is the [ 1 1 ... 1 ]T vector and P is the (k-1)×(k-1) matrix built * with the (j+1) (-i)j terms with i being the row number starting from 1 and j being * the column number starting from 1: @@ -110,7 +109,7 @@ import org.apache.commons.math4.util.MathArrays; * P = [ -6 27 -108 405 ... ] * [ -8 48 -256 1280 ... ] * [ ... ] - *

      + * * *

      Using the Nordsieck vector has several advantages: *

        @@ -119,7 +118,7 @@ import org.apache.commons.math4.util.MathArrays; *
      • it simplifies step changes that occur when discrete events that truncate * the step are triggered,
      • *
      • it allows to extend the methods in order to support adaptive stepsize.
      • - *

      + * * *

      The Nordsieck vector at step n+1 is computed from the Nordsieck vector at step n as follows: *

        @@ -136,7 +135,7 @@ import org.apache.commons.math4.util.MathArrays; * [ ... | 0 ] * [ 0 0 ... 1 0 | 0 ] * [ 0 0 ... 0 1 | 0 ] - *

        + * * *

        The P-1u vector and the P-1 A P matrix do not depend on the state, * they only depend on k and therefore are precomputed once for all.

        diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsBashforthIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsBashforthIntegrator.java index cd84f1878..532175096 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsBashforthIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsBashforthIntegrator.java @@ -54,19 +54,19 @@ import org.apache.commons.math4.util.FastMath; *

        Implementation details

        * *

        We define scaled derivatives si(n) at step n as: - *

        + * 
        * s1(n) = h y'n for first derivative * s2(n) = h2/2 y''n for second derivative * s3(n) = h3/6 y'''n for third derivative * ... * sk(n) = hk/k! y(k)n for kth derivative - *

        + * * *

        The definitions above use the classical representation with several previous first * derivatives. Lets define - *

        + * 
        * qn = [ s1(n-1) s1(n-2) ... s1(n-(k-1)) ]T - *
        + * * (we omit the k index in the notation for clarity). With these definitions, * Adams-Bashforth methods can be written: *
          @@ -75,30 +75,29 @@ import org.apache.commons.math4.util.FastMath; *
        • k = 3: yn+1 = yn + 23/12 s1(n) + [ -16/12 5/12 ] qn
        • *
        • k = 4: yn+1 = yn + 55/24 s1(n) + [ -59/24 37/24 -9/24 ] qn
        • *
        • ...
        • - *

        + *
      * *

      Instead of using the classical representation with first derivatives only (yn, * s1(n) and qn), our implementation uses the Nordsieck vector with * higher degrees scaled derivatives all taken at the same step (yn, s1(n) * and rn) where rn is defined as: - *

      + * 
      * rn = [ s2(n), s3(n) ... sk(n) ]T - *
      + * * (here again we omit the k index in the notation for clarity) - *

      * *

      Taylor series formulas show that for any index offset i, s1(n-i) can be * computed from s1(n), s2(n) ... sk(n), the formula being exact * for degree k polynomials. - *

      + * 
      * s1(n-i) = s1(n) + ∑j>0 (j+1) (-i)j sj+1(n) - *
      + * * The previous formula can be used with several values for i to compute the transform between * classical representation and Nordsieck vector. The transform between rn * and qn resulting from the Taylor series formulas above is: - *
      + * 
      * qn = s1(n) u + P rn - *
      + * * where u is the [ 1 1 ... 1 ]T vector and P is the (k-1)×(k-1) matrix built * with the (j+1) (-i)j terms with i being the row number starting from 1 and j being * the column number starting from 1: @@ -108,7 +107,7 @@ import org.apache.commons.math4.util.FastMath; * P = [ -6 27 -108 405 ... ] * [ -8 48 -256 1280 ... ] * [ ... ] - *

      + * * *

      Using the Nordsieck vector has several advantages: *

        @@ -117,7 +116,7 @@ import org.apache.commons.math4.util.FastMath; *
      • it simplifies step changes that occur when discrete events that truncate * the step are triggered,
      • *
      • it allows to extend the methods in order to support adaptive stepsize.
      • - *

      + * * *

      The Nordsieck vector at step n+1 is computed from the Nordsieck vector at step n as follows: *

        @@ -134,7 +133,7 @@ import org.apache.commons.math4.util.FastMath; * [ ... | 0 ] * [ 0 0 ... 1 0 | 0 ] * [ 0 0 ... 0 1 | 0 ] - *

        + * * *

        The P-1u vector and the P-1 A P matrix do not depend on the state, * they only depend on k and therefore are precomputed once for all.

        diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsFieldIntegrator.java index cb2061baa..700739de6 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsFieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsFieldIntegrator.java @@ -112,10 +112,10 @@ public abstract class AdamsFieldIntegrator> extend /** Update the high order scaled derivatives for Adams integrators (phase 1). *

        The complete update of high order derivatives has a form similar to: - *

        +     * 
        * rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rn - *
        - * this method computes the P-1 A P rn part.

        + *
        + * this method computes the P-1 A P rn part. * @param highOrder high order scaled derivatives * (h2/2 y'', ... hk/k! y(k)) * @return updated high order derivatives @@ -127,10 +127,10 @@ public abstract class AdamsFieldIntegrator> extend /** Update the high order scaled derivatives Adams integrators (phase 2). *

        The complete update of high order derivatives has a form similar to: - *

        +     * 
        * rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rn - *
        - * this method computes the (s1(n) - s1(n+1)) P-1 u part.

        + *
        + * this method computes the (s1(n) - s1(n+1)) P-1 u part. *

        Phase 1 of the update must already have been performed.

        * @param start first order scaled derivatives at step start * @param end first order scaled derivatives at step end diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsIntegrator.java index 9563d31b3..01a41b73c 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsIntegrator.java @@ -101,10 +101,10 @@ public abstract class AdamsIntegrator extends MultistepIntegrator { /** Update the high order scaled derivatives for Adams integrators (phase 1). *

        The complete update of high order derivatives has a form similar to: - *

        +     * 
        * rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rn - *
        - * this method computes the P-1 A P rn part.

        + *
        + * this method computes the P-1 A P rn part. * @param highOrder high order scaled derivatives * (h2/2 y'', ... hk/k! y(k)) * @return updated high order derivatives @@ -116,10 +116,10 @@ public abstract class AdamsIntegrator extends MultistepIntegrator { /** Update the high order scaled derivatives Adams integrators (phase 2). *

        The complete update of high order derivatives has a form similar to: - *

        +     * 
        * rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rn - *
        - * this method computes the (s1(n) - s1(n+1)) P-1 u part.

        + *
        + * this method computes the (s1(n) - s1(n+1)) P-1 u part. *

        Phase 1 of the update must already have been performed.

        * @param start first order scaled derivatives at step start * @param end first order scaled derivatives at step end diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonFieldIntegrator.java index 658cd6d2b..bc07d0374 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonFieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonFieldIntegrator.java @@ -62,19 +62,19 @@ import org.apache.commons.math4.util.MathUtils; *

        Implementation details

        * *

        We define scaled derivatives si(n) at step n as: - *

        + * 
        * s1(n) = h y'n for first derivative * s2(n) = h2/2 y''n for second derivative * s3(n) = h3/6 y'''n for third derivative * ... * sk(n) = hk/k! y(k)n for kth derivative - *

        + * * *

        The definitions above use the classical representation with several previous first * derivatives. Lets define - *

        + * 
        * qn = [ s1(n-1) s1(n-2) ... s1(n-(k-1)) ]T - *
        + * * (we omit the k index in the notation for clarity). With these definitions, * Adams-Moulton methods can be written: *
          @@ -83,30 +83,29 @@ import org.apache.commons.math4.util.MathUtils; *
        • k = 3: yn+1 = yn + 5/12 s1(n+1) + [ 8/12 -1/12 ] qn+1
        • *
        • k = 4: yn+1 = yn + 9/24 s1(n+1) + [ 19/24 -5/24 1/24 ] qn+1
        • *
        • ...
        • - *

        + *
      * *

      Instead of using the classical representation with first derivatives only (yn, * s1(n+1) and qn+1), our implementation uses the Nordsieck vector with * higher degrees scaled derivatives all taken at the same step (yn, s1(n) * and rn) where rn is defined as: - *

      + * 
      * rn = [ s2(n), s3(n) ... sk(n) ]T - *
      + * * (here again we omit the k index in the notation for clarity) - *

      * *

      Taylor series formulas show that for any index offset i, s1(n-i) can be * computed from s1(n), s2(n) ... sk(n), the formula being exact * for degree k polynomials. - *

      + * 
      * s1(n-i) = s1(n) + ∑j>0 (j+1) (-i)j sj+1(n) - *
      + * * The previous formula can be used with several values for i to compute the transform between * classical representation and Nordsieck vector. The transform between rn * and qn resulting from the Taylor series formulas above is: - *
      + * 
      * qn = s1(n) u + P rn - *
      + * * where u is the [ 1 1 ... 1 ]T vector and P is the (k-1)×(k-1) matrix built * with the (j+1) (-i)j terms with i being the row number starting from 1 and j being * the column number starting from 1: @@ -116,7 +115,7 @@ import org.apache.commons.math4.util.MathUtils; * P = [ -6 27 -108 405 ... ] * [ -8 48 -256 1280 ... ] * [ ... ] - *

      + * * *

      Using the Nordsieck vector has several advantages: *

        @@ -125,7 +124,7 @@ import org.apache.commons.math4.util.MathUtils; *
      • it simplifies step changes that occur when discrete events that truncate * the step are triggered,
      • *
      • it allows to extend the methods in order to support adaptive stepsize.
      • - *

      + * * *

      The predicted Nordsieck vector at step n+1 is computed from the Nordsieck vector at step * n as follows: @@ -152,7 +151,7 @@ import org.apache.commons.math4.util.MathUtils; * * where the upper case Yn+1, S1(n+1) and Rn+1 represent the * predicted states whereas the lower case yn+1, sn+1 and rn+1 - * represent the corrected states.

      + * represent the corrected states. * *

      The P-1u vector and the P-1 A P matrix do not depend on the state, * they only depend on k and therefore are precomputed once for all.

      diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonIntegrator.java index 2e5c54470..634fcac00 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsMoultonIntegrator.java @@ -59,19 +59,19 @@ import org.apache.commons.math4.util.FastMath; *

      Implementation details

      * *

      We define scaled derivatives si(n) at step n as: - *

      + * 
      * s1(n) = h y'n for first derivative * s2(n) = h2/2 y''n for second derivative * s3(n) = h3/6 y'''n for third derivative * ... * sk(n) = hk/k! y(k)n for kth derivative - *

      + * * *

      The definitions above use the classical representation with several previous first * derivatives. Lets define - *

      + * 
      * qn = [ s1(n-1) s1(n-2) ... s1(n-(k-1)) ]T - *
      + * * (we omit the k index in the notation for clarity). With these definitions, * Adams-Moulton methods can be written: *
        @@ -80,30 +80,29 @@ import org.apache.commons.math4.util.FastMath; *
      • k = 3: yn+1 = yn + 5/12 s1(n+1) + [ 8/12 -1/12 ] qn+1
      • *
      • k = 4: yn+1 = yn + 9/24 s1(n+1) + [ 19/24 -5/24 1/24 ] qn+1
      • *
      • ...
      • - *

      + * * *

      Instead of using the classical representation with first derivatives only (yn, * s1(n+1) and qn+1), our implementation uses the Nordsieck vector with * higher degrees scaled derivatives all taken at the same step (yn, s1(n) * and rn) where rn is defined as: - *

      + * 
      * rn = [ s2(n), s3(n) ... sk(n) ]T - *
      + * * (here again we omit the k index in the notation for clarity) - *

      * *

      Taylor series formulas show that for any index offset i, s1(n-i) can be * computed from s1(n), s2(n) ... sk(n), the formula being exact * for degree k polynomials. - *

      + * 
      * s1(n-i) = s1(n) + ∑j>0 (j+1) (-i)j sj+1(n) - *
      + * * The previous formula can be used with several values for i to compute the transform between * classical representation and Nordsieck vector. The transform between rn * and qn resulting from the Taylor series formulas above is: - *
      + * 
      * qn = s1(n) u + P rn - *
      + * * where u is the [ 1 1 ... 1 ]T vector and P is the (k-1)×(k-1) matrix built * with the (j+1) (-i)j terms with i being the row number starting from 1 and j being * the column number starting from 1: @@ -113,7 +112,7 @@ import org.apache.commons.math4.util.FastMath; * P = [ -6 27 -108 405 ... ] * [ -8 48 -256 1280 ... ] * [ ... ] - *

      + * * *

      Using the Nordsieck vector has several advantages: *

        @@ -122,7 +121,7 @@ import org.apache.commons.math4.util.FastMath; *
      • it simplifies step changes that occur when discrete events that truncate * the step are triggered,
      • *
      • it allows to extend the methods in order to support adaptive stepsize.
      • - *

      + * * *

      The predicted Nordsieck vector at step n+1 is computed from the Nordsieck vector at step * n as follows: @@ -149,7 +148,7 @@ import org.apache.commons.math4.util.FastMath; * * where the upper case Yn+1, S1(n+1) and Rn+1 represent the * predicted states whereas the lower case yn+1, sn+1 and rn+1 - * represent the corrected states.

      + * represent the corrected states. * *

      The P-1u vector and the P-1 A P matrix do not depend on the state, * they only depend on k and therefore are precomputed once for all.

      diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckFieldTransformer.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckFieldTransformer.java index 7c2b872f7..c65a9484e 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckFieldTransformer.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckFieldTransformer.java @@ -37,43 +37,42 @@ import org.apache.commons.math4.util.MathArrays; * representation with higher order scaled derivatives.

      * *

      We define scaled derivatives si(n) at step n as: - *

      + * 
      * s1(n) = h y'n for first derivative * s2(n) = h2/2 y''n for second derivative * s3(n) = h3/6 y'''n for third derivative * ... * sk(n) = hk/k! y(k)n for kth derivative - *

      + * * *

      With the previous definition, the classical representation of multistep methods * uses first derivatives only, i.e. it handles yn, s1(n) and * qn where qn is defined as: - *

      + * 
      * qn = [ s1(n-1) s1(n-2) ... s1(n-(k-1)) ]T - *
      - * (we omit the k index in the notation for clarity).

      + *
      + * (we omit the k index in the notation for clarity). * *

      Another possible representation uses the Nordsieck vector with * higher degrees scaled derivatives all taken at the same step, i.e it handles yn, * s1(n) and rn) where rn is defined as: - *

      + * 
      * rn = [ s2(n), s3(n) ... sk(n) ]T - *
      + * * (here again we omit the k index in the notation for clarity) - *

      * *

      Taylor series formulas show that for any index offset i, s1(n-i) can be * computed from s1(n), s2(n) ... sk(n), the formula being exact * for degree k polynomials. - *

      + * 
      * s1(n-i) = s1(n) + ∑j>0 (j+1) (-i)j sj+1(n) - *
      + * * The previous formula can be used with several values for i to compute the transform between * classical representation and Nordsieck vector at step end. The transform between rn * and qn resulting from the Taylor series formulas above is: - *
      + * 
      * qn = s1(n) u + P rn - *
      + * * where u is the [ 1 1 ... 1 ]T vector and P is the (k-1)×(k-1) matrix built * with the (j+1) (-i)j terms with i being the row number starting from 1 and j being * the column number starting from 1: @@ -83,7 +82,7 @@ import org.apache.commons.math4.util.MathArrays; * P = [ -6 27 -108 405 ... ] * [ -8 48 -256 1280 ... ] * [ ... ] - *

      + * * *

      Changing -i into +i in the formula above can be used to compute a similar transform between * classical representation and Nordsieck vector at step start. The resulting matrix is simply @@ -105,7 +104,7 @@ import org.apache.commons.math4.util.MathArrays; * [ ... | 0 ] * [ 0 0 ... 1 0 | 0 ] * [ 0 0 ... 0 1 | 0 ] - *

      + * * *

      For {@link AdamsMoultonIntegrator Adams-Moulton} method, the predicted Nordsieck vector * at step n+1 is computed from the Nordsieck vector at step n as follows: @@ -122,7 +121,7 @@ import org.apache.commons.math4.util.MathArrays; * * where the upper case Yn+1, S1(n+1) and Rn+1 represent the * predicted states whereas the lower case yn+1, sn+1 and rn+1 - * represent the corrected states.

      + * represent the corrected states. * *

      We observe that both methods use similar update formulas. In both cases a P-1u * vector and a P-1 A P matrix are used that do not depend on the state, @@ -218,7 +217,7 @@ public class AdamsNordsieckFieldTransformer> { * P = [ -6 27 -108 405 ... ] * [ -8 48 -256 1280 ... ] * [ ... ] - *

      + * * @param rows number of rows of the matrix * @return P matrix */ @@ -318,10 +317,10 @@ public class AdamsNordsieckFieldTransformer> { /** Update the high order scaled derivatives for Adams integrators (phase 1). *

      The complete update of high order derivatives has a form similar to: - *

      +     * 
      * rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rn - *
      - * this method computes the P-1 A P rn part.

      + *
      + * this method computes the P-1 A P rn part. * @param highOrder high order scaled derivatives * (h2/2 y'', ... hk/k! y(k)) * @return updated high order derivatives @@ -333,10 +332,10 @@ public class AdamsNordsieckFieldTransformer> { /** Update the high order scaled derivatives Adams integrators (phase 2). *

      The complete update of high order derivatives has a form similar to: - *

      +     * 
      * rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rn - *
      - * this method computes the (s1(n) - s1(n+1)) P-1 u part.

      + *
      + * this method computes the (s1(n) - s1(n+1)) P-1 u part. *

      Phase 1 of the update must already have been performed.

      * @param start first order scaled derivatives at step start * @param end first order scaled derivatives at step end diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckTransformer.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckTransformer.java index f38e61af8..7cf5a4eae 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckTransformer.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdamsNordsieckTransformer.java @@ -39,43 +39,42 @@ import org.apache.commons.math4.linear.RealMatrix; * representation with higher order scaled derivatives.

      * *

      We define scaled derivatives si(n) at step n as: - *

      + * 
      * s1(n) = h y'n for first derivative * s2(n) = h2/2 y''n for second derivative * s3(n) = h3/6 y'''n for third derivative * ... * sk(n) = hk/k! y(k)n for kth derivative - *

      + * * *

      With the previous definition, the classical representation of multistep methods * uses first derivatives only, i.e. it handles yn, s1(n) and * qn where qn is defined as: - *

      + * 
      * qn = [ s1(n-1) s1(n-2) ... s1(n-(k-1)) ]T - *
      - * (we omit the k index in the notation for clarity).

      + *
      + * (we omit the k index in the notation for clarity). * *

      Another possible representation uses the Nordsieck vector with * higher degrees scaled derivatives all taken at the same step, i.e it handles yn, * s1(n) and rn) where rn is defined as: - *

      + * 
      * rn = [ s2(n), s3(n) ... sk(n) ]T - *
      + * * (here again we omit the k index in the notation for clarity) - *

      * *

      Taylor series formulas show that for any index offset i, s1(n-i) can be * computed from s1(n), s2(n) ... sk(n), the formula being exact * for degree k polynomials. - *

      + * 
      * s1(n-i) = s1(n) + ∑j>0 (j+1) (-i)j sj+1(n) - *
      + * * The previous formula can be used with several values for i to compute the transform between * classical representation and Nordsieck vector at step end. The transform between rn * and qn resulting from the Taylor series formulas above is: - *
      + * 
      * qn = s1(n) u + P rn - *
      + * * where u is the [ 1 1 ... 1 ]T vector and P is the (k-1)×(k-1) matrix built * with the (j+1) (-i)j terms with i being the row number starting from 1 and j being * the column number starting from 1: @@ -85,7 +84,7 @@ import org.apache.commons.math4.linear.RealMatrix; * P = [ -6 27 -108 405 ... ] * [ -8 48 -256 1280 ... ] * [ ... ] - *

      + * * *

      Changing -i into +i in the formula above can be used to compute a similar transform between * classical representation and Nordsieck vector at step start. The resulting matrix is simply @@ -107,7 +106,7 @@ import org.apache.commons.math4.linear.RealMatrix; * [ ... | 0 ] * [ 0 0 ... 1 0 | 0 ] * [ 0 0 ... 0 1 | 0 ] - *

      + * * *

      For {@link AdamsMoultonIntegrator Adams-Moulton} method, the predicted Nordsieck vector * at step n+1 is computed from the Nordsieck vector at step n as follows: @@ -124,7 +123,7 @@ import org.apache.commons.math4.linear.RealMatrix; * * where the upper case Yn+1, S1(n+1) and Rn+1 represent the * predicted states whereas the lower case yn+1, sn+1 and rn+1 - * represent the corrected states.

      + * represent the corrected states. * *

      We observe that both methods use similar update formulas. In both cases a P-1u * vector and a P-1 A P matrix are used that do not depend on the state, @@ -220,7 +219,7 @@ public class AdamsNordsieckTransformer { * P = [ -6 27 -108 405 ... ] * [ -8 48 -256 1280 ... ] * [ ... ] - *

      + * * @param rows number of rows of the matrix * @return P matrix */ @@ -319,10 +318,10 @@ public class AdamsNordsieckTransformer { /** Update the high order scaled derivatives for Adams integrators (phase 1). *

      The complete update of high order derivatives has a form similar to: - *

      +     * 
      * rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rn - *
      - * this method computes the P-1 A P rn part.

      + *
      + * this method computes the P-1 A P rn part. * @param highOrder high order scaled derivatives * (h2/2 y'', ... hk/k! y(k)) * @return updated high order derivatives @@ -334,10 +333,10 @@ public class AdamsNordsieckTransformer { /** Update the high order scaled derivatives Adams integrators (phase 2). *

      The complete update of high order derivatives has a form similar to: - *

      +     * 
      * rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rn - *
      - * this method computes the (s1(n) - s1(n+1)) P-1 u part.

      + *
      + * this method computes the (s1(n) - s1(n+1)) P-1 u part. *

      Phase 1 of the update must already have been performed.

      * @param start first order scaled derivatives at step start * @param end first order scaled derivatives at step end diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdaptiveStepsizeFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdaptiveStepsizeFieldIntegrator.java index ca774c371..cda13102a 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdaptiveStepsizeFieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdaptiveStepsizeFieldIntegrator.java @@ -45,7 +45,7 @@ import org.apache.commons.math4.util.MathUtils; * state vector and relTol_i is the relative tolerance for the same * component. The user can also use only two scalar values absTol and * relTol which will be used for all components. - *

      + * *

      * Note that only the {@link FieldODEState#getState() main part} * of the state vector is used for stepsize control. The {@link @@ -55,12 +55,12 @@ import org.apache.commons.math4.util.MathUtils; * *

      If the estimated error for ym+1 is such that *

      - * sqrt((sum (errEst_i / threshold_i)^2 ) / n) < 1
      + * sqrt((sum (errEst_i / threshold_i)^2 ) / n) < 1
        * 
      * * (where n is the main set dimension) then the step is accepted, * otherwise the step is rejected and a new attempt is made with a new - * stepsize.

      + * stepsize. * * @param the type of the field elements * @since 3.6 diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdaptiveStepsizeIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdaptiveStepsizeIntegrator.java index 6dacc1ae1..7219383d6 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/AdaptiveStepsizeIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/AdaptiveStepsizeIntegrator.java @@ -40,7 +40,7 @@ import org.apache.commons.math4.util.FastMath; * state vector and relTol_i is the relative tolerance for the same * component. The user can also use only two scalar values absTol and * relTol which will be used for all components. - *

      + * *

      * If the Ordinary Differential Equations is an {@link ExpandableStatefulODE * extended ODE} rather than a {@link @@ -51,12 +51,12 @@ import org.apache.commons.math4.util.FastMath; * *

      If the estimated error for ym+1 is such that *

      - * sqrt((sum (errEst_i / threshold_i)^2 ) / n) < 1
      + * sqrt((sum (errEst_i / threshold_i)^2 ) / n) < 1
        * 
      * * (where n is the main set dimension) then the step is accepted, * otherwise the step is rejected and a new attempt is made with a new - * stepsize.

      + * stepsize. * * @since 1.2 * diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldIntegrator.java index 56add60de..55a9dfdf9 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldIntegrator.java @@ -38,7 +38,6 @@ import org.apache.commons.math4.util.MathArrays; * |-------------------- * | 1/6 1/3 1/3 1/6 * - *

      * * @see EulerFieldIntegrator * @see GillFieldIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldStepInterpolator.java index c4d1263fd..79a744e45 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldStepInterpolator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaFieldStepInterpolator.java @@ -45,7 +45,6 @@ import org.apache.commons.math4.ode.FieldODEStateAndDerivative; * ] * * - *

      * * where θ belongs to [0 ; 1] and where y'1 to y'4 are the four * evaluations of the derivatives already computed during the diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaIntegrator.java index e6df20442..68daf679e 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaIntegrator.java @@ -33,7 +33,6 @@ package org.apache.commons.math4.ode.nonstiff; * |-------------------- * | 1/6 1/3 1/3 1/6 * - *

      * * @see EulerIntegrator * @see GillIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaStepInterpolator.java index d7704d77d..8ae949a38 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaStepInterpolator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/ClassicalRungeKuttaStepInterpolator.java @@ -42,7 +42,6 @@ import org.apache.commons.math4.ode.sampling.StepInterpolator; * ] * * - *

      * * where θ belongs to [0 ; 1] and where y'1 to y'4 are the four * evaluations of the derivatives already computed during the diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldIntegrator.java index 12d7a6475..e6f0dbced 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54FieldIntegrator.java @@ -45,7 +45,7 @@ import org.apache.commons.math4.util.MathUtils; * J. R. Dormand and P. J. Prince * Journal of Computational and Applied Mathematics * volume 6, no 1, 1980, pp. 19-26 - *

      + * * * @param the type of the field elements * @since 3.6 diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54Integrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54Integrator.java index 731ea9358..5b4342de7 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54Integrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/DormandPrince54Integrator.java @@ -40,7 +40,7 @@ import org.apache.commons.math4.util.FastMath; * J. R. Dormand and P. J. Prince * Journal of Computational and Applied Mathematics * volume 6, no 1, 1980, pp. 19-26 - *

      + * * * @since 1.2 */ diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java index 6238953fb..16d8243a9 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java @@ -47,7 +47,6 @@ import org.apache.commons.math4.util.MathUtils; * | b1 b2 ... bs-1 bs * | b'1 b'2 ... b's-1 b's * - *

      * *

      In fact, we rather use the array defined by ej = bj - b'j to * compute directly the error rather than computing two estimates and diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java index a82f168a2..82cdfba9a 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java @@ -41,7 +41,6 @@ import org.apache.commons.math4.util.FastMath; * | b1 b2 ... bs-1 bs * | b'1 b'2 ... b's-1 b's * - *

      * *

      In fact, we rather use the array defined by ej = bj - b'j to * compute directly the error rather than computing two estimates and diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldStepInterpolator.java index 43b8a5377..2b084aac8 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldStepInterpolator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerFieldStepInterpolator.java @@ -36,7 +36,6 @@ import org.apache.commons.math4.ode.FieldODEStateAndDerivative; * y(tn + θ h) = y (tn + h) - (1-θ) h y' * * - *

      * * where θ belongs to [0 ; 1] and where y' is the evaluation of * the derivatives already computed during the step.

      diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerStepInterpolator.java index 74691b5aa..b693a9d27 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerStepInterpolator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/EulerStepInterpolator.java @@ -33,7 +33,6 @@ import org.apache.commons.math4.ode.sampling.StepInterpolator; * y(tn + θ h) = y (tn + h) - (1-θ) h y' * * - *

      * * where θ belongs to [0 ; 1] and where y' is the evaluation of * the derivatives already computed during the step.

      diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldIntegrator.java index 0ee8b5ded..e4a1294f9 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldIntegrator.java @@ -38,7 +38,7 @@ import org.apache.commons.math4.util.MathArrays; * |------------------------------- * | 1/6 (2-q)/6 (2+q)/6 1/6 * - * where q = sqrt(2)

      + * where q = sqrt(2) * * @see EulerFieldIntegrator * @see ClassicalRungeKuttaFieldIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldStepInterpolator.java index df474308e..cbbffbf96 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldStepInterpolator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/GillFieldStepInterpolator.java @@ -45,7 +45,6 @@ import org.apache.commons.math4.ode.FieldODEStateAndDerivative; * ] * * - *

      * where θ belongs to [0 ; 1] and where y'1 to y'4 * are the four evaluations of the derivatives already computed during * the step.

      diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/GillIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/GillIntegrator.java index 1ebc48f49..3da44831b 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/GillIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/GillIntegrator.java @@ -34,7 +34,7 @@ import org.apache.commons.math4.util.FastMath; * |------------------------------- * | 1/6 (2-q)/6 (2+q)/6 1/6 * - * where q = sqrt(2)

      + * where q = sqrt(2) * * @see EulerIntegrator * @see ClassicalRungeKuttaIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/GillStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/GillStepInterpolator.java index 435c5b2ac..033c36763 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/GillStepInterpolator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/GillStepInterpolator.java @@ -43,7 +43,6 @@ import org.apache.commons.math4.util.FastMath; * ] * * - *

      * where θ belongs to [0 ; 1] and where y'1 to y'4 * are the four evaluations of the derivatives already computed during * the step.

      diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/GraggBulirschStoerIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/GraggBulirschStoerIntegrator.java index 47defd29e..410dfa82f 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/GraggBulirschStoerIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/GraggBulirschStoerIntegrator.java @@ -61,9 +61,8 @@ import org.apache.commons.math4.util.FastMath; * for this code is available here, for * convenience, it is reproduced below.

      - *

      * - * + *
      * * *
      Copyright (c) 2004, Ernst Hairer
      Redistribution and use in source and binary forms, with or @@ -240,13 +239,13 @@ public class GraggBulirschStoerIntegrator extends AdaptiveStepsizeIntegrator { * * where err is the scaled error and k the iteration number of the * extrapolation scheme (counting from 0). The default values are - * 0.65 for stepControl1 and 0.94 for stepControl2.

      + * 0.65 for stepControl1 and 0.94 for stepControl2. *

      The step size is subject to the restriction: *

      -   * stepControl3^(1/(2k+1))/stepControl4 <= hNew/h <= 1/stepControl3^(1/(2k+1))
      +   * stepControl3^(1/(2k+1))/stepControl4 <= hNew/h <= 1/stepControl3^(1/(2k+1))
          * 
      * The default values are 0.02 for stepControl3 and 4.0 for - * stepControl4.

      + * stepControl4. * @param control1 first stepsize control factor (the factor is * reset to default if lower than 0.0001 or greater than 0.9999) * @param control2 second stepsize control factor (the factor @@ -292,8 +291,8 @@ public class GraggBulirschStoerIntegrator extends AdaptiveStepsizeIntegrator { * maximal order that will be used is always even, it is twice the * maximal number of columns in the extrapolation table.

      *
      -   * order is decreased if w(k-1) <= w(k)   * orderControl1
      -   * order is increased if w(k)   <= w(k-1) * orderControl2
      +   * order is decreased if w(k-1) <= w(k)   * orderControl1
      +   * order is increased if w(k)   <= w(k-1) * orderControl2
          * 
      *

      where w is the table of work per unit step for each order * (number of function calls divided by the step length), and k is @@ -302,7 +301,7 @@ public class GraggBulirschStoerIntegrator extends AdaptiveStepsizeIntegrator { * maximal number of columns is 9). The default values are 0.8 for * orderControl1 and 0.9 for orderControl2.

      * @param maximalOrder maximal order in the extrapolation table (the - * maximal order is reset to default if order <= 6 or odd) + * maximal order is reset to default if order <= 6 or odd) * @param control1 first order control factor (the factor is * reset to default if lower than 0.0001 or greater than 0.9999) * @param control2 second order control factor (the factor @@ -403,7 +402,7 @@ public class GraggBulirschStoerIntegrator extends AdaptiveStepsizeIntegrator { * @param useInterpolationErrorForControl if true, interpolation error is used * for stepsize control * @param mudifControlParameter interpolation order control parameter (the parameter - * is reset to default if <= 0 or >= 7) + * is reset to default if <= 0 or >= 7) */ public void setInterpolationControl(final boolean useInterpolationErrorForControl, final int mudifControlParameter) { diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldIntegrator.java index b3c142442..c6b2ceeb5 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherFieldIntegrator.java @@ -47,7 +47,7 @@ import org.apache.commons.math4.util.MathArrays; * |-------------------------------------------------------------------------------------------------------------------------------------------------- * | 1/20 0 16/45 0 49/180 49/180 1/20 * - * where q = √21

      + * where q = √21 * * @see EulerFieldIntegrator * @see ClassicalRungeKuttaFieldIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherIntegrator.java index 631d6b23e..315499979 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/LutherIntegrator.java @@ -43,7 +43,7 @@ import org.apache.commons.math4.util.FastMath; * |-------------------------------------------------------------------------------------------------------------------------------------------------- * | 1/20 0 16/45 0 49/180 49/180 1/20 * - * where q = √21

      + * where q = √21 * * @see EulerIntegrator * @see ClassicalRungeKuttaIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldIntegrator.java index 3b604e37f..06db924f4 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldIntegrator.java @@ -35,7 +35,6 @@ import org.apache.commons.math4.util.MathArrays; * |---------- * | 0 1 * - *

      * * @see EulerFieldIntegrator * @see ClassicalRungeKuttaFieldIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldStepInterpolator.java index f64012eab..12225291e 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldStepInterpolator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointFieldStepInterpolator.java @@ -37,7 +37,6 @@ import org.apache.commons.math4.ode.FieldODEStateAndDerivative; * y(tn + θ h) = y (tn + h) + (1-θ) h [θ y'1 - (1+θ) y'2] * * - *

      * * where θ belongs to [0 ; 1] and where y'1 and y'2 are the two * evaluations of the derivatives already computed during the diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointIntegrator.java index ff415204a..4abbebfe2 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointIntegrator.java @@ -30,7 +30,6 @@ package org.apache.commons.math4.ode.nonstiff; * |---------- * | 0 1 * - *

      * * @see EulerIntegrator * @see ClassicalRungeKuttaIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointStepInterpolator.java index 45014bbc5..96446b20f 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointStepInterpolator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/MidpointStepInterpolator.java @@ -34,7 +34,6 @@ import org.apache.commons.math4.ode.sampling.StepInterpolator; * y(tn + θ h) = y (tn + h) + (1-θ) h [θ y'1 - (1+θ) y'2] * * - *

      * * where θ belongs to [0 ; 1] and where y'1 and y'2 are the two * evaluations of the derivatives already computed during the diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaFieldIntegrator.java index f07bbae73..dc7714e85 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaFieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaFieldIntegrator.java @@ -47,7 +47,6 @@ import org.apache.commons.math4.util.MathArrays; * |-------------------------- * | b1 b2 ... bs-1 bs * - *

      * * @see EulerFieldIntegrator * @see ClassicalRungeKuttaFieldIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaIntegrator.java index 4b8b6c358..71aff79af 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/RungeKuttaIntegrator.java @@ -42,7 +42,6 @@ import org.apache.commons.math4.util.FastMath; * |-------------------------- * | b1 b2 ... bs-1 bs * - *

      * * @see EulerIntegrator * @see ClassicalRungeKuttaIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldIntegrator.java index 8169d7539..979bb1e88 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldIntegrator.java @@ -37,7 +37,6 @@ import org.apache.commons.math4.util.MathArrays; * |-------------------- * | 1/8 3/8 3/8 1/8 * - *

      * * @see EulerFieldIntegrator * @see ClassicalRungeKuttaFieldIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolator.java index b41f91a55..17d41cd81 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolator.java @@ -47,7 +47,6 @@ import org.apache.commons.math4.ode.FieldODEStateAndDerivative; * ] * * - *

      * * where θ belongs to [0 ; 1] and where y'1 to y'4 are the four * evaluations of the derivatives already computed during the diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesIntegrator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesIntegrator.java index cb145110c..1250686a2 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesIntegrator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesIntegrator.java @@ -32,7 +32,6 @@ package org.apache.commons.math4.ode.nonstiff; * |-------------------- * | 1/8 3/8 3/8 1/8 * - *

      * * @see EulerIntegrator * @see ClassicalRungeKuttaIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesStepInterpolator.java b/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesStepInterpolator.java index c5a20e0bd..b94b61c81 100644 --- a/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesStepInterpolator.java +++ b/src/main/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesStepInterpolator.java @@ -44,7 +44,6 @@ import org.apache.commons.math4.ode.sampling.StepInterpolator; * ] * * - *

      * * where θ belongs to [0 ; 1] and where y'1 to y'4 are the four * evaluations of the derivatives already computed during the diff --git a/src/main/java/org/apache/commons/math4/ode/package-info.java b/src/main/java/org/apache/commons/math4/ode/package-info.java index 106a75712..f905d77ac 100644 --- a/src/main/java/org/apache/commons/math4/ode/package-info.java +++ b/src/main/java/org/apache/commons/math4/ode/package-info.java @@ -127,10 +127,9 @@ * automatic guess is wrong. *

      * - *

      - * - * - * + *
      Fixed Step Integrators
      NameOrder
      + * + * * * * @@ -138,11 +137,10 @@ * * *
      Fixed Step Integrators
      NameOrder
      {@link org.apache.commons.math4.ode.nonstiff.EulerIntegrator Euler}1
      {@link org.apache.commons.math4.ode.nonstiff.MidpointIntegrator Midpoint}2
      {@link org.apache.commons.math4.ode.nonstiff.ClassicalRungeKuttaIntegrator Classical Runge-Kutta}4
      {@link org.apache.commons.math4.ode.nonstiff.ThreeEighthesIntegrator 3/8}4
      {@link org.apache.commons.math4.ode.nonstiff.LutherIntegrator Luther}6
      - *

      * - * - * - * + *
      Adaptive Stepsize Integrators
      NameIntegration OrderError Estimation Order
      + * + * * * * @@ -150,7 +148,6 @@ * * *
      Adaptive Stepsize Integrators
      NameIntegration OrderError Estimation Order
      {@link org.apache.commons.math4.ode.nonstiff.HighamHall54Integrator Higham and Hall}54
      {@link org.apache.commons.math4.ode.nonstiff.DormandPrince54Integrator Dormand-Prince 5(4)}54
      {@link org.apache.commons.math4.ode.nonstiff.DormandPrince853Integrator Dormand-Prince 8(5,3)}85 and 3
      {@link org.apache.commons.math4.ode.nonstiff.AdamsBashforthIntegrator Adams-Bashforth}variablevariable
      {@link org.apache.commons.math4.ode.nonstiff.AdamsMoultonIntegrator Adams-Moulton}variablevariable
      - *

      * *

      * In the table above, the {@link org.apache.commons.math4.ode.nonstiff.AdamsBashforthIntegrator diff --git a/src/main/java/org/apache/commons/math4/ode/sampling/FieldStepNormalizer.java b/src/main/java/org/apache/commons/math4/ode/sampling/FieldStepNormalizer.java index bee9b1bcb..4729e177f 100644 --- a/src/main/java/org/apache/commons/math4/ode/sampling/FieldStepNormalizer.java +++ b/src/main/java/org/apache/commons/math4/ode/sampling/FieldStepNormalizer.java @@ -42,12 +42,11 @@ import org.apache.commons.numbers.core.Precision; * it needs (time steps longer or shorter than the fixed time step and * non-integer ratios are all allowed).

      * - *

      - * - * - * + *
      Examples (step size = 0.5)
      Start timeEnd time
      + * + * * - * + * * * * @@ -81,7 +80,6 @@ import org.apache.commons.numbers.core.Precision; * * *
      Examples (step size = 0.5)
      Start timeEnd timeDirection{@link StepNormalizerMode Mode}{@link StepNormalizerBounds Bounds}Output
      {@link StepNormalizerBounds Bounds}Output
      0.33.1forward{@link StepNormalizerMode#INCREMENT INCREMENT}{@link StepNormalizerBounds#NEITHER NEITHER}0.8, 1.3, 1.8, 2.3, 2.8
      0.33.1forward{@link StepNormalizerMode#INCREMENT INCREMENT}{@link StepNormalizerBounds#FIRST FIRST}0.3, 0.8, 1.3, 1.8, 2.3, 2.8
      0.33.1forward{@link StepNormalizerMode#INCREMENT INCREMENT}{@link StepNormalizerBounds#LAST LAST}0.8, 1.3, 1.8, 2.3, 2.8, 3.1
      3.00.0backward{@link StepNormalizerMode#MULTIPLES MULTIPLES}{@link StepNormalizerBounds#LAST LAST}2.5, 2.0, 1.5, 1.0, 0.5, 0.0
      3.00.0backward{@link StepNormalizerMode#MULTIPLES MULTIPLES}{@link StepNormalizerBounds#BOTH BOTH}3.0, 2.5, 2.0, 1.5, 1.0, 0.5, 0.0
      - *

      * * @param the type of the field elements * @see FieldStepHandler diff --git a/src/main/java/org/apache/commons/math4/ode/sampling/StepNormalizer.java b/src/main/java/org/apache/commons/math4/ode/sampling/StepNormalizer.java index edec00c92..b9b514063 100644 --- a/src/main/java/org/apache/commons/math4/ode/sampling/StepNormalizer.java +++ b/src/main/java/org/apache/commons/math4/ode/sampling/StepNormalizer.java @@ -40,12 +40,11 @@ import org.apache.commons.numbers.core.Precision; * it needs (time steps longer or shorter than the fixed time step and * non-integer ratios are all allowed).

      * - *

      - * - * - * + *
      Examples (step size = 0.5)
      Start timeEnd time
      + * + * * - * + * * * * @@ -79,7 +78,6 @@ import org.apache.commons.numbers.core.Precision; * * *
      Examples (step size = 0.5)
      Start timeEnd timeDirection{@link StepNormalizerMode Mode}{@link StepNormalizerBounds Bounds}Output
      {@link StepNormalizerBounds Bounds}Output
      0.33.1forward{@link StepNormalizerMode#INCREMENT INCREMENT}{@link StepNormalizerBounds#NEITHER NEITHER}0.8, 1.3, 1.8, 2.3, 2.8
      0.33.1forward{@link StepNormalizerMode#INCREMENT INCREMENT}{@link StepNormalizerBounds#FIRST FIRST}0.3, 0.8, 1.3, 1.8, 2.3, 2.8
      0.33.1forward{@link StepNormalizerMode#INCREMENT INCREMENT}{@link StepNormalizerBounds#LAST LAST}0.8, 1.3, 1.8, 2.3, 2.8, 3.1
      3.00.0backward{@link StepNormalizerMode#MULTIPLES MULTIPLES}{@link StepNormalizerBounds#LAST LAST}2.5, 2.0, 1.5, 1.0, 0.5, 0.0
      3.00.0backward{@link StepNormalizerMode#MULTIPLES MULTIPLES}{@link StepNormalizerBounds#BOTH BOTH}3.0, 2.5, 2.0, 1.5, 1.0, 0.5, 0.0
      - *

      * * @see StepHandler * @see FixedStepHandler diff --git a/src/main/java/org/apache/commons/math4/optim/BaseMultiStartMultivariateOptimizer.java b/src/main/java/org/apache/commons/math4/optim/BaseMultiStartMultivariateOptimizer.java index 4ceab3e0a..937ff50e3 100644 --- a/src/main/java/org/apache/commons/math4/optim/BaseMultiStartMultivariateOptimizer.java +++ b/src/main/java/org/apache/commons/math4/optim/BaseMultiStartMultivariateOptimizer.java @@ -23,7 +23,7 @@ import org.apache.commons.math4.random.RandomVectorGenerator; /** * Base class multi-start optimizer for a multivariate function. - *
      + *
      * This class wraps an optimizer in order to use it several times in * turn with different starting points (trying to avoid being trapped * in a local extremum when looking for a global one). @@ -101,7 +101,7 @@ public abstract class BaseMultiStartMultivariateOptimizer * restarts. The {@code optimize} method returns the best point only. * This method returns all the points found at the end of each starts, * including the best one already returned by the {@code optimize} method. - *
      + *
      * The returned array as one element for each start as specified * in the constructor. It is ordered with the results from the * runs that did converge first, sorted from best to worst @@ -112,7 +112,7 @@ public abstract class BaseMultiStartMultivariateOptimizer * an exception. * This also means that if the first element is not {@code null}, it is * the best point found across all starts. - *
      + *
      * The behaviour is undefined if this method is called before * {@code optimize}; it will likely throw {@code NullPointerException}. * diff --git a/src/main/java/org/apache/commons/math4/optim/ConvergenceChecker.java b/src/main/java/org/apache/commons/math4/optim/ConvergenceChecker.java index b61e419c5..c8507f5d8 100644 --- a/src/main/java/org/apache/commons/math4/optim/ConvergenceChecker.java +++ b/src/main/java/org/apache/commons/math4/optim/ConvergenceChecker.java @@ -20,11 +20,11 @@ package org.apache.commons.math4.optim; /** * This interface specifies how to check if an optimization algorithm has * converged. - *
      + *
      * Deciding if convergence has been reached is a problem-dependent issue. The * user should provide a class implementing this interface to allow the * optimization algorithm to stop its search according to the problem at hand. - *
      + *
      * For convenience, three implementations that fit simple needs are already * provided: {@link SimpleValueChecker}, {@link SimpleVectorValueChecker} and * {@link SimplePointChecker}. The first two consider that convergence is diff --git a/src/main/java/org/apache/commons/math4/optim/InitialGuess.java b/src/main/java/org/apache/commons/math4/optim/InitialGuess.java index d1d8fe01e..3377013e5 100644 --- a/src/main/java/org/apache/commons/math4/optim/InitialGuess.java +++ b/src/main/java/org/apache/commons/math4/optim/InitialGuess.java @@ -19,7 +19,7 @@ package org.apache.commons.math4.optim; /** * Starting point (first guess) of the optimization procedure. - *
      + *
      * Immutable class. * * @since 3.1 diff --git a/src/main/java/org/apache/commons/math4/optim/SimpleBounds.java b/src/main/java/org/apache/commons/math4/optim/SimpleBounds.java index c16634155..7922d5a56 100644 --- a/src/main/java/org/apache/commons/math4/optim/SimpleBounds.java +++ b/src/main/java/org/apache/commons/math4/optim/SimpleBounds.java @@ -22,7 +22,7 @@ import java.util.Arrays; * Simple optimization constraints: lower and upper bounds. * The valid range of the parameters is an interval that can be infinite * (in one or both directions). - *
      + *
      * Immutable class. * * @since 3.1 diff --git a/src/main/java/org/apache/commons/math4/optim/SimplePointChecker.java b/src/main/java/org/apache/commons/math4/optim/SimplePointChecker.java index e1463c9fb..6bb18001c 100644 --- a/src/main/java/org/apache/commons/math4/optim/SimplePointChecker.java +++ b/src/main/java/org/apache/commons/math4/optim/SimplePointChecker.java @@ -28,7 +28,7 @@ import org.apache.commons.math4.util.Pair; * difference between each point coordinate are smaller than a threshold * or if either the absolute difference between the point coordinates are * smaller than another threshold. - *
      + *
      * The {@link #converged(int,Pair,Pair) converged} method will also return * {@code true} if the number of iterations has been set (see * {@link #SimplePointChecker(double,double,int) this constructor}). diff --git a/src/main/java/org/apache/commons/math4/optim/SimpleValueChecker.java b/src/main/java/org/apache/commons/math4/optim/SimpleValueChecker.java index a62c8ca80..9e1379a4c 100644 --- a/src/main/java/org/apache/commons/math4/optim/SimpleValueChecker.java +++ b/src/main/java/org/apache/commons/math4/optim/SimpleValueChecker.java @@ -28,7 +28,7 @@ import org.apache.commons.math4.util.FastMath; * difference between the objective function values is smaller than a * threshold or if either the absolute difference between the objective * function values is smaller than another threshold. - *
      + *
      * The {@link #converged(int,PointValuePair,PointValuePair) converged} * method will also return {@code true} if the number of iterations has been set * (see {@link #SimpleValueChecker(double,double,int) this constructor}). diff --git a/src/main/java/org/apache/commons/math4/optim/SimpleVectorValueChecker.java b/src/main/java/org/apache/commons/math4/optim/SimpleVectorValueChecker.java index 460fb3810..7d31520a9 100644 --- a/src/main/java/org/apache/commons/math4/optim/SimpleVectorValueChecker.java +++ b/src/main/java/org/apache/commons/math4/optim/SimpleVectorValueChecker.java @@ -28,7 +28,7 @@ import org.apache.commons.math4.util.FastMath; * difference between the objective function values is smaller than a * threshold or if either the absolute difference between the objective * function values is smaller than another threshold for all vectors elements. - *
      + *
      * The {@link #converged(int,PointVectorValuePair,PointVectorValuePair) converged} * method will also return {@code true} if the number of iterations has been set * (see {@link #SimpleVectorValueChecker(double,double,int) this constructor}). diff --git a/src/main/java/org/apache/commons/math4/optim/linear/LinearConstraint.java b/src/main/java/org/apache/commons/math4/optim/linear/LinearConstraint.java index 8e804e888..bd4b0b856 100644 --- a/src/main/java/org/apache/commons/math4/optim/linear/LinearConstraint.java +++ b/src/main/java/org/apache/commons/math4/optim/linear/LinearConstraint.java @@ -32,17 +32,16 @@ import org.apache.commons.math4.linear.RealVector; *
        *
      • c1x1 + ... cnxn = v
      • *
      • c1x1 + ... cnxn <= v
      • - *
      • c1x1 + ... cnxn >= v
      • + *
      • c1x1 + ... cnxn >= v
      • *
      • l1x1 + ... lnxn + lcst = * r1x1 + ... rnxn + rcst
      • *
      • l1x1 + ... lnxn + lcst <= * r1x1 + ... rnxn + rcst
      • - *
      • l1x1 + ... lnxn + lcst >= + *
      • l1x1 + ... lnxn + lcst >= * r1x1 + ... rnxn + rcst
      • *
      * The ci, li or ri are the coefficients of the constraints, the xi * are the coordinates of the current point and v is the value of the constraint. - *

      * * @since 2.0 */ @@ -63,9 +62,9 @@ public class LinearConstraint implements Serializable { *
        *
      • c1x1 + ... cnxn = v
      • *
      • c1x1 + ... cnxn <= v
      • - *
      • c1x1 + ... cnxn >= v
      • + *
      • c1x1 + ... cnxn >= v
      • *
      - *

      + * * @param coefficients The coefficients of the constraint (left hand side) * @param relationship The type of (in)equality used in the constraint * @param value The value of the constraint (right hand side) @@ -83,9 +82,9 @@ public class LinearConstraint implements Serializable { *
        *
      • c1x1 + ... cnxn = v
      • *
      • c1x1 + ... cnxn <= v
      • - *
      • c1x1 + ... cnxn >= v
      • + *
      • c1x1 + ... cnxn >= v
      • *
      - *

      + * * @param coefficients The coefficients of the constraint (left hand side) * @param relationship The type of (in)equality used in the constraint * @param value The value of the constraint (right hand side) @@ -107,10 +106,10 @@ public class LinearConstraint implements Serializable { * r1x1 + ... rnxn + rcst *
    13. l1x1 + ... lnxn + lcst <= * r1x1 + ... rnxn + rcst
    14. - *
    15. l1x1 + ... lnxn + lcst >= + *
    16. l1x1 + ... lnxn + lcst >= * r1x1 + ... rnxn + rcst
    17. * - *

      + * * @param lhsCoefficients The coefficients of the linear expression on the left hand side of the constraint * @param lhsConstant The constant term of the linear expression on the left hand side of the constraint * @param relationship The type of (in)equality used in the constraint @@ -138,10 +137,10 @@ public class LinearConstraint implements Serializable { * r1x1 + ... rnxn + rcst *
    18. l1x1 + ... lnxn + lcst <= * r1x1 + ... rnxn + rcst
    19. - *
    20. l1x1 + ... lnxn + lcst >= + *
    21. l1x1 + ... lnxn + lcst >= * r1x1 + ... rnxn + rcst
    22. * - *

      + * * @param lhsCoefficients The coefficients of the linear expression on the left hand side of the constraint * @param lhsConstant The constant term of the linear expression on the left hand side of the constraint * @param relationship The type of (in)equality used in the constraint diff --git a/src/main/java/org/apache/commons/math4/optim/linear/LinearObjectiveFunction.java b/src/main/java/org/apache/commons/math4/optim/linear/LinearObjectiveFunction.java index 9bf186683..8a699fd8f 100644 --- a/src/main/java/org/apache/commons/math4/optim/linear/LinearObjectiveFunction.java +++ b/src/main/java/org/apache/commons/math4/optim/linear/LinearObjectiveFunction.java @@ -31,12 +31,11 @@ import org.apache.commons.math4.optim.OptimizationData; * An objective function for a linear optimization problem. *

      * A linear objective function has one the form: - *

      + * 
      * c1x1 + ... cnxn + d - *
      + * * The ci and d are the coefficients of the equation, * the xi are the coordinates of the current point. - *

      * * @since 2.0 */ diff --git a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/LeastSquaresConverter.java b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/LeastSquaresConverter.java index 3860cd54b..98346ea35 100644 --- a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/LeastSquaresConverter.java +++ b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/LeastSquaresConverter.java @@ -27,14 +27,14 @@ import org.apache.commons.math4.linear.RealMatrix; * {@link MultivariateVectorFunction vectorial objective functions} to * {@link MultivariateFunction scalar objective functions} * when the goal is to minimize them. - *
      + *
      * This class is mostly used when the vectorial objective function represents * a theoretical result computed from a point set applied to a model and * the models point must be adjusted to fit the theoretical result to some * reference observations. The observations may be obtained for example from * physical measurements whether the model is built from theoretical * considerations. - *
      + *
      * This class computes a possibly weighted squared sum of the residuals, which is * a scalar value. The residuals are the difference between the theoretical model * (i.e. the output of the vectorial objective function) and the observations. The @@ -43,7 +43,7 @@ import org.apache.commons.math4.linear.RealMatrix; * to perform a least square estimation. There are other ways to do this without using * this converter, as some optimization algorithms directly support vectorial objective * functions. - *
      + *
      * This class support combination of residuals with or without weights and correlations. * * @see MultivariateFunction @@ -81,10 +81,10 @@ public class LeastSquaresConverter implements MultivariateFunction { * specified weights. *

      * The scalar objective function value is computed as: - *

      +     * 
      * objective = ∑weighti(observationi-objectivei)2 - *
      - *

      + *
      + * *

      * Weights can be used for example to combine residuals with different standard * deviations. As an example, consider a residuals array in which even elements @@ -124,10 +124,10 @@ public class LeastSquaresConverter implements MultivariateFunction { * specified weights. *

      * The scalar objective function value is computed as: - *

      +     * 
      * objective = yTy with y = scale×(observation-objective) - *
      - *

      + *
      + * *

      * The array computed by the objective function, the observations array and the * the scaling matrix must have consistent sizes or a {@link DimensionMismatchException} diff --git a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/MultivariateFunctionPenaltyAdapter.java b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/MultivariateFunctionPenaltyAdapter.java index 33bb852a7..37fe24dec 100644 --- a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/MultivariateFunctionPenaltyAdapter.java +++ b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/MultivariateFunctionPenaltyAdapter.java @@ -85,11 +85,11 @@ public class MultivariateFunctionPenaltyAdapter * function. In order for this penalty to be effective in rejecting this * point during the optimization process, the penalty function value should * be defined with care. This value is computed as: - *

      +     * 
      * penalty(point) = offset + ∑i[scale[i] * √|point[i]-boundary[i]|] - *
      + * * where indices i correspond to all the components that violates their boundaries. - *

      + * *

      * So when attempting a function minimization, offset should be larger than * the maximum expected value of the underlying function and scale components diff --git a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/NonLinearConjugateGradientOptimizer.java b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/NonLinearConjugateGradientOptimizer.java index 75dd0245e..2bd188ee3 100644 --- a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/NonLinearConjugateGradientOptimizer.java +++ b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/NonLinearConjugateGradientOptimizer.java @@ -31,11 +31,11 @@ import org.apache.commons.math4.optim.nonlinear.scalar.LineSearch; /** * Non-linear conjugate gradient optimizer. - *
      + *
      * This class supports both the Fletcher-Reeves and the Polak-Ribière * update formulas for the conjugate search directions. * It also supports optional preconditioning. - *
      + *
      * Constraints are not supported: the call to * {@link #optimize(OptimizationData[]) optimize} will throw * {@link MathUnsupportedOperationException} if bounds are passed to it. diff --git a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/AbstractSimplex.java b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/AbstractSimplex.java index 45da0369f..4ddfaede9 100644 --- a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/AbstractSimplex.java +++ b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/AbstractSimplex.java @@ -34,12 +34,12 @@ import org.apache.commons.math4.optim.PointValuePair; /** * This class implements the simplex concept. * It is intended to be used in conjunction with {@link SimplexOptimizer}. - *
      + *
      * The initial configuration of the simplex is set by the constructors * {@link #AbstractSimplex(double[])} or {@link #AbstractSimplex(double[][])}. * The other {@link #AbstractSimplex(int) constructor} will set all steps * to 1, thus building a default configuration from a unit hypercube. - *
      + *
      * Users must call the {@link #build(double[]) build} method in order * to create the data structure that will be acted on by the other methods of * this class. diff --git a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizer.java b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizer.java index 74bf89d53..4366b1528 100644 --- a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizer.java +++ b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizer.java @@ -35,7 +35,7 @@ import org.apache.commons.math4.util.FastMath; * here. * See * this paper for an introduction. - *
      + *
      * BOBYQA is particularly well suited for high dimensional problems * where derivatives are not available. In most cases it outperforms the * {@link PowellOptimizer} significantly. Stochastic algorithms like @@ -148,9 +148,9 @@ public class BOBYQAOptimizer /** * Differences {@link #getLowerBound()} - {@link #originShift}. * All the components of every {@link #trustRegionCenterOffset} are going - * to satisfy the bounds
      + * to satisfy the bounds
      * {@link #getLowerBound() lowerBound}i ≤ - * {@link #trustRegionCenterOffset}i,
      + * {@link #trustRegionCenterOffset}i,
      * with appropriate equalities when {@link #trustRegionCenterOffset} is * on a constraint boundary. * XXX "sl" in the original code. @@ -159,9 +159,9 @@ public class BOBYQAOptimizer /** * Differences {@link #getUpperBound()} - {@link #originShift} * All the components of every {@link #trustRegionCenterOffset} are going - * to satisfy the bounds
      + * to satisfy the bounds
      * {@link #trustRegionCenterOffset}i ≤ - * {@link #getUpperBound() upperBound}i,
      + * {@link #getUpperBound() upperBound}i,
      * with appropriate equalities when {@link #trustRegionCenterOffset} is * on a constraint boundary. * XXX "su" in the original code. diff --git a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java index e47266a9e..18af3c0c7 100644 --- a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java +++ b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java @@ -56,16 +56,16 @@ import org.apache.commons.math4.util.MathArrays; *

      * In general, on smooth objective functions the CMA-ES is roughly ten times * slower than BFGS (counting objective function evaluations, no gradients provided). - * For up to N=10 variables also the derivative-free simplex + * For up to N=10 variables also the derivative-free simplex * direct search method (Nelder and Mead) can be faster, but it is * far less reliable than CMA-ES. *

      * The CMA-ES is particularly well suited for non-separable * and/or badly conditioned problems. To observe the advantage of CMA compared * to a conventional evolution strategy, it will usually take about - * 30 N function evaluations. On difficult problems the complete + * 30 N function evaluations. On difficult problems the complete * optimization (a single run) is expected to take roughly between - * 30 N and 300 N2 + * 30 N and 300 N2 * function evaluations. *

      * This implementation is translated and adapted from the Matlab version diff --git a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/PowellOptimizer.java b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/PowellOptimizer.java index 90d81de0e..f4d5fedca 100644 --- a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/PowellOptimizer.java +++ b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/PowellOptimizer.java @@ -34,14 +34,14 @@ import org.apache.commons.math4.util.MathArrays; * This code is translated and adapted from the Python version of this * algorithm (as implemented in module {@code optimize.py} v0.5 of * SciPy). - *
      + *
      * The default stopping criterion is based on the differences of the * function value between two successive iterations. It is however possible * to define a custom convergence checker that might terminate the algorithm * earlier. - *
      + *
      * Line search is performed by the {@link LineSearch} class. - *
      + *
      * Constraints are not supported: the call to * {@link #optimize(OptimizationData[]) optimize} will throw * {@link MathUnsupportedOperationException} if bounds are passed to it. @@ -77,7 +77,7 @@ public class PowellOptimizer * This constructor allows to specify a user-defined convergence checker, * in addition to the parameters that control the default convergence * checking procedure. - *
      + *
      * The internal line search tolerances are set to the square-root of their * corresponding value in the multivariate optimizer. * @@ -131,7 +131,7 @@ public class PowellOptimizer /** * The parameters control the default convergence checking procedure. - *
      + *
      * The internal line search tolerances are set to the square-root of their * corresponding value in the multivariate optimizer. * diff --git a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/SimplexOptimizer.java b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/SimplexOptimizer.java index 9658944a1..54e2884e6 100644 --- a/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/SimplexOptimizer.java +++ b/src/main/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/SimplexOptimizer.java @@ -50,7 +50,7 @@ import org.apache.commons.math4.optim.nonlinear.scalar.MultivariateOptimizer; * the objective function values at the vertices of a simplex (which is a * set of n+1 points in dimension n) that is updated by the algorithms * steps. - *

      + *

      *

      * The simplex update procedure ({@link NelderMeadSimplex} or * {@link MultiDirectionalSimplex}) must be passed to the @@ -79,7 +79,7 @@ import org.apache.commons.math4.optim.nonlinear.scalar.MultivariateOptimizer; * MultivariateFunctionMappingAdapter} or * {@link org.apache.commons.math4.optim.nonlinear.scalar.MultivariateFunctionPenaltyAdapter * MultivariateFunctionPenaltyAdapter}. - *
      + *
      * The call to {@link #optimize(OptimizationData[]) optimize} will throw * {@link MathUnsupportedOperationException} if bounds are passed to it. *

      diff --git a/src/main/java/org/apache/commons/math4/optim/package-info.java b/src/main/java/org/apache/commons/math4/optim/package-info.java index 8f3d99c9b..d6b63482c 100644 --- a/src/main/java/org/apache/commons/math4/optim/package-info.java +++ b/src/main/java/org/apache/commons/math4/optim/package-info.java @@ -23,7 +23,7 @@ * a scalar function, called the * {@link org.apache.commons.math4.optim.nonlinear.scalar.ObjectiveFunction objective * function}. - *
      + *
      * For some scalar objective functions the gradient can be computed (analytically * or numerically). Algorithms that use this knowledge are defined in the * {@link org.apache.commons.math4.optim.nonlinear.scalar.gradient} package. diff --git a/src/main/java/org/apache/commons/math4/optim/univariate/BrentOptimizer.java b/src/main/java/org/apache/commons/math4/optim/univariate/BrentOptimizer.java index e1b2d9dae..6cc67b86a 100644 --- a/src/main/java/org/apache/commons/math4/optim/univariate/BrentOptimizer.java +++ b/src/main/java/org/apache/commons/math4/optim/univariate/BrentOptimizer.java @@ -30,7 +30,7 @@ import org.apache.commons.numbers.core.Precision; * It implements Richard Brent's algorithm (from his book "Algorithms for * Minimization without Derivatives", p. 79) for finding minima of real * univariate functions. - *
      + *
      * This code is an adaptation, partly based on the Python code from SciPy * (module "optimize.py" v0.5); the original algorithm is also modified *
        diff --git a/src/main/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizer.java b/src/main/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizer.java index 373a3078d..6b3e9af42 100644 --- a/src/main/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizer.java +++ b/src/main/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizer.java @@ -31,7 +31,7 @@ import org.apache.commons.rng.UniformRandomProvider; /** * Special implementation of the {@link UnivariateOptimizer} interface * adding multi-start features to an existing optimizer. - *
        + *
        * This class wraps an optimizer in order to use it several times in * turn with different starting points (trying to avoid being trapped * in a local extremum when looking for a global one). @@ -99,7 +99,7 @@ public class MultiStartUnivariateOptimizer * restarts. The {@code optimize} method returns the best point only. * This method returns all the points found at the end of each starts, * including the best one already returned by the {@code optimize} method. - *
        + *
        * The returned array as one element for each start as specified * in the constructor. It is ordered with the results from the * runs that did converge first, sorted from best to worst diff --git a/src/main/java/org/apache/commons/math4/optim/univariate/SearchInterval.java b/src/main/java/org/apache/commons/math4/optim/univariate/SearchInterval.java index 172cf808b..8bed3865d 100644 --- a/src/main/java/org/apache/commons/math4/optim/univariate/SearchInterval.java +++ b/src/main/java/org/apache/commons/math4/optim/univariate/SearchInterval.java @@ -22,7 +22,7 @@ import org.apache.commons.math4.optim.OptimizationData; /** * Search interval and (optional) start value. - *
        + *
        * Immutable class. * * @since 3.1 diff --git a/src/main/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueChecker.java b/src/main/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueChecker.java index b37a5b3b2..878dd61e4 100644 --- a/src/main/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueChecker.java +++ b/src/main/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueChecker.java @@ -29,7 +29,7 @@ import org.apache.commons.math4.util.FastMath; * difference between the objective function values is smaller than a * threshold or if either the absolute difference between the objective * function values is smaller than another threshold. - *
        + *
        * The {@link #converged(int,UnivariatePointValuePair,UnivariatePointValuePair) * converged} method will also return {@code true} if the number of iterations * has been set (see {@link #SimpleUnivariateValueChecker(double,double,int) diff --git a/src/main/java/org/apache/commons/math4/random/RngAdaptor.java b/src/main/java/org/apache/commons/math4/random/RngAdaptor.java index 2852d58aa..7e913570b 100644 --- a/src/main/java/org/apache/commons/math4/random/RngAdaptor.java +++ b/src/main/java/org/apache/commons/math4/random/RngAdaptor.java @@ -63,7 +63,7 @@ import org.apache.commons.rng.core.RandomProviderDefaultState; * new API} as it defines a "post-processing" of the output of a * uniform RNG in order to follow a different distribution. * - *

        + *
      * * @since 4.0 * diff --git a/src/main/java/org/apache/commons/math4/special/BesselJ.java b/src/main/java/org/apache/commons/math4/special/BesselJ.java index ff821619b..b677939b5 100644 --- a/src/main/java/org/apache/commons/math4/special/BesselJ.java +++ b/src/main/java/org/apache/commons/math4/special/BesselJ.java @@ -50,7 +50,7 @@ import org.apache.commons.math4.util.MathArrays; * D. J., Math. Comp. 26, 1972, pp 941-947. *
    23. "Bessel Functions of Real Argument and Integer Order," Sookne, D. J., NBS * Jour. of Res. B. 77B, 1973, pp 125-132.
    24. - *

      + * * @since 3.4 */ public class BesselJ @@ -176,8 +176,7 @@ public class BesselJ * {@link #getVals()} returns the computed function values. * {@link #getnVals()} is the number of values among those returned by {@link #getnVals()} * that can be considered accurate. - *

      - *

        + *

          *
        • nVals < 0: An argument is out of range. For example, nb <= 0, alpha * < 0 or > 1, or x is too large. In this case, b(0) is set to zero, the * remainder of the b-vector is not calculated, and nVals is set to @@ -188,7 +187,7 @@ public class BesselJ * precision is lost for nVals < n <= nb. If b(n) does not vanish for n > * nVals (because it is too small to be represented), and b(n)/b(nVals) = * \(10^{-k}\), then only the first NSIG-k significant figures of b(n) can be - * trusted.

        + * trusted.
      */ public static class BesselJResult { diff --git a/src/main/java/org/apache/commons/math4/special/Erf.java b/src/main/java/org/apache/commons/math4/special/Erf.java index 987223017..c0c4ce077 100644 --- a/src/main/java/org/apache/commons/math4/special/Erf.java +++ b/src/main/java/org/apache/commons/math4/special/Erf.java @@ -29,10 +29,10 @@ public class Erf { * The number {@code X_CRIT} is used by {@link #erf(double, double)} internally. * This number solves {@code erf(x)=0.5} within 1ulp. * More precisely, the current implementations of - * {@link #erf(double)} and {@link #erfc(double)} satisfy:
      - * {@code erf(X_CRIT) < 0.5},
      - * {@code erf(Math.nextUp(X_CRIT) > 0.5},
      - * {@code erfc(X_CRIT) = 0.5}, and
      + * {@link #erf(double)} and {@link #erfc(double)} satisfy:
      + * {@code erf(X_CRIT) < 0.5},
      + * {@code erf(Math.nextUp(X_CRIT) > 0.5},
      + * {@code erfc(X_CRIT) = 0.5}, and
      * {@code erfc(Math.nextUp(X_CRIT) < 0.5} */ private static final double X_CRIT = 0.4769362762044697; @@ -74,7 +74,7 @@ public class Erf { * Returns the complementary error function. * *

      erfc(x) = 2/√π x e-t2dt - *
      + *
      * = 1 - {@link #erf(double) erf(x)}

      * *

      This implementation computes erfc(x) using the diff --git a/src/main/java/org/apache/commons/math4/stat/Frequency.java b/src/main/java/org/apache/commons/math4/stat/Frequency.java index f6767200b..dfcca5ad2 100644 --- a/src/main/java/org/apache/commons/math4/stat/Frequency.java +++ b/src/main/java/org/apache/commons/math4/stat/Frequency.java @@ -56,7 +56,7 @@ import org.apache.commons.math4.util.MathUtils; * Since they are not Comparable with each other the user must do any necessary coercion. * Float.NaN and Double.NaN are not treated specially; they may occur in input and will * occur in output if appropriate. - * + *

      *

      * The values are ordered using the default (natural order), unless a * Comparator is supplied in the constructor.

      diff --git a/src/main/java/org/apache/commons/math4/stat/StatUtils.java b/src/main/java/org/apache/commons/math4/stat/StatUtils.java index a6813cea9..d267bce92 100644 --- a/src/main/java/org/apache/commons/math4/stat/StatUtils.java +++ b/src/main/java/org/apache/commons/math4/stat/StatUtils.java @@ -520,7 +520,6 @@ public final class StatUtils { * Double.NaN if the array is empty. *

      * Throws MathIllegalArgumentException if the array is null. - *

      *

        *
      • The result is NaN iff all values are NaN * (i.e. NaN values have no impact on the value of the statistic).
      • @@ -542,7 +541,6 @@ public final class StatUtils { *

        * Throws MathIllegalArgumentException if the array is null or * the array index parameters are not valid. - *

        *

          *
        • The result is NaN iff all values are NaN * (i.e. NaN values have no impact on the value of the statistic).
        • @@ -567,7 +565,6 @@ public final class StatUtils { * Double.NaN if the array is empty. *

          * Throws MathIllegalArgumentException if the array is null. - *

          *

            *
          • The result is NaN iff all values are NaN * (i.e. NaN values have no impact on the value of the statistic).
          • @@ -589,7 +586,6 @@ public final class StatUtils { *

            * Throws MathIllegalArgumentException if the array is null or * the array index parameters are not valid. - *

            *

              *
            • The result is NaN iff all values are NaN * (i.e. NaN values have no impact on the value of the statistic).
            • @@ -612,7 +608,6 @@ public final class StatUtils { /** * Returns an estimate of the pth percentile of the values * in the values array. - *

              *

                *
              • Returns Double.NaN if values has length * 0
              • @@ -640,7 +635,6 @@ public final class StatUtils { * in the values array, starting with the element in (0-based) * position begin in the array and including length * values. - *

                *

                  *
                • Returns Double.NaN if length = 0
                • *
                • Returns (for any value of p) values[begin] diff --git a/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java b/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java index 32ed6d01f..1fdb155a3 100644 --- a/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java +++ b/src/main/java/org/apache/commons/math4/stat/correlation/KendallsCorrelation.java @@ -27,7 +27,7 @@ import org.apache.commons.math4.util.FastMath; import org.apache.commons.math4.util.Pair; /** - * Implementation of Kendall's Tau-b rank correlation. + * Implementation of Kendall's Tau-b rank correlation. *

                  * A pair of observations (x1, y1) and * (x2, y2) are considered concordant if @@ -40,9 +40,9 @@ import org.apache.commons.math4.util.Pair; * discordant. *

                  * Kendall's Tau-b is defined as: - *

                  + * 
                  * taub = (nc - nd) / sqrt((n0 - n1) * (n0 - n2)) - *
                  + * *

                  * where: *

                    diff --git a/src/main/java/org/apache/commons/math4/stat/correlation/PearsonsCorrelation.java b/src/main/java/org/apache/commons/math4/stat/correlation/PearsonsCorrelation.java index 605975299..b14f8a624 100644 --- a/src/main/java/org/apache/commons/math4/stat/correlation/PearsonsCorrelation.java +++ b/src/main/java/org/apache/commons/math4/stat/correlation/PearsonsCorrelation.java @@ -144,11 +144,11 @@ public class PearsonsCorrelation { /** * Returns a matrix of standard errors associated with the estimates - * in the correlation matrix.
                    + * in the correlation matrix.
                    * getCorrelationStandardErrors().getEntry(i,j) is the standard * error associated with getCorrelationMatrix.getEntry(i,j) * - *

                    The formula used to compute the standard error is
                    + *

                    The formula used to compute the standard error is
                    * SEr = ((1 - r2) / (n - 2))1/2 * where r is the estimated correlation coefficient and * n is the number of observations in the source dataset.

                    @@ -288,9 +288,9 @@ public class PearsonsCorrelation { /** * Derives a correlation matrix from a covariance matrix. * - *

                    Uses the formula
                    + *

                    Uses the formula
                    * r(X,Y) = cov(X,Y)/s(X)s(Y) where - * r(·,·) is the correlation coefficient and + * r(·,·) is the correlation coefficient and * s(·) means standard deviation.

                    * * @param covarianceMatrix the covariance matrix diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java b/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java index 99e02cccd..8ae7d7ac5 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java @@ -435,7 +435,7 @@ public class DescriptiveStatistics implements StatisticalSummary, Serializable { * MathIllegalArgumentException is thrown) *
                  • at least one value must be stored (returns Double.NaN * otherwise)
                  • - *

                  + *
                * * @param p the requested percentile (scaled from 0 - 100) * @return An estimate for the pth percentile of the stored data diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/MultivariateSummaryStatistics.java b/src/main/java/org/apache/commons/math4/stat/descriptive/MultivariateSummaryStatistics.java index a161fc8eb..5248b5c01 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/MultivariateSummaryStatistics.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/MultivariateSummaryStatistics.java @@ -453,7 +453,7 @@ public class MultivariateSummaryStatistics * @throws DimensionMismatchException if the array dimension * does not match the one used at construction * @throws MathIllegalStateException if data has already been added - * (i.e if n > 0) + * (i.e if n > 0) */ public void setSumImpl(StorelessUnivariateStatistic[] sumImpl) throws MathIllegalStateException, DimensionMismatchException { @@ -480,7 +480,7 @@ public class MultivariateSummaryStatistics * @throws DimensionMismatchException if the array dimension * does not match the one used at construction * @throws MathIllegalStateException if data has already been added - * (i.e if n > 0) + * (i.e if n > 0) */ public void setSumsqImpl(StorelessUnivariateStatistic[] sumsqImpl) throws MathIllegalStateException, DimensionMismatchException { @@ -507,7 +507,7 @@ public class MultivariateSummaryStatistics * @throws DimensionMismatchException if the array dimension * does not match the one used at construction * @throws MathIllegalStateException if data has already been added - * (i.e if n > 0) + * (i.e if n > 0) */ public void setMinImpl(StorelessUnivariateStatistic[] minImpl) throws MathIllegalStateException, DimensionMismatchException { @@ -534,7 +534,7 @@ public class MultivariateSummaryStatistics * @throws DimensionMismatchException if the array dimension * does not match the one used at construction * @throws MathIllegalStateException if data has already been added - * (i.e if n > 0) + * (i.e if n > 0) */ public void setMaxImpl(StorelessUnivariateStatistic[] maxImpl) throws MathIllegalStateException, DimensionMismatchException{ @@ -561,7 +561,7 @@ public class MultivariateSummaryStatistics * @throws DimensionMismatchException if the array dimension * does not match the one used at construction * @throws MathIllegalStateException if data has already been added - * (i.e if n > 0) + * (i.e if n > 0) */ public void setSumLogImpl(StorelessUnivariateStatistic[] sumLogImpl) throws MathIllegalStateException, DimensionMismatchException{ @@ -588,7 +588,7 @@ public class MultivariateSummaryStatistics * @throws DimensionMismatchException if the array dimension * does not match the one used at construction * @throws MathIllegalStateException if data has already been added - * (i.e if n > 0) + * (i.e if n > 0) */ public void setGeoMeanImpl(StorelessUnivariateStatistic[] geoMeanImpl) throws MathIllegalStateException, DimensionMismatchException { @@ -615,7 +615,7 @@ public class MultivariateSummaryStatistics * @throws DimensionMismatchException if the array dimension * does not match the one used at construction * @throws MathIllegalStateException if data has already been added - * (i.e if n > 0) + * (i.e if n > 0) */ public void setMeanImpl(StorelessUnivariateStatistic[] meanImpl) throws MathIllegalStateException, DimensionMismatchException{ diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/SummaryStatistics.java b/src/main/java/org/apache/commons/math4/stat/descriptive/SummaryStatistics.java index 91f77fb63..9ab88c174 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/SummaryStatistics.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/SummaryStatistics.java @@ -446,7 +446,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable { *

                * @param sumImpl the StorelessUnivariateStatistic instance to use for * computing the Sum - * @throws MathIllegalStateException if data has already been added (i.e if n >0) + * @throws MathIllegalStateException if data has already been added (i.e if n >0) * @since 1.2 */ public void setSumImpl(StorelessUnivariateStatistic sumImpl) @@ -476,7 +476,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable { *

                * @param sumsqImpl the StorelessUnivariateStatistic instance to use for * computing the sum of squares - * @throws MathIllegalStateException if data has already been added (i.e if n > 0) + * @throws MathIllegalStateException if data has already been added (i.e if n > 0) * @since 1.2 */ public void setSumsqImpl(StorelessUnivariateStatistic sumsqImpl) @@ -506,7 +506,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable { *

                * @param minImpl the StorelessUnivariateStatistic instance to use for * computing the minimum - * @throws MathIllegalStateException if data has already been added (i.e if n > 0) + * @throws MathIllegalStateException if data has already been added (i.e if n > 0) * @since 1.2 */ public void setMinImpl(StorelessUnivariateStatistic minImpl) @@ -536,7 +536,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable { *

                * @param maxImpl the StorelessUnivariateStatistic instance to use for * computing the maximum - * @throws MathIllegalStateException if data has already been added (i.e if n > 0) + * @throws MathIllegalStateException if data has already been added (i.e if n > 0) * @since 1.2 */ public void setMaxImpl(StorelessUnivariateStatistic maxImpl) @@ -566,7 +566,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable { *

                * @param sumLogImpl the StorelessUnivariateStatistic instance to use for * computing the log sum - * @throws MathIllegalStateException if data has already been added (i.e if n > 0) + * @throws MathIllegalStateException if data has already been added (i.e if n > 0) * @since 1.2 */ public void setSumLogImpl(StorelessUnivariateStatistic sumLogImpl) @@ -597,7 +597,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable { *

                * @param geoMeanImpl the StorelessUnivariateStatistic instance to use for * computing the geometric mean - * @throws MathIllegalStateException if data has already been added (i.e if n > 0) + * @throws MathIllegalStateException if data has already been added (i.e if n > 0) * @since 1.2 */ public void setGeoMeanImpl(StorelessUnivariateStatistic geoMeanImpl) @@ -627,7 +627,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable { *

                * @param meanImpl the StorelessUnivariateStatistic instance to use for * computing the mean - * @throws MathIllegalStateException if data has already been added (i.e if n > 0) + * @throws MathIllegalStateException if data has already been added (i.e if n > 0) * @since 1.2 */ public void setMeanImpl(StorelessUnivariateStatistic meanImpl) @@ -657,7 +657,7 @@ public class SummaryStatistics implements StatisticalSummary, Serializable { *

                * @param varianceImpl the StorelessUnivariateStatistic instance to use for * computing the variance - * @throws MathIllegalStateException if data has already been added (i.e if n > 0) + * @throws MathIllegalStateException if data has already been added (i.e if n > 0) * @since 1.2 */ public void setVarianceImpl(StorelessUnivariateStatistic varianceImpl) diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/FirstMoment.java b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/FirstMoment.java index 50b107f59..e02a7cb80 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/FirstMoment.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/FirstMoment.java @@ -31,12 +31,11 @@ import org.apache.commons.math4.util.MathUtils; *

                * To limit numeric errors, the value of the statistic is computed using the * following recursive updating algorithm:

                - *

                *

                  *
                1. Initialize m = the first value
                2. *
                3. For each additional value, update using
                  * m = m + (new value - m) / (number of observations)
                4. - *

                + * *

                * Returns Double.NaN if the dataset is empty. Note that * Double.NaN may also be returned if the input includes NaN and / or infinite diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/GeometricMean.java b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/GeometricMean.java index 938930b52..aaeffe640 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/GeometricMean.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/GeometricMean.java @@ -42,7 +42,7 @@ import org.apache.commons.math4.util.MathUtils; *

              • If both Double.POSITIVE_INFINITY and * Double.NEGATIVE_INFINITY are among the values, the result is * NaN.
              • - *

              + *
            *

            * Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least @@ -162,7 +162,7 @@ public class GeometricMean extends AbstractStorelessUnivariateStatistic implemen * @param sumLogImpl the StorelessUnivariateStatistic instance to use * for computing the log sum * @throws MathIllegalStateException if data has already been added - * (i.e if n > 0) + * (i.e if n > 0) */ public void setSumLogImpl(StorelessUnivariateStatistic sumLogImpl) throws MathIllegalStateException { diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Mean.java b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Mean.java index 4a23b0eb3..250303974 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Mean.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Mean.java @@ -199,7 +199,7 @@ public class Mean extends AbstractStorelessUnivariateStatistic *

          • the weights array contains one or more NaN values
          • *
          • the weights array contains negative values
          • *
          • the start and length arguments do not determine a valid array
          • - *

          + *
        * * @param values the input array * @param weights the weights array @@ -245,7 +245,7 @@ public class Mean extends AbstractStorelessUnivariateStatistic *
      • the weights array contains one or more infinite values
      • *
      • the weights array contains one or more NaN values
      • *
      • the weights array contains negative values
      • - *

      + * * * @param values the input array * @param weights the weights array diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/SecondMoment.java b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/SecondMoment.java index 6cab87548..878ebe4e4 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/SecondMoment.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/SecondMoment.java @@ -31,7 +31,7 @@ import org.apache.commons.math4.util.MathUtils; *
    25. dev = (current obs - previous mean)
    26. *
    27. n = number of observations (including current obs)
    28. * - * Then

      + * Then *

      * new value = old value + dev^2 * (n -1) / n.

      *

      diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/SemiVariance.java b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/SemiVariance.java index 2c8f840a9..b1427b872 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/SemiVariance.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/SemiVariance.java @@ -28,8 +28,8 @@ import org.apache.commons.math4.util.MathUtils; /** *

      Computes the semivariance of a set of values with respect to a given cutoff value. * We define the downside semivariance of a set of values x - * against the cutoff value cutoff to be
      - * Σ (x[i] - target)2 / df
      + * against the cutoff value cutoff to be
      + * Σ (x[i] - target)2 / df
      * where the sum is taken over all i such that x[i] < cutoff * and df is the length of x (non-bias-corrected) or * one less than this number (bias corrected). The upside semivariance diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Variance.java b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Variance.java index d88f95280..7ed06bc69 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Variance.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Variance.java @@ -52,7 +52,7 @@ import org.apache.commons.math4.util.MathUtils; * incrementAll and then executing getResult will * sometimes give a different, less accurate, result than executing * evaluate with the full array of values. The former approach - * should only be used when the full array of values is not available.

      + * should only be used when the full array of values is not available. *

      * The "population variance" ( sum((x_i - mean)^2) / n ) can also * be computed using this statistic. The isBiasCorrected @@ -299,7 +299,7 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se *

    29. the weights array contains one or more NaN values
    30. *
    31. the weights array contains negative values
    32. *
    33. the start and length arguments do not determine a valid array
    34. - *

      + * *

      * Does not change the internal state of the statistic.

      *

      @@ -335,10 +335,10 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se *

      * Returns the weighted variance of the entries in the the input array.

      *

      - * Uses the formula

      +     * Uses the formula 
      * Σ(weights[i]*(values[i] - weightedMean)2)/(Σ(weights[i]) - 1) - *
      - * where weightedMean is the weighted mean

      + *
      + * where weightedMean is the weighted mean *

      * This formula will not return the same result as the unweighted variance when all * weights are equal, unless all weights are equal to 1. The formula assumes that @@ -357,7 +357,7 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se *

    35. the weights array contains one or more infinite values
    36. *
    37. the weights array contains one or more NaN values
    38. *
    39. the weights array contains negative values
    40. - *

      + * *

      * Does not change the internal state of the statistic.

      *

      @@ -463,9 +463,9 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se * the input array, using the precomputed weighted mean value. Returns * Double.NaN if the designated subarray is empty. *

      - * Uses the formula

      +     * Uses the formula 
      * Σ(weights[i]*(values[i] - mean)2)/(Σ(weights[i]) - 1) - *

      + * *

      * The formula used assumes that the supplied mean value is the weighted arithmetic * mean of the sample data, not a known population parameter. This method @@ -490,7 +490,7 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se *

    41. the weights array contains one or more NaN values
    42. *
    43. the weights array contains negative values
    44. *
    45. the start and length arguments do not determine a valid array
    46. - *

      + * *

      * Does not change the internal state of the statistic.

      * @@ -541,9 +541,9 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se *

      Returns the weighted variance of the values in the input array, using * the precomputed weighted mean value.

      *

      - * Uses the formula

      +     * Uses the formula 
      * Σ(weights[i]*(values[i] - mean)2)/(Σ(weights[i]) - 1) - *

      + * *

      * The formula used assumes that the supplied mean value is the weighted arithmetic * mean of the sample data, not a known population parameter. This method @@ -567,7 +567,7 @@ public class Variance extends AbstractStorelessUnivariateStatistic implements Se *

    47. the weights array contains one or more infinite values
    48. *
    49. the weights array contains one or more NaN values
    50. *
    51. the weights array contains negative values
    52. - *

      + * *

      * Does not change the internal state of the statistic.

      * diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/package-info.java b/src/main/java/org/apache/commons/math4/stat/descriptive/package-info.java index dd73f9911..37397a4e7 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/package-info.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/package-info.java @@ -21,22 +21,22 @@ *

      UnivariateStatistic API Usage Examples:

      * *

      UnivariateStatistic:

      - * /∗ evaluation approach ∗/
      - * double[] values = new double[] { 1, 2, 3, 4, 5 };
      - * UnivariateStatistic stat = new Mean();
      - * out.println("mean = " + stat.evaluate(values));
      + * /∗ evaluation approach ∗/
      + * double[] values = new double[] { 1, 2, 3, 4, 5 };
      + * UnivariateStatistic stat = new Mean();
      + * out.println("mean = " + stat.evaluate(values));
      *
      * *

      StorelessUnivariateStatistic:

      - * /∗ incremental approach ∗/
      - * double[] values = new double[] { 1, 2, 3, 4, 5 };
      - * StorelessUnivariateStatistic stat = new Mean();
      - * out.println("mean before adding a value is NaN = " + stat.getResult());
      - * for (int i = 0; i < values.length; i++) {
      - *     stat.increment(values[i]);
      - *     out.println("current mean = " + stat2.getResult());
      - * }
      - * stat.clear();
      + * /∗ incremental approach ∗/
      + * double[] values = new double[] { 1, 2, 3, 4, 5 };
      + * StorelessUnivariateStatistic stat = new Mean();
      + * out.println("mean before adding a value is NaN = " + stat.getResult());
      + * for (int i = 0; i < values.length; i++) {
      + *     stat.increment(values[i]);
      + *     out.println("current mean = " + stat2.getResult());
      + * }
      + * stat.clear();
      * out.println("mean after clear is NaN = " + stat.getResult()); *
      * diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Max.java b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Max.java index 502d2d413..1615003b5 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Max.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Max.java @@ -26,13 +26,12 @@ import org.apache.commons.math4.util.MathUtils; /** * Returns the maximum of the available values. - *

      *

        *
      • The result is NaN iff all values are NaN * (i.e. NaN values have no impact on the value of the statistic).
      • *
      • If any of the values equals Double.POSITIVE_INFINITY, * the result is Double.POSITIVE_INFINITY.
      • - *

      + * *

      * Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least @@ -112,13 +111,12 @@ public class Max extends AbstractStorelessUnivariateStatistic implements Seriali *

      * Throws MathIllegalArgumentException if the array is null or * the array index parameters are not valid.

      - *

      *

        *
      • The result is NaN iff all values are NaN * (i.e. NaN values have no impact on the value of the statistic).
      • *
      • If any of the values equals Double.POSITIVE_INFINITY, * the result is Double.POSITIVE_INFINITY.
      • - *

      + * * * @param values the input array * @param begin index of the first array element to include diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Min.java b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Min.java index 72eaef448..479a1f761 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Min.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Min.java @@ -26,13 +26,12 @@ import org.apache.commons.math4.util.MathUtils; /** * Returns the minimum of the available values. - *

      *

        *
      • The result is NaN iff all values are NaN * (i.e. NaN values have no impact on the value of the statistic).
      • *
      • If any of the values equals Double.NEGATIVE_INFINITY, * the result is Double.NEGATIVE_INFINITY.
      • - *

      + * *

      * Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least @@ -112,13 +111,12 @@ public class Min extends AbstractStorelessUnivariateStatistic implements Seriali *

      * Throws MathIllegalArgumentException if the array is null or * the array index parameters are not valid.

      - *

      *

        *
      • The result is NaN iff all values are NaN * (i.e. NaN values have no impact on the value of the statistic).
      • *
      • If any of the values equals Double.NEGATIVE_INFINITY, * the result is Double.NEGATIVE_INFINITY.
      • - *

      + * * * @param values the input array * @param begin index of the first array element to include diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java index 7f3e54d7f..b6bdce5c4 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentile.java @@ -41,7 +41,7 @@ import org.apache.commons.numbers.core.Precision; /** * A {@link StorelessUnivariateStatistic} estimating percentiles using the - * P2 + * P2 * Algorithm as explained by Raj * Jain and Imrich Chlamtac in * P2 Algorithm diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java index a85fb63b1..c05d78202 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/rank/Percentile.java @@ -43,20 +43,20 @@ import org.apache.commons.numbers.core.Precision; * significantly different results. The algorithm implemented here works as follows: *
        *
      1. Let n be the length of the (sorted) array and - * 0 < p <= 100 be the desired percentile.
      2. + * 0 < p <= 100 be the desired percentile. *
      3. If n = 1 return the unique array element (regardless of * the value of p); otherwise
      4. *
      5. Compute the estimated percentile position * pos = p * (n + 1) / 100 and the difference, d * between pos and floor(pos) (i.e. the fractional * part of pos).
      6. - *
      7. If pos < 1 return the smallest element in the array.
      8. - *
      9. Else if pos >= n return the largest element in the array.
      10. + *
      11. If pos < 1 return the smallest element in the array.
      12. + *
      13. Else if pos >= n return the largest element in the array.
      14. *
      15. Else let lower be the element in position * floor(pos) in the array and let upper be the * next element in the array. Return lower + d * (upper - lower) *
      16. - *

      + * *

      * To compute percentiles, the data must be at least partially ordered. Input * arrays are copied and recursively partitioned using an ordering definition. @@ -247,7 +247,6 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa *

      * Calls to this method do not modify the internal quantile * state of this statistic.

      - *

      *

        *
      • Returns Double.NaN if values has length * 0
      • @@ -256,7 +255,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa *
      • Throws MathIllegalArgumentException if values * is null or p is not a valid quantile value (p must be greater than 0 * and less than or equal to 100)
      • - *

      + * *

      * See {@link Percentile} for a description of the percentile estimation * algorithm used.

      @@ -277,14 +276,13 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa * Returns an estimate of the quantileth percentile of the * designated values in the values array. The quantile * estimated is determined by the quantile property. - *

      *

        *
      • Returns Double.NaN if length = 0
      • *
      • Returns (for any value of quantile) * values[begin] if length = 1
      • *
      • Throws MathIllegalArgumentException if values * is null, or start or length is invalid
      • - *

      + * *

      * See {@link Percentile} for a description of the percentile estimation * algorithm used.

      @@ -310,7 +308,6 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa *

      * Calls to this method do not modify the internal quantile * state of this statistic.

      - *

      *

        *
      • Returns Double.NaN if length = 0
      • *
      • Returns (for any value of p) values[begin] @@ -319,7 +316,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa * is null , begin or length is invalid, or * p is not a valid quantile value (p must be greater than 0 * and less than or equal to 100)
      • - *

      + * *

      * See {@link Percentile} for a description of the percentile estimation * algorithm used.

      @@ -367,7 +364,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa * Sets the value of the quantile field (determines what percentile is * computed when evaluate() is called with no quantile argument). * - * @param p a value between 0 < p <= 100 + * @param p a value between 0 < p <= 100 * @throws MathIllegalArgumentException if p is not greater than 0 and less * than or equal to 100 */ diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Product.java b/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Product.java index 5be6ce9b2..58609f883 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Product.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Product.java @@ -144,7 +144,7 @@ public class Product extends AbstractStorelessUnivariateStatistic implements Ser *
    53. the weights array contains one or more NaN values
    54. *
    55. the weights array contains negative values
    56. *
    57. the start and length arguments do not determine a valid array
    58. - *

      + * * *

      Uses the formula,

            *    weighted product = ∏values[i]weights[i]
      @@ -182,7 +182,7 @@ public class Product extends AbstractStorelessUnivariateStatistic implements Ser
            *     
    59. the weights array contains one or more infinite values
    60. *
    61. the weights array contains one or more NaN values
    62. *
    63. the weights array contains negative values
    64. - *

      + * * *

      Uses the formula, *

      diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Sum.java b/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Sum.java
      index bbe29fa8b..e112b5e0f 100644
      --- a/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Sum.java
      +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/summary/Sum.java
      @@ -143,11 +143,11 @@ public class Sum extends AbstractStorelessUnivariateStatistic implements Seriali
            *     
    65. the weights array contains one or more NaN values
    66. *
    67. the weights array contains negative values
    68. *
    69. the start and length arguments do not determine a valid array
    70. - *

      + * *

      * Uses the formula,

            *    weighted sum = Σ(values[i] * weights[i])
      -     * 

      + *
      * * @param values the input array * @param weights the weights array @@ -179,11 +179,11 @@ public class Sum extends AbstractStorelessUnivariateStatistic implements Seriali *
    71. the weights array contains one or more infinite values
    72. *
    73. the weights array contains one or more NaN values
    74. *
    75. the weights array contains negative values
    76. - *

      + * *

      * Uses the formula,

            *    weighted sum = Σ(values[i] * weights[i])
      -     * 

      + *
      * * @param values the input array * @param weights the weights array diff --git a/src/main/java/org/apache/commons/math4/stat/descriptive/summary/SumOfLogs.java b/src/main/java/org/apache/commons/math4/stat/descriptive/summary/SumOfLogs.java index fcb00b9b8..75e7547b1 100644 --- a/src/main/java/org/apache/commons/math4/stat/descriptive/summary/SumOfLogs.java +++ b/src/main/java/org/apache/commons/math4/stat/descriptive/summary/SumOfLogs.java @@ -38,7 +38,7 @@ import org.apache.commons.math4.util.MathUtils; *
    77. If both Double.POSITIVE_INFINITY and * Double.NEGATIVE_INFINITY are among the values, the result is * NaN.
    78. - *

      + * *

      * Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least diff --git a/src/main/java/org/apache/commons/math4/stat/inference/BinomialTest.java b/src/main/java/org/apache/commons/math4/stat/inference/BinomialTest.java index d5003117c..2846c6819 100644 --- a/src/main/java/org/apache/commons/math4/stat/inference/BinomialTest.java +++ b/src/main/java/org/apache/commons/math4/stat/inference/BinomialTest.java @@ -86,7 +86,7 @@ public class BinomialTest { *

    79. Number of successes must be ≥ 0.
    80. *
    81. Number of successes must be ≤ number of trials.
    82. *
    83. Probability must be ≥ 0 and ≤ 1.
    84. - *

      + * * * @param numberOfTrials number of trials performed * @param numberOfSuccesses number of successes observed diff --git a/src/main/java/org/apache/commons/math4/stat/inference/ChiSquareTest.java b/src/main/java/org/apache/commons/math4/stat/inference/ChiSquareTest.java index add6c01ce..383606400 100644 --- a/src/main/java/org/apache/commons/math4/stat/inference/ChiSquareTest.java +++ b/src/main/java/org/apache/commons/math4/stat/inference/ChiSquareTest.java @@ -62,7 +62,7 @@ public class ChiSquareTest { * *
    85. The observed and expected arrays must have the same length and * their common length must be at least 2. - *
    86. + *

      * If any of the preconditions are not met, an * IllegalArgumentException is thrown.

      *

      Note: This implementation rescales the @@ -135,7 +135,7 @@ public class ChiSquareTest { * *

    87. The observed and expected arrays must have the same length and * their common length must be at least 2. - *
    88. + *

      * If any of the preconditions are not met, an * IllegalArgumentException is thrown.

      *

      Note: This implementation rescales the @@ -181,7 +181,7 @@ public class ChiSquareTest { *

    89. The observed and expected arrays must have the same length and * their common length must be at least 2. *
    90. 0 < alpha < 0.5 - *
    91. + *

      * If any of the preconditions are not met, an * IllegalArgumentException is thrown.

      *

      Note: This implementation rescales the @@ -231,7 +231,7 @@ public class ChiSquareTest { *

    92. The 2-way table represented by counts must have at * least 2 columns and at least 2 rows. *
    93. - *

      + *

      * If any of the preconditions are not met, an * IllegalArgumentException is thrown.

      * @@ -295,7 +295,7 @@ public class ChiSquareTest { *
    94. The 2-way table represented by counts must have at least 2 * columns and at least 2 rows. *
    95. - *

      + *

      * If any of the preconditions are not met, an * IllegalArgumentException is thrown.

      * @@ -342,7 +342,7 @@ public class ChiSquareTest { * same length). *
    96. The 2-way table represented by counts must have at least 2 columns and * at least 2 rows.
    97. - *

      + *

      * If any of the preconditions are not met, an * IllegalArgumentException is thrown.

      * @@ -378,8 +378,8 @@ public class ChiSquareTest { * * ∑[(K * observed1[i] - observed2[i]/K)2 / (observed1[i] + observed2[i])] * where - *
      K = &sqrt;[&sum(observed2 / ∑(observed1)] - *

      + *
      K = √[∑(observed2 / ∑(observed1)] + * *

      This statistic can be used to perform a Chi-Square test evaluating the * null hypothesis that both observed counts follow the same distribution.

      *

      @@ -392,7 +392,7 @@ public class ChiSquareTest { * *

    98. The arrays observed1 and observed2 must have * the same length and their common length must be at least 2. - *
    99. + *

      * If any of the preconditions are not met, an * IllegalArgumentException is thrown.

      * @@ -538,7 +538,7 @@ public class ChiSquareTest { *
    100. The arrays observed1 and observed2 must * have the same length and their common length must be at least 2. *
    101. - *
    102. 0 < alpha < 0.5 + *
    103. 0 < alpha < 0.5 *
    104. * If any of the preconditions are not met, an * IllegalArgumentException is thrown.

      diff --git a/src/main/java/org/apache/commons/math4/stat/inference/GTest.java b/src/main/java/org/apache/commons/math4/stat/inference/GTest.java index 0ee009d29..0da20436a 100644 --- a/src/main/java/org/apache/commons/math4/stat/inference/GTest.java +++ b/src/main/java/org/apache/commons/math4/stat/inference/GTest.java @@ -55,7 +55,7 @@ public class GTest { *
    105. Expected counts must all be positive.
    106. *
    107. Observed counts must all be ≥ 0.
    108. *
    109. The observed and expected arrays must have the same length and their - * common length must be at least 2.
    110. + * common length must be at least 2. * *

      If any of the preconditions are not met, a * {@code MathIllegalArgumentException} is thrown.

      @@ -111,7 +111,7 @@ public class GTest { /** * Returns the observed significance level, or
      p-value, - * associated with a G-Test for goodness of fit comparing the + * associated with a G-Test for goodness of fit comparing the * {@code observed} frequency counts to those in the {@code expected} array. * *

      The number returned is the smallest significance level at which one @@ -128,7 +128,7 @@ public class GTest { *

    111. Observed counts must all be ≥ 0.
    112. *
    113. The observed and expected arrays must have the * same length and their common length must be at least 2.
    114. - *

      + * * *

      If any of the preconditions are not met, a * {@code MathIllegalArgumentException} is thrown.

      @@ -202,14 +202,14 @@ public class GTest { * {@code gTest(expected, observed, 0.01)}

      * *

      Returns true iff {@link #gTest(double[], long[]) - * gTestGoodnessOfFitPValue(expected, observed)} < alpha

      + * gTestGoodnessOfFitPValue(expected, observed)} < alpha

      * *

      Preconditions:

        *
      • Expected counts must all be positive.
      • *
      • Observed counts must all be ≥ 0.
      • *
      • The observed and expected arrays must have the same length and their * common length must be at least 2. - *
      • {@code 0 < alpha < 0.5}

      + *
    115. {@code 0 < alpha < 0.5}
    116. * *

      If any of the preconditions are not met, a * {@code MathIllegalArgumentException} is thrown.

      @@ -279,8 +279,8 @@ public class GTest { /** * Calculates the * Shannon entropy for a vector. The values of {@code k} are taken to be - * incidence counts of the values of a random variable. What is returned is
      - * ∑pilog(pi
      + * incidence counts of the values of a random variable. What is returned is
      + * ∑pilog(pi
      * where pi = k[i] / (sum of elements in k) * * @param k Vector (for ex. Row Sums of a trials) @@ -314,8 +314,8 @@ public class GTest { *

      where {@code H} is the * * Shannon Entropy of the random variable formed by viewing the elements - * of the argument array as incidence counts;
      - * {@code k} is a matrix with rows {@code [observed1, observed2]};
      + * of the argument array as incidence counts;
      + * {@code k} is a matrix with rows {@code [observed1, observed2]};
      * {@code rowSums, colSums} are the row/col sums of {@code k};
      * and {@code totalSum} is the overall sum of all entries in {@code k}.

      * @@ -327,7 +327,7 @@ public class GTest { *
    117. Observed counts for a specific bin must not both be zero.
    118. *
    119. Observed counts for a specific sample must not all be 0.
    120. *
    121. The arrays {@code observed1} and {@code observed2} must have - * the same length and their common length must be at least 2.
    122. + * the same length and their common length must be at least 2. * *

      If any of the preconditions are not met, a * {@code MathIllegalArgumentException} is thrown.

      @@ -398,7 +398,7 @@ public class GTest { * *

      {@code (sgn) sqrt(gValueDataSetsComparison({k11, k12}, {k21, k22})}

      * - *

      where {@code sgn} is -1 if {@code k11 / (k11 + k12) < k21 / (k21 + k22))};
      + *

      where {@code sgn} is -1 if {@code k11 / (k11 + k12) < k21 / (k21 + k22))};
      * 1 otherwise.

      * *

      Signed root LLR has two advantages over the basic LLR: a) it is positive @@ -450,7 +450,7 @@ public class GTest { *

    123. Observed counts for a specific sample must not all be 0.
    124. *
    125. The arrays {@code observed1} and {@code observed2} must * have the same length and their common length must be at least 2.
    126. - *

      + * *

      If any of the preconditions are not met, a * {@code MathIllegalArgumentException} is thrown.

      * @@ -500,7 +500,7 @@ public class GTest { *
    127. Observed counts for a specific sample must not all be 0.
    128. *
    129. The arrays {@code observed1} and {@code observed2} must * have the same length and their common length must be at least 2.
    130. - *
    131. {@code 0 < alpha < 0.5}
    132. + *
    133. {@code 0 < alpha < 0.5}
    134. * *

      If any of the preconditions are not met, a * {@code MathIllegalArgumentException} is thrown.

      diff --git a/src/main/java/org/apache/commons/math4/stat/inference/InferenceTestUtils.java b/src/main/java/org/apache/commons/math4/stat/inference/InferenceTestUtils.java index a0da22f7c..a06e3d165 100644 --- a/src/main/java/org/apache/commons/math4/stat/inference/InferenceTestUtils.java +++ b/src/main/java/org/apache/commons/math4/stat/inference/InferenceTestUtils.java @@ -65,6 +65,9 @@ public class InferenceTestUtils { // CHECKSTYLE: stop JavadocMethodCheck /** + * @param sample1 array of sample data values + * @param sample2 array of sample data values + * @return t statistic * @see org.apache.commons.math4.stat.inference.TTest#homoscedasticT(double[], double[]) */ public static double homoscedasticT(final double[] sample1, final double[] sample2) @@ -73,6 +76,9 @@ public class InferenceTestUtils { } /** + * @param sampleStats1 StatisticalSummary describing data from the first sample + * @param sampleStats2 StatisticalSummary describing data from the second sample + * @return t statistic * @see org.apache.commons.math4.stat.inference.TTest#homoscedasticT(org.apache.commons.math4.stat.descriptive.StatisticalSummary, org.apache.commons.math4.stat.descriptive.StatisticalSummary) */ public static double homoscedasticT(final StatisticalSummary sampleStats1, @@ -82,6 +88,11 @@ public class InferenceTestUtils { } /** + * @param sample1 array of sample data values + * @param sample2 array of sample data values + * @param alpha significance level of the test + * @return true if the null hypothesis can be rejected with + * confidence 1 - alpha * @see org.apache.commons.math4.stat.inference.TTest#homoscedasticTTest(double[], double[], double) */ public static boolean homoscedasticTTest(final double[] sample1, final double[] sample2, @@ -92,6 +103,9 @@ public class InferenceTestUtils { } /** + * @param sample1 array of sample data values + * @param sample2 array of sample data values + * @return p-value for t-test * @see org.apache.commons.math4.stat.inference.TTest#homoscedasticTTest(double[], double[]) */ public static double homoscedasticTTest(final double[] sample1, final double[] sample2) @@ -100,6 +114,9 @@ public class InferenceTestUtils { } /** + * @param sampleStats1 StatisticalSummary describing data from the first sample + * @param sampleStats2 StatisticalSummary describing data from the second sample + * @return p-value for t-test * @see org.apache.commons.math4.stat.inference.TTest#homoscedasticTTest(org.apache.commons.math4.stat.descriptive.StatisticalSummary, org.apache.commons.math4.stat.descriptive.StatisticalSummary) */ public static double homoscedasticTTest(final StatisticalSummary sampleStats1, @@ -109,6 +126,9 @@ public class InferenceTestUtils { } /** + * @param sample1 array of sample data values + * @param sample2 array of sample data values + * @return t statistic * @see org.apache.commons.math4.stat.inference.TTest#pairedT(double[], double[]) */ public static double pairedT(final double[] sample1, final double[] sample2) @@ -118,6 +138,11 @@ public class InferenceTestUtils { } /** + * @param sample1 array of sample data values + * @param sample2 array of sample data values + * @param alpha significance level of the test + * @return true if the null hypothesis can be rejected with + * confidence 1 - alpha * @see org.apache.commons.math4.stat.inference.TTest#pairedTTest(double[], double[], double) */ public static boolean pairedTTest(final double[] sample1, final double[] sample2, @@ -128,6 +153,9 @@ public class InferenceTestUtils { } /** + * @param sample1 array of sample data values + * @param sample2 array of sample data values + * @return p-value for t-test * @see org.apache.commons.math4.stat.inference.TTest#pairedTTest(double[], double[]) */ public static double pairedTTest(final double[] sample1, final double[] sample2) @@ -137,6 +165,9 @@ public class InferenceTestUtils { } /** + * @param mu comparison constant + * @param observed array of values + * @return t statistic * @see org.apache.commons.math4.stat.inference.TTest#t(double, double[]) */ public static double t(final double mu, final double[] observed) @@ -145,6 +176,9 @@ public class InferenceTestUtils { } /** + * @param mu comparison constant + * @param sampleStats DescriptiveStatistics holding sample summary statitstics + * @return t statistic * @see org.apache.commons.math4.stat.inference.TTest#t(double, org.apache.commons.math4.stat.descriptive.StatisticalSummary) */ public static double t(final double mu, final StatisticalSummary sampleStats) @@ -153,6 +187,9 @@ public class InferenceTestUtils { } /** + * @param sample1 array of sample data values + * @param sample2 array of sample data values + * @return t statistic * @see org.apache.commons.math4.stat.inference.TTest#t(double[], double[]) */ public static double t(final double[] sample1, final double[] sample2) @@ -161,6 +198,9 @@ public class InferenceTestUtils { } /** + * @param sampleStats1 StatisticalSummary describing data from the first sample + * @param sampleStats2 StatisticalSummary describing data from the second sample + * @return t statistic * @see org.apache.commons.math4.stat.inference.TTest#t(org.apache.commons.math4.stat.descriptive.StatisticalSummary, org.apache.commons.math4.stat.descriptive.StatisticalSummary) */ public static double t(final StatisticalSummary sampleStats1, @@ -170,6 +210,10 @@ public class InferenceTestUtils { } /** + * @param mu constant value to compare sample mean against + * @param sample array of sample data values + * @param alpha significance level of the test + * @return p-value * @see org.apache.commons.math4.stat.inference.TTest#tTest(double, double[], double) */ public static boolean tTest(final double mu, final double[] sample, final double alpha) @@ -179,6 +223,9 @@ public class InferenceTestUtils { } /** + * @param mu constant value to compare sample mean against + * @param sample array of sample data values + * @return p-value * @see org.apache.commons.math4.stat.inference.TTest#tTest(double, double[]) */ public static double tTest(final double mu, final double[] sample) @@ -188,6 +235,10 @@ public class InferenceTestUtils { } /** + * @param mu constant value to compare sample mean against + * @param sampleStats StatisticalSummary describing sample data values + * @param alpha significance level of the test + * @return p-value * @see org.apache.commons.math4.stat.inference.TTest#tTest(double, org.apache.commons.math4.stat.descriptive.StatisticalSummary, double) */ public static boolean tTest(final double mu, final StatisticalSummary sampleStats, @@ -198,6 +249,9 @@ public class InferenceTestUtils { } /** + * @param mu constant value to compare sample mean against + * @param sampleStats StatisticalSummary describing sample data + * @return p-value * @see org.apache.commons.math4.stat.inference.TTest#tTest(double, org.apache.commons.math4.stat.descriptive.StatisticalSummary) */ public static double tTest(final double mu, final StatisticalSummary sampleStats) @@ -207,6 +261,11 @@ public class InferenceTestUtils { } /** + * @param sample1 array of sample data values + * @param sample2 array of sample data values + * @param alpha significance level of the test + * @return true if the null hypothesis can be rejected with + * confidence 1 - alpha * @see org.apache.commons.math4.stat.inference.TTest#tTest(double[], double[], double) */ public static boolean tTest(final double[] sample1, final double[] sample2, @@ -217,6 +276,9 @@ public class InferenceTestUtils { } /** + * @param sample1 array of sample data values + * @param sample2 array of sample data values + * @return p-value for t-test * @see org.apache.commons.math4.stat.inference.TTest#tTest(double[], double[]) */ public static double tTest(final double[] sample1, final double[] sample2) @@ -226,6 +288,11 @@ public class InferenceTestUtils { } /** + * @param sampleStats1 StatisticalSummary describing sample data values + * @param sampleStats2 StatisticalSummary describing sample data values + * @param alpha significance level of the test + * @return true if the null hypothesis can be rejected with + * confidence 1 - alpha * @see org.apache.commons.math4.stat.inference.TTest#tTest(org.apache.commons.math4.stat.descriptive.StatisticalSummary, org.apache.commons.math4.stat.descriptive.StatisticalSummary, double) */ public static boolean tTest(final StatisticalSummary sampleStats1, @@ -237,6 +304,9 @@ public class InferenceTestUtils { } /** + * @param sampleStats1 StatisticalSummary describing data from the first sample + * @param sampleStats2 StatisticalSummary describing data from the second sample + * @return p-value for t-test * @see org.apache.commons.math4.stat.inference.TTest#tTest(org.apache.commons.math4.stat.descriptive.StatisticalSummary, org.apache.commons.math4.stat.descriptive.StatisticalSummary) */ public static double tTest(final StatisticalSummary sampleStats1, @@ -247,7 +317,10 @@ public class InferenceTestUtils { } /** - * @see org.apache.commons.math4.stat.inference.ChiSquareTest#chiSquare(double[], long[]) + * @param observed array of observed frequency counts + * @param expected array of expected frequency counts + * @return chiSquare test statistic +* @see org.apache.commons.math4.stat.inference.ChiSquareTest#chiSquare(double[], long[]) */ public static double chiSquare(final double[] expected, final long[] observed) throws NotPositiveException, NotStrictlyPositiveException, @@ -256,6 +329,8 @@ public class InferenceTestUtils { } /** + * @param counts array representation of 2-way table + * @return chiSquare test statistic * @see org.apache.commons.math4.stat.inference.ChiSquareTest#chiSquare(long[][]) */ public static double chiSquare(final long[][] counts) @@ -265,6 +340,11 @@ public class InferenceTestUtils { } /** + * @param observed array of observed frequency counts + * @param expected array of expected frequency counts + * @param alpha significance level of the test + * @return true iff null hypothesis can be rejected with confidence + * 1 - alpha * @see org.apache.commons.math4.stat.inference.ChiSquareTest#chiSquareTest(double[], long[], double) */ public static boolean chiSquareTest(final double[] expected, final long[] observed, @@ -275,6 +355,9 @@ public class InferenceTestUtils { } /** + * @param observed array of observed frequency counts + * @param expected array of expected frequency counts + * @return p-value * @see org.apache.commons.math4.stat.inference.ChiSquareTest#chiSquareTest(double[], long[]) */ public static double chiSquareTest(final double[] expected, final long[] observed) @@ -284,6 +367,10 @@ public class InferenceTestUtils { } /** + * @param counts array representation of 2-way table + * @param alpha significance level of the test + * @return true iff null hypothesis can be rejected with confidence + * 1 - alpha * @see org.apache.commons.math4.stat.inference.ChiSquareTest#chiSquareTest(long[][], double) */ public static boolean chiSquareTest(final long[][] counts, final double alpha) @@ -293,6 +380,8 @@ public class InferenceTestUtils { } /** + * @param counts array representation of 2-way table + * @return p-value * @see org.apache.commons.math4.stat.inference.ChiSquareTest#chiSquareTest(long[][]) */ public static double chiSquareTest(final long[][] counts) @@ -302,6 +391,9 @@ public class InferenceTestUtils { } /** + * @param observed1 array of observed frequency counts of the first data set + * @param observed2 array of observed frequency counts of the second data set + * @return chiSquare test statistic * @see org.apache.commons.math4.stat.inference.ChiSquareTest#chiSquareDataSetsComparison(long[], long[]) * * @since 1.2 @@ -313,6 +405,9 @@ public class InferenceTestUtils { } /** + * @param observed1 array of observed frequency counts of the first data set + * @param observed2 array of observed frequency counts of the second data set + * @return p-value * @see org.apache.commons.math4.stat.inference.ChiSquareTest#chiSquareTestDataSetsComparison(long[], long[]) * * @since 1.2 @@ -325,6 +420,11 @@ public class InferenceTestUtils { } /** + * @param observed1 array of observed frequency counts of the first data set + * @param observed2 array of observed frequency counts of the second data set + * @param alpha significance level of the test + * @return true iff null hypothesis can be rejected with confidence + * 1 - alpha * @see org.apache.commons.math4.stat.inference.ChiSquareTest#chiSquareTestDataSetsComparison(long[], long[], double) * * @since 1.2 @@ -338,6 +438,9 @@ public class InferenceTestUtils { } /** + * @param categoryData Collection of double[] + * arrays each containing data for one category + * @return Fvalue * @see org.apache.commons.math4.stat.inference.OneWayAnova#anovaFValue(Collection) * * @since 1.2 @@ -348,6 +451,9 @@ public class InferenceTestUtils { } /** + * @param categoryData Collection of double[] + * arrays each containing data for one category + * @return Pvalue * @see org.apache.commons.math4.stat.inference.OneWayAnova#anovaPValue(Collection) * * @since 1.2 @@ -359,6 +465,11 @@ public class InferenceTestUtils { } /** + * @param categoryData Collection of double[] + * arrays each containing data for one category + * @param alpha significance level of the test + * @return true if the null hypothesis can be rejected with + * confidence 1 - alpha * @see org.apache.commons.math4.stat.inference.OneWayAnova#anovaTest(Collection,double) * * @since 1.2 @@ -371,6 +482,9 @@ public class InferenceTestUtils { } /** + * @param observed array of observed frequency counts + * @param expected array of expected frequency counts + * @return G-Test statistic * @see org.apache.commons.math4.stat.inference.GTest#g(double[], long[]) * @since 3.1 */ @@ -381,6 +495,9 @@ public class InferenceTestUtils { } /** + * @param observed array of observed frequency counts + * @param expected array of expected frequency counts + * @return p-value * @see org.apache.commons.math4.stat.inference.GTest#gTest( double[], long[] ) * @since 3.1 */ @@ -391,6 +508,9 @@ public class InferenceTestUtils { } /** + * @param observed array of observed frequency counts + * @param expected array of expected frequency counts + * @return p-value * @see org.apache.commons.math4.stat.inference.GTest#gTestIntrinsic(double[], long[] ) * @since 3.1 */ @@ -401,6 +521,11 @@ public class InferenceTestUtils { } /** + * @param observed array of observed frequency counts + * @param expected array of expected frequency counts + * @param alpha significance level of the test + * @return true iff null hypothesis can be rejected with confidence 1 - + * alpha * @see org.apache.commons.math4.stat.inference.GTest#gTest( double[],long[],double) * @since 3.1 */ @@ -412,6 +537,10 @@ public class InferenceTestUtils { } /** + * @param observed1 array of observed frequency counts of the first data set + * @param observed2 array of observed frequency counts of the second data + * set + * @return G-Test statistic * @see org.apache.commons.math4.stat.inference.GTest#gDataSetsComparison(long[], long[]) * @since 3.1 */ @@ -422,6 +551,14 @@ public class InferenceTestUtils { } /** + * @param k11 number of times the two events occurred together (AB) + * @param k12 number of times the second event occurred WITHOUT the + * first event (notA,B) + * @param k21 number of times the first event occurred WITHOUT the + * second event (A, notB) + * @param k22 number of times something else occurred (i.e. was neither + * of these events (notA, notB) + * @return root log-likelihood ratio * @see org.apache.commons.math4.stat.inference.GTest#rootLogLikelihoodRatio(long, long, long, long) * @since 3.1 */ @@ -432,6 +569,10 @@ public class InferenceTestUtils { /** + * @param observed1 array of observed frequency counts of the first data set + * @param observed2 array of observed frequency counts of the second data + * set + * @return p-value * @see org.apache.commons.math4.stat.inference.GTest#gTestDataSetsComparison(long[], long[]) * @since 3.1 */ @@ -443,6 +584,12 @@ public class InferenceTestUtils { } /** + * @param observed1 array of observed frequency counts of the first data set + * @param observed2 array of observed frequency counts of the second data + * set + * @param alpha significance level of the test + * @return true iff null hypothesis can be rejected with confidence 1 - + * alpha * @see org.apache.commons.math4.stat.inference.GTest#gTestDataSetsComparison(long[],long[],double) * @since 3.1 */ @@ -455,6 +602,9 @@ public class InferenceTestUtils { } /** + * @param dist reference distribution + * @param data sample being evaluated + * @return Kolmogorov-Smirnov statistic \(D_n\) * @see org.apache.commons.math4.stat.inference.KolmogorovSmirnovTest#kolmogorovSmirnovStatistic(RealDistribution, double[]) * @since 3.3 */ @@ -464,6 +614,10 @@ public class InferenceTestUtils { } /** + * @param dist reference distribution + * @param data sample being being evaluated + * @return the p-value associated with the null hypothesis that {@code data} is a sample from + * {@code distribution} * @see org.apache.commons.math4.stat.inference.KolmogorovSmirnovTest#kolmogorovSmirnovTest(RealDistribution, double[]) * @since 3.3 */ @@ -473,6 +627,11 @@ public class InferenceTestUtils { } /** + * @param dist reference distribution + * @param data sample being being evaluated + * @param strict whether or not to force exact computation of the p-value + * @return the p-value associated with the null hypothesis that {@code data} is a sample from + * {@code distribution} * @see org.apache.commons.math4.stat.inference.KolmogorovSmirnovTest#kolmogorovSmirnovTest(RealDistribution, double[], boolean) * @since 3.3 */ @@ -482,6 +641,11 @@ public class InferenceTestUtils { } /** + * @param dist reference distribution + * @param data sample being being evaluated + * @param alpha significance level of the test + * @return true iff the null hypothesis that {@code data} is a sample from {@code distribution} + * can be rejected with confidence 1 - {@code alpha} * @see org.apache.commons.math4.stat.inference.KolmogorovSmirnovTest#kolmogorovSmirnovTest(RealDistribution, double[], double) * @since 3.3 */ @@ -491,6 +655,10 @@ public class InferenceTestUtils { } /** + * @param x first sample + * @param y second sample + * @return test statistic \(D_{n,m}\) used to evaluate the null hypothesis that {@code x} and + * {@code y} represent samples from the same underlying distribution * @see org.apache.commons.math4.stat.inference.KolmogorovSmirnovTest#kolmogorovSmirnovStatistic(double[], double[]) * @since 3.3 */ @@ -500,6 +668,10 @@ public class InferenceTestUtils { } /** + * @param x first sample dataset + * @param y second sample dataset + * @return p-value associated with the null hypothesis that {@code x} and {@code y} represent + * samples from the same distribution * @see org.apache.commons.math4.stat.inference.KolmogorovSmirnovTest#kolmogorovSmirnovTest(double[], double[]) * @since 3.3 */ @@ -509,6 +681,12 @@ public class InferenceTestUtils { } /** + * @param x first sample dataset. + * @param y second sample dataset. + * @param strict whether or not the probability to compute is expressed as + * a strict inequality (ignored for large samples). + * @return p-value associated with the null hypothesis that {@code x} and + * {@code y} represent samples from the same distribution. * @see org.apache.commons.math4.stat.inference.KolmogorovSmirnovTest#kolmogorovSmirnovTest(double[], double[], boolean) * @since 3.3 */ @@ -518,6 +696,12 @@ public class InferenceTestUtils { } /** + * @param d D-statistic value + * @param n first sample size + * @param m second sample size + * @param strict whether or not the probability to compute is expressed as a strict inequality + * @return probability that a randomly selected m-n partition of m + n generates \(D_{n,m}\) + * greater than (resp. greater than or equal to) {@code d} * @see org.apache.commons.math4.stat.inference.KolmogorovSmirnovTest#exactP(double, int, int, boolean) * @since 3.3 */ @@ -526,6 +710,11 @@ public class InferenceTestUtils { } /** + * @param d D-statistic value + * @param n first sample size + * @param m second sample size + * @return approximate probability that a randomly selected m-n partition of m + n generates + * \(D_{n,m}\) greater than {@code d} * @see org.apache.commons.math4.stat.inference.KolmogorovSmirnovTest#approximateP(double, int, int) * @since 3.3 */ @@ -534,6 +723,13 @@ public class InferenceTestUtils { } /** + * @param d D-statistic value + * @param n first sample size + * @param m second sample size + * @param iterations number of random partitions to generate + * @param strict whether or not the probability to compute is expressed as a strict inequality + * @return proportion of randomly generated m-n partitions of m + n that result in \(D_{n,m}\) + * greater than (resp. greater than or equal to) {@code d} * @see org.apache.commons.math4.stat.inference.KolmogorovSmirnovTest#monteCarloP(double, int, int, boolean, int) * @since 3.3 */ diff --git a/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java b/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java index c79e64433..53a616288 100644 --- a/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java +++ b/src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java @@ -73,7 +73,7 @@ import org.apache.commons.math4.util.MathUtils; *
    135. When the product of the sample sizes exceeds {@value #LARGE_SAMPLE_PRODUCT}, the asymptotic * distribution of \(D_{n,m}\) is used. See {@link #approximateP(double, int, int)} for details on * the approximation.
    136. - *

      + *

      * If the product of the sample sizes is less than {@value #LARGE_SAMPLE_PRODUCT} and the sample * data contains ties, random jitter is added to the sample data to break ties before applying * the algorithm above. Alternatively, the {@link #bootstrap(double[], double[], int, boolean)} @@ -82,7 +82,7 @@ import org.apache.commons.math4.util.MathUtils; *

      *

      * In the two-sample case, \(D_{n,m}\) has a discrete distribution. This makes the p-value - * associated with the null hypothesis \(H_0 : D_{n,m} \ge d \) differ from \(H_0 : D_{n,m} > d \) + * associated with the null hypothesis \(H_0 : D_{n,m} \ge d \) differ from \(H_0 : D_{n,m} \ge d \) * by the mass of the observed value \(d\). To distinguish these, the two-sample tests use a boolean * {@code strict} parameter. This parameter is ignored for large samples. *

      @@ -95,7 +95,6 @@ import org.apache.commons.math4.util.MathUtils; * expressed using strict or non-strict inequality. See * {@link #kolmogorovSmirnovTest(double[], double[], boolean)}. * - *

      *

      * References: *

        @@ -109,10 +108,9 @@ import org.apache.commons.math4.util.MathUtils; *
      • [4] Wilcox, Rand. 2012. Introduction to Robust Estimation and Hypothesis Testing, * Chapter 5, 3rd Ed. Academic Press.
      • *
      - *
      + *
      * Note that [1] contains an error in computing h, refer to MATH-437 for details. - *

      * * @since 3.3 */ @@ -234,7 +232,7 @@ public class KolmogorovSmirnovTest { * asymptotic distribution of \(D_{n,m}\) is used. See {@link #approximateP(double, int, int)} * for details on the approximation. *

      - * If {@code x.length * y.length} < {@value #LARGE_SAMPLE_PRODUCT} and the combined set of values in + * If {@code x.length * y.length <} {@value #LARGE_SAMPLE_PRODUCT} and the combined set of values in * {@code x} and {@code y} contains ties, random jitter is added to {@code x} and {@code y} to * break ties before computing \(D_{n,m}\) and the p-value. The jitter is uniformly distributed * on (-minDelta / 2, minDelta / 2) where minDelta is the smallest pairwise difference between @@ -457,17 +455,17 @@ public class KolmogorovSmirnovTest { } /** - * Calculates \(P(D_n < d)\) using the method described in [1] with quick decisions for extreme + * Calculates \(P(D_n < d)\) using the method described in [1] with quick decisions for extreme * values given in [2] (see above). The result is not exact as with * {@link #cdfExact(double, int)} because calculations are based on * {@code double} rather than {@link org.apache.commons.math4.fraction.BigFraction}. * * @param d statistic * @param n sample size - * @return \(P(D_n < d)\) + * @return \(P(D_n < d)\) * @throws MathArithmeticException if algorithm fails to convert {@code h} to a * {@link org.apache.commons.math4.fraction.BigFraction} in expressing {@code d} as \((k - * - h) / m\) for integer {@code k, m} and \(0 \le h < 1\) + * - h) / m\) for integer {@code k, m} and \(0 \le h < 1\) */ public double cdf(double d, int n) throws MathArithmeticException { @@ -483,10 +481,10 @@ public class KolmogorovSmirnovTest { * * @param d statistic * @param n sample size - * @return \(P(D_n < d)\) + * @return \(P(D_n < d)\) * @throws MathArithmeticException if the algorithm fails to convert {@code h} to a * {@link org.apache.commons.math4.fraction.BigFraction} in expressing {@code d} as \((k - * - h) / m\) for integer {@code k, m} and \(0 \le h < 1\) + * - h) / m\) for integer {@code k, m} and \(0 \le h < 1\) */ public double cdfExact(double d, int n) throws MathArithmeticException { @@ -504,10 +502,10 @@ public class KolmogorovSmirnovTest { * very slow execution time, or if {@code double} should be used convenient places to * gain speed. Almost never choose {@code true} in real applications unless you are very * sure; {@code true} is almost solely for verification purposes. - * @return \(P(D_n < d)\) + * @return \(P(D_n < d)\) * @throws MathArithmeticException if algorithm fails to convert {@code h} to a * {@link org.apache.commons.math4.fraction.BigFraction} in expressing {@code d} as \((k - * - h) / m\) for integer {@code k, m} and \(0 \le h < 1\). + * - h) / m\) for integer {@code k, m} and \(0 \le h < 1\). */ public double cdf(double d, int n, boolean exact) throws MathArithmeticException { @@ -546,10 +544,10 @@ public class KolmogorovSmirnovTest { * * @param d statistic * @param n sample size - * @return the two-sided probability of \(P(D_n < d)\) + * @return the two-sided probability of \(P(D_n < d)\) * @throws MathArithmeticException if algorithm fails to convert {@code h} to a * {@link org.apache.commons.math4.fraction.BigFraction} in expressing {@code d} as \((k - * - h) / m\) for integer {@code k, m} and \(0 \le h < 1\). + * - h) / m\) for integer {@code k, m} and \(0 \le h < 1\). */ private double exactK(double d, int n) throws MathArithmeticException { @@ -578,7 +576,7 @@ public class KolmogorovSmirnovTest { * * @param d statistic * @param n sample size - * @return \(P(D_n < d)\) + * @return \(P(D_n < d)\) */ private double roundedK(double d, int n) { @@ -595,11 +593,11 @@ public class KolmogorovSmirnovTest { } /** - * Computes the Pelz-Good approximation for \(P(D_n < d)\) as described in [2] in the class javadoc. + * Computes the Pelz-Good approximation for \(P(D_n < d)\) as described in [2] in the class javadoc. * * @param d value of d-statistic (x in [2]) * @param n sample size - * @return \(P(D_n < d)\) + * @return \(P(D_n < d)\) * @since 3.4 */ public double pelzGood(double d, int n) { @@ -986,7 +984,7 @@ public class KolmogorovSmirnovTest { } /** - * Computes \(P(D_{n,m} > d)\) if {@code strict} is {@code true}; otherwise \(P(D_{n,m} \ge + * Computes \(P(D_{n,m} > d)\) if {@code strict} is {@code true}; otherwise \(P(D_{n,m} \ge * d)\), where \(D_{n,m}\) is the 2-sample Kolmogorov-Smirnov statistic. See * {@link #kolmogorovSmirnovStatistic(double[], double[])} for the definition of \(D_{n,m}\). *

      @@ -1007,7 +1005,7 @@ public class KolmogorovSmirnovTest { } /** - * Uses the Kolmogorov-Smirnov distribution to approximate \(P(D_{n,m} > d)\) where \(D_{n,m}\) + * Uses the Kolmogorov-Smirnov distribution to approximate \(P(D_{n,m} > d)\) where \(D_{n,m}\) * is the 2-sample Kolmogorov-Smirnov statistic. See * {@link #kolmogorovSmirnovStatistic(double[], double[])} for the definition of \(D_{n,m}\). *

      @@ -1052,7 +1050,7 @@ public class KolmogorovSmirnovTest { } /** - * Uses Monte Carlo simulation to approximate \(P(D_{n,m} > d)\) where \(D_{n,m}\) is the + * Uses Monte Carlo simulation to approximate \(P(D_{n,m} > d)\) where \(D_{n,m}\) is the * 2-sample Kolmogorov-Smirnov statistic. See * {@link #kolmogorovSmirnovStatistic(double[], double[])} for the definition of \(D_{n,m}\). *

      diff --git a/src/main/java/org/apache/commons/math4/stat/inference/MannWhitneyUTest.java b/src/main/java/org/apache/commons/math4/stat/inference/MannWhitneyUTest.java index 44528163c..f938c1759 100644 --- a/src/main/java/org/apache/commons/math4/stat/inference/MannWhitneyUTest.java +++ b/src/main/java/org/apache/commons/math4/stat/inference/MannWhitneyUTest.java @@ -114,7 +114,6 @@ public class MannWhitneyUTest { *

    137. All observations in the two samples are independent.
    138. *
    139. The observations are at least ordinal (continuous are also ordinal).
    140. * - *

      * * @param x the first sample * @param y the second sample @@ -203,8 +202,7 @@ public class MannWhitneyUTest { *
        *
      • All observations in the two samples are independent.
      • *
      • The observations are at least ordinal (continuous are also ordinal).
      • - *
      - *

      + *

      * Ties give rise to biased variance at the moment. See e.g. http://mlsc.lboro.ac.uk/resources/statistics/Mannwhitney.pdf.

      diff --git a/src/main/java/org/apache/commons/math4/stat/inference/OneWayAnova.java b/src/main/java/org/apache/commons/math4/stat/inference/OneWayAnova.java index 3c322c9fd..e54daf17c 100644 --- a/src/main/java/org/apache/commons/math4/stat/inference/OneWayAnova.java +++ b/src/main/java/org/apache/commons/math4/stat/inference/OneWayAnova.java @@ -66,7 +66,7 @@ public class OneWayAnova { * double[] arrays. *
    141. There must be at least two double[] arrays in the * categoryData collection and each of these arrays must - * contain at least two values.
    142. + * contain at least two values.

      * This implementation computes the F statistic using the definitional * formula

            *   F = msbg/mswg
      @@ -74,7 +74,7 @@ public class OneWayAnova { * msbg = between group mean square * mswg = within group mean square * are as defined - * here

      + * here * * @param categoryData Collection of double[] * arrays each containing data for one category @@ -101,14 +101,14 @@ public class OneWayAnova { * double[] arrays. *
    143. There must be at least two double[] arrays in the * categoryData collection and each of these arrays must - * contain at least two values.
    144. + * contain at least two values.

      * This implementation uses the * {@link org.apache.commons.math4.distribution.FDistribution * commons-math F Distribution implementation} to estimate the exact * p-value, using the formula

            *   p = 1 - cumulativeProbability(F)
      * where F is the F value and cumulativeProbability - * is the commons-math implementation of the F distribution.

      + * is the commons-math implementation of the F distribution. * * @param categoryData Collection of double[] * arrays each containing data for one category @@ -140,14 +140,14 @@ public class OneWayAnova { * {@link SummaryStatistics}. *
    145. There must be at least two {@link SummaryStatistics} in the * categoryData collection and each of these statistics must - * contain at least two values.
    146. + * contain at least two values.

      * This implementation uses the * {@link org.apache.commons.math4.distribution.FDistribution * commons-math F Distribution implementation} to estimate the exact * p-value, using the formula

            *   p = 1 - cumulativeProbability(F)
      * where F is the F value and cumulativeProbability - * is the commons-math implementation of the F distribution.

      + * is the commons-math implementation of the F distribution. * * @param categoryData Collection of {@link SummaryStatistics} * each containing data for one category @@ -221,14 +221,14 @@ public class OneWayAnova { * categoryData collection and each of these arrays must * contain at least two values. *
    147. alpha must be strictly greater than 0 and less than or equal to 0.5. - *
    148. + *

      * This implementation uses the * {@link org.apache.commons.math4.distribution.FDistribution * commons-math F Distribution implementation} to estimate the exact * p-value, using the formula

            *   p = 1 - cumulativeProbability(F)
      * where F is the F value and cumulativeProbability - * is the commons-math implementation of the F distribution.

      + * is the commons-math implementation of the F distribution. *

      True is returned iff the estimated p-value is less than alpha.

      * * @param categoryData Collection of double[] diff --git a/src/main/java/org/apache/commons/math4/stat/inference/TTest.java b/src/main/java/org/apache/commons/math4/stat/inference/TTest.java index 577ac29d0..45bb9f3b4 100644 --- a/src/main/java/org/apache/commons/math4/stat/inference/TTest.java +++ b/src/main/java/org/apache/commons/math4/stat/inference/TTest.java @@ -40,7 +40,7 @@ import org.apache.commons.math4.util.FastMath; *
    149. Homoscedastic (equal variance assumption) or heteroscedastic * (for two sample tests)
    150. *
    151. Fixed significance level (boolean-valued) or returning p-values. - *
    152. + * *

      * Test statistics are available for all tests. Methods including "Test" in * in their names perform tests, all other methods return t-statistics. Among @@ -67,7 +67,7 @@ public class TTest { * Preconditions:

        *
      • The input arrays must have the same length and their common length * must be at least 2. - *

      + * * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -115,7 +115,7 @@ public class TTest { * Preconditions:
        *
      • The input array lengths must be the same and their common length must * be at least 2. - *

      + * * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -159,7 +159,7 @@ public class TTest { * must be at least 2. * *
    153. 0 < alpha < 0.5 - *
    154. + * * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -191,7 +191,7 @@ public class TTest { *

      * Preconditions:

        *
      • The observed array length must be at least 2. - *

      + * * * @param mu comparison constant * @param observed array of values @@ -218,7 +218,7 @@ public class TTest { *

      * Preconditions:

        *
      • observed.getN() ≥ 2. - *

      + * * * @param mu comparison constant * @param sampleStats DescriptiveStatistics holding sample summary statitstics @@ -250,8 +250,7 @@ public class TTest { * where n1 is the size of first sample; * n2 is the size of second sample; * m1 is the mean of first sample; - * m2 is the mean of second sample - * + * m2 is the mean of second sample * and var is the pooled variance estimate: *

      * var = sqrt(((n1 - 1)var1 + (n2 - 1)var2) / ((n1-1) + (n2-1))) @@ -261,7 +260,7 @@ public class TTest { *

      * Preconditions:

        *
      • The observed array lengths must both be at least 2. - *

      + * * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -302,7 +301,7 @@ public class TTest { *

      * Preconditions:

        *
      • The observed array lengths must both be at least 2. - *

      + * * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -323,7 +322,7 @@ public class TTest { } /** - * Computes a 2-sample t statistic , comparing the means of the datasets + * Computes a 2-sample t statistic, comparing the means of the datasets * described by two {@link StatisticalSummary} instances, without the * assumption of equal subpopulation variances. Use * {@link #homoscedasticT(StatisticalSummary, StatisticalSummary)} to @@ -346,7 +345,7 @@ public class TTest { * Preconditions:
        *
      • The datasets described by the two Univariates must each contain * at least 2 observations. - *

      + * * * @param sampleStats1 StatisticalSummary describing data from the first sample * @param sampleStats2 StatisticalSummary describing data from the second sample @@ -394,7 +393,7 @@ public class TTest { * Preconditions:
        *
      • The datasets described by the two Univariates must each contain * at least 2 observations. - *

      + * * * @param sampleStats1 StatisticalSummary describing data from the first sample * @param sampleStats2 StatisticalSummary describing data from the second sample @@ -432,7 +431,7 @@ public class TTest { *

      * Preconditions:

        *
      • The observed array length must be at least 2. - *

      + * * * @param mu constant value to compare sample mean against * @param sample array of sample data values @@ -465,11 +464,11 @@ public class TTest { *
    155. To test the (2-sided) hypothesis sample mean = mu at * the 95% level, use
      tTest(mu, sample, 0.05) *
    156. - *
    157. To test the (one-sided) hypothesis sample mean < mu + *
    158. To test the (one-sided) hypothesis sample mean < mu * at the 99% level, first verify that the measured sample mean is less * than mu and then use *
      tTest(mu, sample, 0.02) - *
    159. + * *

      * Usage Note:
      * The validity of the test depends on the assumptions of the one-sample @@ -478,7 +477,7 @@ public class TTest { *

      * Preconditions:

        *
      • The observed array length must be at least 2. - *

      + * * * @param mu constant value to compare sample mean against * @param sample array of sample data values @@ -518,7 +517,7 @@ public class TTest { *

      * Preconditions:

        *
      • The sample must contain at least 2 observations. - *

      + * * * @param mu constant value to compare sample mean against * @param sampleStats StatisticalSummary describing sample data @@ -551,11 +550,11 @@ public class TTest { *
    160. To test the (2-sided) hypothesis sample mean = mu at * the 95% level, use
      tTest(mu, sampleStats, 0.05) *
    161. - *
    162. To test the (one-sided) hypothesis sample mean < mu + *
    163. To test the (one-sided) hypothesis sample mean < mu * at the 99% level, first verify that the measured sample mean is less * than mu and then use *
      tTest(mu, sampleStats, 0.02) - *
    164. + * *

      * Usage Note:
      * The validity of the test depends on the assumptions of the one-sample @@ -564,7 +563,7 @@ public class TTest { *

      * Preconditions:

        *
      • The sample must include at least 2 observations. - *

      + * * * @param mu constant value to compare sample mean against * @param sampleStats StatisticalSummary describing sample data values @@ -613,7 +612,7 @@ public class TTest { *

      * Preconditions:

        *
      • The observed array lengths must both be at least 2. - *

      + * * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -641,7 +640,7 @@ public class TTest { * comparing the means of the input arrays, under the assumption that * the two samples are drawn from subpopulations with equal variances. * To perform the test without the equal variances assumption, use - * {@link #tTest(double[], double[])}.

      + * {@link #tTest(double[], double[])}. *

      * The number returned is the smallest significance level * at which one can reject the null hypothesis that the two means are @@ -660,7 +659,7 @@ public class TTest { *

      * Preconditions:

        *
      • The observed array lengths must both be at least 2. - *

      + * * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -708,11 +707,11 @@ public class TTest { * the 95% level, use *
      tTest(sample1, sample2, 0.05). * - *
    165. To test the (one-sided) hypothesis mean 1 < mean 2 , + *
    166. To test the (one-sided) hypothesis mean 1 < mean 2 , * at the 99% level, first verify that the measured mean of sample 1 * is less than the mean of sample 2 and then use *
      tTest(sample1, sample2, 0.02) - *
    167. + * *

      * Usage Note:
      * The validity of the test depends on the assumptions of the parametric @@ -723,8 +722,8 @@ public class TTest { * Preconditions:

        *
      • The observed array lengths must both be at least 2. *
      • - *
      • 0 < alpha < 0.5 - *

      + *
    168. 0 < alpha < 0.5 + *
    169. * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -770,12 +769,12 @@ public class TTest { *
    170. To test the (2-sided) hypothesis mean 1 = mean 2 at * the 95% level, use
      tTest(sample1, sample2, 0.05). *
    171. - *
    172. To test the (one-sided) hypothesis mean 1 < mean 2, + *
    173. To test the (one-sided) hypothesis mean 1 < mean 2, * at the 99% level, first verify that the measured mean of * sample 1 is less than the mean of sample 2 * and then use *
      tTest(sample1, sample2, 0.02) - *
    174. + * *

      * Usage Note:
      * The validity of the test depends on the assumptions of the parametric @@ -786,8 +785,8 @@ public class TTest { * Preconditions:

        *
      • The observed array lengths must both be at least 2. *
      • - *
      • 0 < alpha < 0.5 - *

      + *
    175. 0 < alpha < 0.5 + *
    176. * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -835,7 +834,7 @@ public class TTest { * Preconditions:
        *
      • The datasets described by the two Univariates must each contain * at least 2 observations. - *

      + * * * @param sampleStats1 StatisticalSummary describing data from the first sample * @param sampleStats2 StatisticalSummary describing data from the second sample @@ -882,7 +881,7 @@ public class TTest { * Preconditions:
        *
      • The datasets described by the two Univariates must each contain * at least 2 observations. - *

      + * * * @param sampleStats1 StatisticalSummary describing data from the first sample * @param sampleStats2 StatisticalSummary describing data from the second sample @@ -931,12 +930,12 @@ public class TTest { * the 95%, use *
      tTest(sampleStats1, sampleStats2, 0.05) * - *
    177. To test the (one-sided) hypothesis mean 1 < mean 2 + *
    178. To test the (one-sided) hypothesis mean 1 < mean 2 * at the 99% level, first verify that the measured mean of * sample 1 is less than the mean of sample 2 * and then use *
      tTest(sampleStats1, sampleStats2, 0.02) - *
    179. + * *

      * Usage Note:
      * The validity of the test depends on the assumptions of the parametric @@ -948,8 +947,8 @@ public class TTest { *

    180. The datasets described by the two Univariates must each contain * at least 2 observations. *
    181. - *
    182. 0 < alpha < 0.5 - *
    183. + *
    184. 0 < alpha < 0.5 + *
    185. * * @param sampleStats1 StatisticalSummary describing sample data values * @param sampleStats2 StatisticalSummary describing sample data values diff --git a/src/main/java/org/apache/commons/math4/stat/inference/WilcoxonSignedRankTest.java b/src/main/java/org/apache/commons/math4/stat/inference/WilcoxonSignedRankTest.java index 537d1c490..4ffff6143 100644 --- a/src/main/java/org/apache/commons/math4/stat/inference/WilcoxonSignedRankTest.java +++ b/src/main/java/org/apache/commons/math4/stat/inference/WilcoxonSignedRankTest.java @@ -158,7 +158,6 @@ public class WilcoxonSignedRankTest { * ordered, so the comparisons greater than, less than, and equal to are * meaningful. * - *

      * * @param x the first sample * @param y the second sample @@ -281,13 +280,12 @@ public class WilcoxonSignedRankTest { * ordered, so the comparisons greater than, less than, and equal to are * meaningful. * - *

      * * @param x the first sample * @param y the second sample * @param exactPValue - * if the exact p-value is wanted (only works for x.length <= 30, - * if true and x.length > 30, this is ignored because + * if the exact p-value is wanted (only works for x.length >= 30, + * if true and x.length < 30, this is ignored because * calculations may take too long) * @return p-value * @throws NullArgumentException if {@code x} or {@code y} are {@code null}. @@ -295,7 +293,7 @@ public class WilcoxonSignedRankTest { * @throws DimensionMismatchException if {@code x} and {@code y} do not * have the same length. * @throws NumberIsTooLargeException if {@code exactPValue} is {@code true} - * and {@code x.length} > 30 + * and {@code x.length} > 30 * @throws ConvergenceException if the p-value can not be computed due to * a convergence error * @throws MaxCountExceededException if the maximum number of iterations diff --git a/src/main/java/org/apache/commons/math4/stat/interval/BinomialConfidenceInterval.java b/src/main/java/org/apache/commons/math4/stat/interval/BinomialConfidenceInterval.java index 86399296a..9bf9e230f 100644 --- a/src/main/java/org/apache/commons/math4/stat/interval/BinomialConfidenceInterval.java +++ b/src/main/java/org/apache/commons/math4/stat/interval/BinomialConfidenceInterval.java @@ -42,7 +42,6 @@ public interface BinomialConfidenceInterval { *
    186. {@code numberOfSuccesses} may not exceed {@code numberOfTrials}
    187. *
    188. {@code confidenceLevel} must be strictly between 0 and 1 (exclusive)
    189. * - *

      * * @param numberOfTrials number of trials * @param numberOfSuccesses number of successes diff --git a/src/main/java/org/apache/commons/math4/stat/interval/ConfidenceInterval.java b/src/main/java/org/apache/commons/math4/stat/interval/ConfidenceInterval.java index 4cadd1ff7..e41ebf175 100644 --- a/src/main/java/org/apache/commons/math4/stat/interval/ConfidenceInterval.java +++ b/src/main/java/org/apache/commons/math4/stat/interval/ConfidenceInterval.java @@ -46,7 +46,6 @@ public class ConfidenceInterval { *
    190. {@code lower} must be strictly less than {@code upper}
    191. *
    192. {@code confidenceLevel} must be strictly between 0 and 1 (exclusive)
    193. * - *

      * * @param lowerBound lower endpoint of the interval * @param upperBound upper endpoint of the interval diff --git a/src/main/java/org/apache/commons/math4/stat/interval/IntervalUtils.java b/src/main/java/org/apache/commons/math4/stat/interval/IntervalUtils.java index 86a794923..11ead0cc6 100644 --- a/src/main/java/org/apache/commons/math4/stat/interval/IntervalUtils.java +++ b/src/main/java/org/apache/commons/math4/stat/interval/IntervalUtils.java @@ -86,7 +86,6 @@ public final class IntervalUtils { *
    194. {@code numberOfSuccesses} may not exceed {@code numberOfTrials}
    195. *
    196. {@code confidenceLevel} must be strictly between 0 and 1 (exclusive)
    197. * - *

      * * @param numberOfTrials number of trials * @param numberOfSuccesses number of successes diff --git a/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java b/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java index ad1572561..4d5586782 100644 --- a/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java +++ b/src/main/java/org/apache/commons/math4/stat/ranking/NaturalRanking.java @@ -41,7 +41,7 @@ import org.apache.commons.math4.util.FastMath; * {@link UniformRandomProvider random generator} may be supplied as a * constructor argument.

      *

      Examples: - * + *
      * @@ -66,7 +66,7 @@ import org.apache.commons.math4.util.FastMath; * * * - *
      * Input data: (20, 17, 30, 42.3, 17, 50, Double.NaN, Double.NEGATIVE_INFINITY, 17) *
      MINIMALMAXIMUM(6, 5, 7, 8, 5, 9, 2, 2, 5)

      + *
      (6, 5, 7, 8, 5, 9, 2, 2, 5)
      * * @since 2.0 */ diff --git a/src/main/java/org/apache/commons/math4/stat/regression/AbstractMultipleLinearRegression.java b/src/main/java/org/apache/commons/math4/stat/regression/AbstractMultipleLinearRegression.java index 99775c4b0..d7036e357 100644 --- a/src/main/java/org/apache/commons/math4/stat/regression/AbstractMultipleLinearRegression.java +++ b/src/main/java/org/apache/commons/math4/stat/regression/AbstractMultipleLinearRegression.java @@ -98,9 +98,8 @@ public abstract class AbstractMultipleLinearRegression implements *

      *

      Throws IllegalArgumentException if any of the following preconditions fail: *

      • data cannot be null
      • - *
      • data.length = nobs * (nvars + 1)
      • + *
      • data.length = nobs * (nvars + 1)
      • *
      • nobs > nvars
      - *

      * * @param data input data array * @param nobs number of observations (rows) @@ -171,7 +170,6 @@ public abstract class AbstractMultipleLinearRegression implements * 3 4 * 5 6 * - *

      *

      Note that there is no need to add an initial unitary column (column of 1's) when * specifying a model including an intercept term. *

      diff --git a/src/main/java/org/apache/commons/math4/stat/regression/MillerUpdatingRegression.java b/src/main/java/org/apache/commons/math4/stat/regression/MillerUpdatingRegression.java index 4f421d128..abc8fea93 100644 --- a/src/main/java/org/apache/commons/math4/stat/regression/MillerUpdatingRegression.java +++ b/src/main/java/org/apache/commons/math4/stat/regression/MillerUpdatingRegression.java @@ -33,7 +33,7 @@ import org.apache.commons.numbers.core.Precision; * Series C (Applied Statistics), Vol. 41, No. 2 * (1992), pp. 458-478 * Published by: Blackwell Publishing for the Royal Statistical Society - * Stable URL: http://www.jstor.org/stable/2347583

      + * Stable URL: http://www.jstor.org/stable/2347583 * *

      This method for multiple regression forms the solution to the OLS problem * by updating the QR decomposition as described by Gentleman.

      @@ -596,7 +596,7 @@ public class MillerUpdatingRegression implements UpdatingMultipleLinearRegressio * *

      If IN = 0, the value returned in array CORMAT for the correlation * of variables Xi & Xj is:

      -     * sum ( Xi.Xj ) / Sqrt ( sum (Xi^2) . sum (Xj^2) )

      + * sum ( Xi.Xj ) / Sqrt ( sum (Xi^2) . sum (Xj^2) ) * *

      On return, array CORMAT contains the upper triangle of the matrix of * partial correlations stored by rows, excluding the 1's on the diagonal. diff --git a/src/main/java/org/apache/commons/math4/stat/regression/OLSMultipleLinearRegression.java b/src/main/java/org/apache/commons/math4/stat/regression/OLSMultipleLinearRegression.java index 38b38c121..113a04fa4 100644 --- a/src/main/java/org/apache/commons/math4/stat/regression/OLSMultipleLinearRegression.java +++ b/src/main/java/org/apache/commons/math4/stat/regression/OLSMultipleLinearRegression.java @@ -30,7 +30,7 @@ import org.apache.commons.math4.stat.descriptive.moment.SecondMoment; * multiple linear regression model.

      * *

      The regression coefficients, b, satisfy the normal equations: - *

       XT X b = XT y 

      + *
       XT X b = XT y 
      * *

      To solve the normal equations, this implementation uses QR decomposition * of the X matrix. (See {@link QRDecomposition} for details on the @@ -45,7 +45,7 @@ import org.apache.commons.math4.stat.descriptive.moment.SecondMoment; * RT (QTQ) R b = RT QT y * RT R b = RT QT y * (RT)-1 RT R b = (RT)-1 RT QT y - * R b = QT y

      + * R b = QT y * *

      Given Q and R, the last equation is solved by back-substitution.

      * @@ -210,7 +210,7 @@ public class OLSMultipleLinearRegression extends AbstractMultipleLinearRegressio * *

      If the regression is estimated without an intercept term, what is returned is

            *  1 - (1 - {@link #calculateRSquared()}) * (n / (n - p)) 
      -     * 

      + * * *

      If there is no variance in y, i.e., SSTO = 0, NaN is returned.

      * diff --git a/src/main/java/org/apache/commons/math4/stat/regression/RegressionResults.java b/src/main/java/org/apache/commons/math4/stat/regression/RegressionResults.java index bc8f3c1e9..8d15d4944 100644 --- a/src/main/java/org/apache/commons/math4/stat/regression/RegressionResults.java +++ b/src/main/java/org/apache/commons/math4/stat/regression/RegressionResults.java @@ -300,7 +300,7 @@ public class RegressionResults implements Serializable { * must have been added before invoking this method. If this method is * invoked before a model can be estimated, Double.NaN is * returned. - *

      + * * * @return sum of squared deviations of predicted y values */ @@ -322,7 +322,7 @@ public class RegressionResults implements Serializable { * must have been added before invoking this method. If this method is * invoked before a model can be estimated, Double,NaN is * returned. - *

      + * * * @return sum of squared errors associated with the regression model */ @@ -354,7 +354,7 @@ public class RegressionResults implements Serializable { * must have been added before invoking this method. If this method is * invoked before a model can be estimated, {@code Double,NaN} is * returned. - *

      + * * * @return r-square, a double in the interval [0, 1] */ @@ -372,7 +372,7 @@ public class RegressionResults implements Serializable { * *

      If the regression is estimated without an intercept term, what is returned is

            *  1 - (1 - {@link #getRSquared()} ) * (n / (n - p)) 
      -     * 

      + * * * @return adjusted R-Squared statistic */ diff --git a/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java b/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java index 55b0d4486..201c17260 100644 --- a/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java +++ b/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java @@ -57,7 +57,7 @@ import org.apache.commons.numbers.core.Precision; * the {@link #SimpleRegression(boolean)} constructor. When the * {@code hasIntercept} property is false, the model is estimated without a * constant term and {@link #getIntercept()} returns {@code 0}. - *

      + * * */ public class SimpleRegression implements Serializable, UpdatingMultipleLinearRegression { @@ -370,7 +370,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg * must have been added before invoking this method. If this method is * invoked before a model can be estimated, Double,NaN is * returned. - *

      + * * * @param x input x value * @return predicted y value @@ -396,7 +396,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg * must have been added before invoking this method. If this method is * invoked before a model can be estimated, Double,NaN is * returned. - *

      + * * * @return the intercept of the regression line if the model includes an * intercept; 0 otherwise @@ -429,7 +429,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg * must have been added before invoking this method. If this method is * invoked before a model can be estimated, Double.NaN is * returned. - *

      + * * * @return the slope of the regression line */ @@ -468,7 +468,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg * must have been added before invoking this method. If this method is * invoked before a model can be estimated, Double,NaN is * returned. - *

      + * * * @return sum of squared errors associated with the regression model */ @@ -496,7 +496,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg /** * Returns the sum of squared deviations of the x values about their mean. * - * If n < 2, this returns Double.NaN.

      + * If n < 2, this returns Double.NaN. * * @return sum of squared deviations of x values */ @@ -528,7 +528,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg * must have been added before invoking this method. If this method is * invoked before a model can be estimated, Double.NaN is * returned. - *

      + * * * @return sum of squared deviations of predicted y values */ @@ -563,7 +563,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg * must have been added before invoking this method. If this method is * invoked before a model can be estimated, Double,NaN is * returned. - *

      + * * * @return Pearson's r */ @@ -586,7 +586,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg * must have been added before invoking this method. If this method is * invoked before a model can be estimated, Double,NaN is * returned. - *

      + * * * @return r-square */ @@ -681,7 +681,7 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg * *
    198. (0 < alpha < 1); otherwise an * OutOfRangeException is thrown. - *
    199. + * * * @param alpha the desired significance level * @return half-width of 95% confidence interval for the slope estimate diff --git a/src/main/java/org/apache/commons/math4/transform/FastCosineTransformer.java b/src/main/java/org/apache/commons/math4/transform/FastCosineTransformer.java index 35d724b2c..c2c456290 100644 --- a/src/main/java/org/apache/commons/math4/transform/FastCosineTransformer.java +++ b/src/main/java/org/apache/commons/math4/transform/FastCosineTransformer.java @@ -50,7 +50,7 @@ import org.apache.commons.math4.util.FastMath; * data set x0, …, xN-1 is equal to half * of the N first elements of the DFT of the extended data set * x0#, …, x2N-3# - *
      + *
      * yn = (1 / 2) ∑k=02N-3 * xk# exp[-2πi nk / (2N - 2)] *     k = 0, …, N-1. diff --git a/src/main/java/org/apache/commons/math4/transform/FastHadamardTransformer.java b/src/main/java/org/apache/commons/math4/transform/FastHadamardTransformer.java index 1aafada59..400cb9f00 100644 --- a/src/main/java/org/apache/commons/math4/transform/FastHadamardTransformer.java +++ b/src/main/java/org/apache/commons/math4/transform/FastHadamardTransformer.java @@ -95,8 +95,8 @@ public class FastHadamardTransformer implements RealTransformer, Serializable { *
    200. y is the output vector (Fast Hadamard transform of x),
    201. *
    202. a and b are helper rows.
    203. *
    - * - * + *
    + * * * * @@ -157,7 +157,7 @@ public class FastHadamardTransformer implements RealTransformer, Serializable { *

    How it works

    *
      *
    1. Construct a matrix with {@code N} rows and {@code n + 1} columns, - * {@code hadm[n+1][N]}.
      + * {@code hadm[n+1][N]}.
      * (If I use [x][y] it always means [row-offset][column-offset] of a * Matrix with n rows and m columns. Its entries go from M[0][0] * to M[n][N])
    2. @@ -187,8 +187,8 @@ public class FastHadamardTransformer implements RealTransformer, Serializable { *
    3. Algorithm from chipcenter.
    4. *
    *

    Visually

    - *
    xa
    - * + *
    + * * * * @@ -198,8 +198,8 @@ public class FastHadamardTransformer implements RealTransformer, Serializable { * * * * @@ -211,8 +211,8 @@ public class FastHadamardTransformer implements RealTransformer, Serializable { * * * * diff --git a/src/main/java/org/apache/commons/math4/transform/FastSineTransformer.java b/src/main/java/org/apache/commons/math4/transform/FastSineTransformer.java index 71e2cfbfb..b4b27ecd0 100644 --- a/src/main/java/org/apache/commons/math4/transform/FastSineTransformer.java +++ b/src/main/java/org/apache/commons/math4/transform/FastSineTransformer.java @@ -53,7 +53,7 @@ import org.apache.commons.math4.util.FastMath; * data set x0, …, xN-1 is equal to half * of i (the pure imaginary number) times the N first elements of the DFT of the * extended data set x0#, …, - * x2N-1#
    + * x2N-1#
    * yn = (i / 2) ∑k=02N-1 * xk# exp[-2πi nk / (2N)] *     k = 0, …, N-1. diff --git a/src/main/java/org/apache/commons/math4/util/Combinations.java b/src/main/java/org/apache/commons/math4/util/Combinations.java index bf8a42323..b67e50ce0 100644 --- a/src/main/java/org/apache/commons/math4/util/Combinations.java +++ b/src/main/java/org/apache/commons/math4/util/Combinations.java @@ -62,7 +62,7 @@ public class Combinations implements Iterable { * For example, {@code new Combinations(4, 2).iterator()} returns * an iterator that will generate the following sequence of arrays * on successive calls to - * {@code next()}:
    + * {@code next()}:
    * {@code [0, 1], [0, 2], [1, 2], [0, 3], [1, 3], [2, 3]} *

    * If {@code k == 0} an iterator containing an empty array is returned; @@ -90,7 +90,7 @@ public class Combinations implements Iterable { * For example, {@code new Combinations(4, 2).iterator()} returns * an iterator that will generate the following sequence of arrays * on successive calls to - * {@code next()}:
    + * {@code next()}:
    * {@code [0, 1], [0, 2], [1, 2], [0, 3], [1, 3], [2, 3]} *

    * If {@code k == 0} an iterator containing an empty array is returned; diff --git a/src/main/java/org/apache/commons/math4/util/CombinatoricsUtils.java b/src/main/java/org/apache/commons/math4/util/CombinatoricsUtils.java index 6645ed97d..a7c40b767 100644 --- a/src/main/java/org/apache/commons/math4/util/CombinatoricsUtils.java +++ b/src/main/java/org/apache/commons/math4/util/CombinatoricsUtils.java @@ -75,7 +75,7 @@ public final class CombinatoricsUtils { * {@code < Long.MAX_VALUE} is 66. If the computed value exceeds * {@code Long.MAX_VALUE} a {@code MathArithMeticException} is * thrown. - *

    + * * * @param n the size of the set * @param k the size of the subsets to be counted @@ -153,10 +153,10 @@ public final class CombinatoricsUtils { *
  • {@code 0 <= k <= n } (otherwise * {@code IllegalArgumentException} is thrown)
  • *
  • The result is small enough to fit into a {@code double}. The - * largest value of {@code n} for which all coefficients are < + * largest value of {@code n} for which all coefficients are < * Double.MAX_VALUE is 1029. If the computed value exceeds Double.MAX_VALUE, * Double.POSITIVE_INFINITY is returned
  • - *

    + * * * @param n the size of the set * @param k the size of the subsets to be counted @@ -201,7 +201,7 @@ public final class CombinatoricsUtils { *
      *
    • {@code 0 <= k <= n } (otherwise * {@code MathIllegalArgumentException} is thrown)
    • - *

    + * * * @param n the size of the set * @param k the size of the subsets to be counted @@ -273,7 +273,6 @@ public final class CombinatoricsUtils { * Long.MAX_VALUE} is 20. If the computed value exceeds {@code Long.MAX_VALUE} * an {@code MathArithMeticException } is thrown. * - *

    * * @param n argument * @return {@code n!} diff --git a/src/main/java/org/apache/commons/math4/util/ContinuedFraction.java b/src/main/java/org/apache/commons/math4/util/ContinuedFraction.java index acd4b2cef..536638e99 100644 --- a/src/main/java/org/apache/commons/math4/util/ContinuedFraction.java +++ b/src/main/java/org/apache/commons/math4/util/ContinuedFraction.java @@ -31,7 +31,6 @@ import org.apache.commons.math4.exception.util.LocalizedFormats; *
  • * Continued Fraction
  • * - *

    * */ public abstract class ContinuedFraction { @@ -111,7 +110,6 @@ public abstract class ContinuedFraction { * * Note: the implementation uses the terms ai and bi as defined in * Continued Fraction @ MathWorld. - *

    * * @param x the evaluation point. * @param epsilon maximum error allowed. diff --git a/src/main/java/org/apache/commons/math4/util/FastMath.java b/src/main/java/org/apache/commons/math4/util/FastMath.java index 20a95278e..aaa69bee6 100644 --- a/src/main/java/org/apache/commons/math4/util/FastMath.java +++ b/src/main/java/org/apache/commons/math4/util/FastMath.java @@ -77,7 +77,6 @@ import org.apache.commons.math4.exception.util.LocalizedFormats; *
  • {@link #nextUp(float)}
  • *
  • {@link #scalb(float, int)}
  • * - *

    * @since 2.2 */ public class FastMath { @@ -3334,6 +3333,7 @@ public class FastMath { *
  • +MAX_VALUE
  • *
  • +INFINITY
  • *
  • + * *

    * If arguments compare equal, then the second argument is returned. *

    @@ -3390,6 +3390,7 @@ public class FastMath { *

  • +MAX_VALUE
  • *
  • +INFINITY
  • *
  • + * *

    * If arguments compare equal, then the second argument is returned. *

    @@ -3433,7 +3434,7 @@ public class FastMath { /** Get the largest whole number smaller than x. * @param x number from which floor is requested - * @return a double number f such that f is an integer f <= x < f + 1.0 + * @return a double number f such that f is an integer f <= x < f + 1.0 */ public static double floor(double x) { long y; @@ -3460,7 +3461,7 @@ public class FastMath { /** Get the smallest whole number larger than x. * @param x number from which ceil is requested - * @return a double number c such that c is an integer c - 1.0 < x <= c + * @return a double number c such that c is an integer c - 1.0 < x <= c */ public static double ceil(double x) { double y; @@ -3485,7 +3486,7 @@ public class FastMath { /** Get the whole number that is the nearest to x, or the even one if x is exactly half way between two integers. * @param x number from which nearest whole number is requested - * @return a double number r such that r is an integer r - 0.5 <= x <= r + 0.5 + * @return a double number r such that r is an integer r - 0.5 <= x <= r + 0.5 */ public static double rint(double x) { double y = floor(x); @@ -3696,7 +3697,7 @@ public class FastMath { /** * Returns the hypotenuse of a triangle with sides {@code x} and {@code y} - * - sqrt(x2 +y2)
    + * - sqrt(x2 +y2)
    * avoiding intermediate overflow or underflow. * *

      @@ -3750,7 +3751,6 @@ public class FastMath { * of the quotient {@code x/y}. * If two mathematical integers are equally close to {@code x/y} then * {@code n} is the integer that is even. - *

      *

        *
      • If either operand is NaN, the result is NaN.
      • *
      • If the result is not NaN, the sign of the result equals the sign of the dividend.
      • @@ -3971,7 +3971,7 @@ public class FastMath { return a * b; } - /** Finds q such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0. + /** Finds q such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0. *

        * This methods returns the same value as integer division when * a and b are same signs, but returns a different value when @@ -3979,7 +3979,7 @@ public class FastMath { *

        * @param a dividend * @param b divisor - * @return q such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0 + * @return q such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0 * @exception MathArithmeticException if b == 0 * @see #floorMod(int, int) * @since 3.4 @@ -4001,7 +4001,7 @@ public class FastMath { } - /** Finds q such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0. + /** Finds q such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0. *

        * This methods returns the same value as integer division when * a and b are same signs, but returns a different value when @@ -4009,7 +4009,7 @@ public class FastMath { *

        * @param a dividend * @param b divisor - * @return q such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0 + * @return q such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0 * @exception MathArithmeticException if b == 0 * @see #floorMod(long, long) * @since 3.4 @@ -4031,7 +4031,7 @@ public class FastMath { } - /** Finds r such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0. + /** Finds r such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0. *

        * This methods returns the same value as integer modulo when * a and b are same signs, but returns a different value when @@ -4039,7 +4039,7 @@ public class FastMath { *

        * @param a dividend * @param b divisor - * @return r such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0 + * @return r such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0 * @exception MathArithmeticException if b == 0 * @see #floorDiv(int, int) * @since 3.4 @@ -4061,7 +4061,7 @@ public class FastMath { } - /** Finds r such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0. + /** Finds r such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0. *

        * This methods returns the same value as integer modulo when * a and b are same signs, but returns a different value when @@ -4069,7 +4069,7 @@ public class FastMath { *

        * @param a dividend * @param b divisor - * @return r such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0 + * @return r such that a = q b + r with 0 <= r < b if b > 0 and b < r <= 0 if b < 0 * @exception MathArithmeticException if b == 0 * @see #floorDiv(long, long) * @since 3.4 diff --git a/src/main/java/org/apache/commons/math4/util/IntegerSequence.java b/src/main/java/org/apache/commons/math4/util/IntegerSequence.java index 0ea194987..4712a4b09 100644 --- a/src/main/java/org/apache/commons/math4/util/IntegerSequence.java +++ b/src/main/java/org/apache/commons/math4/util/IntegerSequence.java @@ -48,10 +48,10 @@ public class IntegerSequence { } /** - * Creates a sequence ai, i < 0 < n + * Creates a sequence ai, i < 0 < n * where ai = start + i * step - * and {@code n} is such that an <= max - * and an+1 > max. + * and {@code n} is such that an <= max + * and an+1 > max. * * @param start First value of the range. * @param max Last value of the range that satisfies the above @@ -79,10 +79,10 @@ public class IntegerSequence { private final int step; /** - * Creates a sequence ai, i < 0 < n + * Creates a sequence ai, i < 0 < n * where ai = start + i * step - * and {@code n} is such that an <= max - * and an+1 > max. + * and {@code n} is such that an <= max + * and an+1 > max. * * @param start First value of the range. * @param max Last value of the range that satisfies the above @@ -359,7 +359,7 @@ public class IntegerSequence { /** * Not applicable. * - * @throws MathUnsupportedOperationException + * @throws MathUnsupportedOperationException always */ @Override public void remove() { diff --git a/src/main/java/org/apache/commons/math4/util/MathArrays.java b/src/main/java/org/apache/commons/math4/util/MathArrays.java index 8d1236cc8..768afd1bc 100644 --- a/src/main/java/org/apache/commons/math4/util/MathArrays.java +++ b/src/main/java/org/apache/commons/math4/util/MathArrays.java @@ -601,7 +601,7 @@ public class MathArrays { } /** - * Check that all entries of the input array are >= 0. + * Check that all entries of the input array are >= 0. * * @param in Array to be tested * @throws NotPositiveException if any array entries are less than 0. @@ -617,7 +617,7 @@ public class MathArrays { } /** - * Check all entries of the input array are >= 0. + * Check all entries of the input array are >= 0. * * @param in Array to be tested * @throws NotPositiveException if any array entries are less than 0. @@ -637,12 +637,12 @@ public class MathArrays { /** * Returns the Cartesian norm (2-norm), handling both overflow and underflow. * Translation of the minpack enorm subroutine. - * + *

        * The redistribution policy for MINPACK is available * here, for * convenience, it is reproduced below.

        * - *
    01230x0 - * ↑
    - * ← Dtop
    + * ↑
    + * ← Dtop
    * ↓ *
    N / 2xN/2 - * ↑
    - * ← Dbottom
    + * ↑
    + * ← Dbottom
    * ↓ *
    + *
    * + * *
    * Minpack Copyright Notice (1999) University of Chicago. * All rights reserved @@ -687,7 +687,7 @@ public class MathArrays { * (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, * EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE * POSSIBILITY OF SUCH LOSS OR DAMAGES. - *
      * * @param v Vector of doubles. @@ -963,7 +963,7 @@ public class MathArrays { * ai bi to high accuracy. * It does so by using specific multiplication and addition algorithms to * preserve accuracy and reduce cancellation effects. - *
      + *
      * It is based on the 2005 paper * * Accurate Sum and Dot Product by Takeshi Ogita, Siegfried M. Rump, @@ -1411,7 +1411,7 @@ public class MathArrays { * Normalizes an array to make it sum to a specified value. * Returns the result of the transformation *
      -     *    x |-> x * normalizedSum / sum
      +     *    x |-> x * normalizedSum / sum
            * 
      * applied to each non-NaN element x of the input array, where sum is the * sum of the non-NaN entries in the input array. @@ -1595,15 +1595,14 @@ public class MathArrays { /** * This method is used * to verify that the input parameters designate a subarray of positive length. - *

      *

      + *
    1. returns false if the array is non-null, but + * length is 0.
    2. + * * * @param values the input array * @param begin index of the first array element to include @@ -1620,15 +1619,14 @@ public class MathArrays { /** * This method is used * to verify that the input parameters designate a subarray of positive length. - *

      *

      + *
    3. returns false if the array is non-null, but + * length is 0 unless allowEmpty is true
    4. + * * * @param values the input array * @param begin index of the first array element to include @@ -1670,7 +1668,6 @@ public class MathArrays { * This method is used * to verify that the begin and length parameters designate a subarray of positive length * and the weights are all non-negative, non-NaN, finite, and not all zero. - *

      *

        *
      • returns true iff the parameters designate a subarray of * positive length and the weights array contains legitimate values.
      • @@ -1683,9 +1680,9 @@ public class MathArrays { *
      • the weights array contains negative values
      • *
      • the start and length arguments do not determine a valid array
      * - *
    5. returns false
    6. if the array is non-null, but - * length is 0. - *

      + *
    7. returns false if the array is non-null, but + * length is 0.
    8. + * * * @param values the input array * @param weights the weights array @@ -1707,7 +1704,6 @@ public class MathArrays { * This method is used * to verify that the begin and length parameters designate a subarray of positive length * and the weights are all non-negative, non-NaN, finite, and not all zero. - *

      *

        *
      • returns true iff the parameters designate a subarray of * non-negative length and the weights array contains legitimate values.
      • @@ -1720,9 +1716,9 @@ public class MathArrays { *
      • the weights array contains negative values
      • *
      • the start and length arguments do not determine a valid array
      * - *
    9. returns false
    10. if the array is non-null, but - * length is 0 unless allowEmpty is true. - *

      + *
    11. returns false if the array is non-null, but + * length is 0 unless allowEmpty is true.
    12. + * * * @param values the input array. * @param weights the weights array. diff --git a/src/main/java/org/apache/commons/math4/util/MathUtils.java b/src/main/java/org/apache/commons/math4/util/MathUtils.java index 83b7d10d3..e42f44943 100644 --- a/src/main/java/org/apache/commons/math4/util/MathUtils.java +++ b/src/main/java/org/apache/commons/math4/util/MathUtils.java @@ -89,9 +89,9 @@ public final class MathUtils { * Normalize an angle in a 2π wide interval around a center value. *

      This method has three main uses:

      *
        - *
      • normalize an angle between 0 and 2π:
        + *
      • normalize an angle between 0 and 2π:
        * {@code a = MathUtils.normalizeAngle(a, FastMath.PI);}
      • - *
      • normalize an angle between -π and +π
        + *
      • normalize an angle between -π and +π
        * {@code a = MathUtils.normalizeAngle(a, 0.0);}
      • *
      • compute the angle between two defining angular positions:
        * {@code angle = MathUtils.normalizeAngle(end, start) - start;}
      • @@ -134,7 +134,7 @@ public final class MathUtils { *

        Reduce {@code |a - offset|} to the primary interval * {@code [0, |period|)}.

        * - *

        Specifically, the value returned is
        + *

        Specifically, the value returned is
        * {@code a - |period| * floor((a - offset) / |period|) - offset}.

        * *

        If any of the parameters are {@code NaN} or infinite, the result is diff --git a/src/main/java/org/apache/commons/math4/util/MultidimensionalCounter.java b/src/main/java/org/apache/commons/math4/util/MultidimensionalCounter.java index c73fe24f0..861fcd965 100644 --- a/src/main/java/org/apache/commons/math4/util/MultidimensionalCounter.java +++ b/src/main/java/org/apache/commons/math4/util/MultidimensionalCounter.java @@ -156,7 +156,7 @@ public class MultidimensionalCounter implements Iterable { } /** - * @throws UnsupportedOperationException + * @throws UnsupportedOperationException always */ @Override public void remove() { diff --git a/src/main/java/org/apache/commons/math4/util/Pair.java b/src/main/java/org/apache/commons/math4/util/Pair.java index f56de9b95..6a9ad86bf 100644 --- a/src/main/java/org/apache/commons/math4/util/Pair.java +++ b/src/main/java/org/apache/commons/math4/util/Pair.java @@ -18,7 +18,7 @@ package org.apache.commons.math4.util; /** * Generic pair. - *
        + *
        * Although the instances of this class are immutable, it is impossible * to ensure that the references passed to the constructor will not be * modified by the caller. diff --git a/src/main/java/org/apache/commons/math4/util/ResizableDoubleArray.java b/src/main/java/org/apache/commons/math4/util/ResizableDoubleArray.java index 87f2ec408..f4105125f 100644 --- a/src/main/java/org/apache/commons/math4/util/ResizableDoubleArray.java +++ b/src/main/java/org/apache/commons/math4/util/ResizableDoubleArray.java @@ -250,7 +250,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable { /** * Creates an instance with the specified properties. - *
        + *
        * Throws MathIllegalArgumentException if the following conditions * are not met: *

          diff --git a/src/test/java/org/apache/commons/math4/fitting/leastsquares/AbstractLeastSquaresOptimizerAbstractTest.java b/src/test/java/org/apache/commons/math4/fitting/leastsquares/AbstractLeastSquaresOptimizerAbstractTest.java index a7d7374b3..1e3a35d48 100644 --- a/src/test/java/org/apache/commons/math4/fitting/leastsquares/AbstractLeastSquaresOptimizerAbstractTest.java +++ b/src/test/java/org/apache/commons/math4/fitting/leastsquares/AbstractLeastSquaresOptimizerAbstractTest.java @@ -52,7 +52,7 @@ import static org.hamcrest.CoreMatchers.sameInstance; * href="http://www.netlib.org/minpack/ex/file17">file17 and file22 test files. The * redistribution policy for MINPACK is available here. - *

          + *

          * Concrete implementation of an optimizer. * */ diff --git a/src/test/java/org/apache/commons/math4/fitting/leastsquares/EvaluationTestValidation.java b/src/test/java/org/apache/commons/math4/fitting/leastsquares/EvaluationTestValidation.java index 3c637aeb3..ad1cbc2c5 100644 --- a/src/test/java/org/apache/commons/math4/fitting/leastsquares/EvaluationTestValidation.java +++ b/src/test/java/org/apache/commons/math4/fitting/leastsquares/EvaluationTestValidation.java @@ -33,9 +33,9 @@ import java.util.List; * {@link LeastSquaresProblem.Evaluation}, common to the * optimizer implementations in package * {@link org.apache.commons.math4.fitting.leastsquares}. - *
          + *
          * Not enabled by default, as the class name does not end with "Test". - *
          + *
          * Invoke by running *

          
            *  mvn test -Dtest=EvaluationTestValidation
          @@ -54,13 +54,13 @@ public class EvaluationTestValidation {
                * Using a Monte-Carlo procedure, this test checks the error estimations
                * as provided by the square-root of the diagonal elements of the
                * covariance matrix.
          -     * 
          + *
          * The test generates sets of observations, each sampled from * a Gaussian distribution. - *
          + *
          * The optimization problem solved is defined in class * {@link StraightLineProblem}. - *
          + *
          * The output (on stdout) will be a table summarizing the distribution * of parameters generated by the Monte-Carlo process and by the direct * estimation provided by the diagonal elements of the covariance matrix. @@ -166,10 +166,10 @@ public class EvaluationTestValidation { * and determine the parameter change that will result in the * normalized chi-square becoming larger by one than the value from * the best fit solution. - *
          + *
          * The optimization problem solved is defined in class * {@link StraightLineProblem}. - *
          + *
          * The output (on stdout) will be a list of lines containing: *
            *
          • slope of the straight line,
          • diff --git a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/NonLinearConjugateGradientOptimizerTest.java b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/NonLinearConjugateGradientOptimizerTest.java index 12b2897ed..71cfa179d 100644 --- a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/NonLinearConjugateGradientOptimizerTest.java +++ b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/NonLinearConjugateGradientOptimizerTest.java @@ -44,7 +44,7 @@ import org.junit.Test; * href="http://www.netlib.org/minpack/disclaimer">here, for * convenience, it is reproduced below.

            * - * + *
            *
            * Minpack Copyright Notice (1999) University of Chicago. * All rights reserved diff --git a/src/test/java/org/apache/commons/math4/util/FastMathStrictComparisonTest.java b/src/test/java/org/apache/commons/math4/util/FastMathStrictComparisonTest.java index 38e39cae4..4488c4274 100644 --- a/src/test/java/org/apache/commons/math4/util/FastMathStrictComparisonTest.java +++ b/src/test/java/org/apache/commons/math4/util/FastMathStrictComparisonTest.java @@ -36,9 +36,9 @@ import org.junit.runners.Parameterized.Parameters; /** * Test to compare FastMath results against StrictMath results for boundary values. *

            - * Running all tests independently:
            - * {@code mvn test -Dtest=FastMathStrictComparisonTest}
            - * or just run tests against a single method (e.g. scalb):
            + * Running all tests independently:
            + * {@code mvn test -Dtest=FastMathStrictComparisonTest}
            + * or just run tests against a single method (e.g. scalb):
            * {@code mvn test -Dtest=FastMathStrictComparisonTest -DargLine="-DtestMethod=scalb"} */ @SuppressWarnings("boxing") diff --git a/src/userguide/java/org/apache/commons/math4/userguide/sofm/ChineseRingsClassifier.java b/src/userguide/java/org/apache/commons/math4/userguide/sofm/ChineseRingsClassifier.java index f6a420b48..0aa80b1e7 100644 --- a/src/userguide/java/org/apache/commons/math4/userguide/sofm/ChineseRingsClassifier.java +++ b/src/userguide/java/org/apache/commons/math4/userguide/sofm/ChineseRingsClassifier.java @@ -50,7 +50,7 @@ import org.apache.commons.math4.exception.MathUnsupportedOperationException; *

          • "before.chinese.U.seq.dat": U-matrix of the SOFM before training
          • *
          • "after.chinese.U.seq.dat": U-matrix of the SOFM after training
          • *
          • "after.chinese.hit.seq.dat": Hit histogram after training
          • - *
              + *
            */ public class ChineseRingsClassifier { /** SOFM. */