Questions tagged [apache-commons-math]

Apache Commons Math is a library of lightweight, self-contained mathematics and statistics components addressing the most common problems not available in the Java programming language or Apache Commons Lang.

Apache Commons Math is a library of lightweight, self-contained mathematics and statistics components addressing the most common problems not available in the Java programming language or Apache Commons Lang.

Binaries and source code for Apache Commons Math can be downloaded from here.

202 questions
2
votes
1 answer

How to populating matrices in the Apache Commons Kalman filter Implementation

Background : To give everyone some background I am trying to smoothen GPS data received from a device using Kalman filter (Apache Common implementation). What kind of dynamic noises should I include in my implementation with respect to matrix…
2
votes
1 answer

Apache commons math optimization get best solution each iteration

Apache Commons Math has optimization classes that can optimize some objective function, and typically a maximum number of evaluations has to be set for an optimizer. In https://stackoverflow.com/a/32532514/3229995 there is a working small Java…
tkja
  • 1,950
  • 5
  • 22
  • 40
2
votes
1 answer

How to use Apache commons-math RealVector sparse iterators?

I would like to iterate through the non-zero values in a RealVector. I notice that the method RealVector.sparseIterator() can do this: "Create a sparse iterator over the vector, which may omit some entries. The ommitted entries are either exact…
zig
  • 47
  • 1
  • 6
2
votes
2 answers

Is there an equivalent function for anova.lm() in Java?

I am comparing two linear models in R with Anova, and I would like to do the same thing in Java. To simplify it, I took the example code from…
Niek de Klein
  • 8,524
  • 20
  • 72
  • 143
2
votes
2 answers

Newton-Raphson method using the Math.Commons library

I made a test program to try the NewtonRaphsonSolver class through the Apache Commons Math library. Newton's method is used to find roots for a given function. The test program that I wrote references the cos(x) function (I have a more difficult…
Axion004
  • 943
  • 1
  • 11
  • 37
2
votes
3 answers

Get the integral part of a BigFraction, as a BigInteger

What is an easy way to get the integral part of a BigFraction as a BigInteger? Basically I want the same result that the intValue and longValue methods return but with arbitrary precision. I also want to avoid rounding so indirect conversion via a…
finnw
  • 47,861
  • 24
  • 143
  • 221
2
votes
2 answers

Calculating TDIST using Apache Commons library

I'm trying to calculate a 2 tailed Student Distribution using commons-math. I'm using Excel to compare values and validate if my results are correct. So Using excel to calculate TDIST(x, df, t) with x = 5.968191467, df = 8, tail t =…
2
votes
0 answers

Apache Commons Math: Stepwise Regression

I am using OLSMultipleLinearRegression from Apache Commons Math in order to do curve fitting and it works pretty well and is really performant. However, this way I get an overfit as all variables are included in the model. Simply deleting the least…
2
votes
1 answer

Add parameters constraints to Apache Math3 fitting

I'm developing a fitting application using Apache commons math3. I have successfully created the ParametricUnivariateFunction public class MyFunc implements ParametricUnivariateFunction { @Override public double value(double x, double... Parameters)…
2
votes
0 answers

Checking for normal distribution hypothesis of discrete dataset

I am newbie in statistics topic, so I guess it might be something obvious that I am missing here. Basically I would like to examine if some double array of integer values (histogram) conforms to Normal distribution (mean and standard deviation is…
Grzegorz Szpetkowski
  • 36,988
  • 6
  • 90
  • 137
2
votes
1 answer

Constructing an instance of EnumeratedDistribution in Scala

I am having a terrible time doing some trivial: creating a new instance of org.apache.commons.math3.distribution.EnumeratedDistribution in Scala. Best I can make out the following should work... import…
davidrpugh
  • 4,363
  • 5
  • 32
  • 46
2
votes
0 answers

Performing in-place calculations with Commons Math's RealMatrix?

I am using the Apache Commons Math library to perform some calculations and I need to accumulate a number of matrices. The RealMatrix interface seems designed to return results, rather than to store results in-place. Should I just make due with…
sourcenouveau
  • 29,356
  • 35
  • 146
  • 243
2
votes
1 answer

Use of DerivativeStructure in Apache Commons Math

I am having a hard time understanding how to use DerivativeStructure in Apache Commons Math. I have a Logit function for which I would like to get the first order derivative. Then I would like to get the value of that derivative on multiple distinct…
Jean Logeart
  • 52,687
  • 11
  • 83
  • 118
2
votes
1 answer

Licensing Android Apache Commons Math

I am about to release my first commercial software ever. I didnt study something related to programming so i am facing a problem here, which is licensing. I am not native english speaking, so i have a little bit of a problem when i read the Apache…
stefple
  • 1,007
  • 17
  • 28
1
vote
1 answer

need help understanding Apache Commons Math BracketFinder

I will start off by saying that this feels like it should be easy... but it's not entirely obvious to me. I am trying to use the BrentOptimizer to find local minima and maxima of a function. I have an idea of the periodicity of these, and I feel…