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
6
votes
2 answers

Use Apache Commons Kalman Filter for 2D Positioning Estmation

I want to improve the accuracy of my indoor positioning framework and therefore apply the kalmanfilter. I found that the apache commons math library supports Kalmanfilter so I tried to use it and followed the tutorials:…
6
votes
1 answer

Calculating Percentile Score for every value in the list

I've been searching for a way to calculate the percentile rank for every value in a given list and I've been unsuccessful thus far. org.apache.commons.math3 gives you a way to fetch the pth percentile from a list of values but what I want is the…
LizardKing
  • 165
  • 1
  • 2
  • 8
5
votes
2 answers

How to add commons-math library in Android Studio

I am trying to import common-math library to my Android Studio project. I placed the file commons-math3-3.6.1.jar file in libs folder and in the gradle file I have this line: compile 'commons-math3-3.6.1.jar' But I get this error: ` Error:(32,…
I Madalina
  • 63
  • 1
  • 3
5
votes
2 answers

Using least square method with Commons Math and fitting

I was trying to use commons math to figure out the constants in a polynomial. It looks like the routine exists but I got this error. Does anyone see the issue? I was trying to convert this question to…
Berlin Brown
  • 11,504
  • 37
  • 135
  • 203
5
votes
1 answer

Exponential Fit with apache commons math

I'm trying to do an exponential fit on various points (x,y) with the formula A*EXP(-BX), trying to find A and B that best suit my points. double[] xx = curveFitter.fit(new ParametricUnivariateFunction() { public double value(double…
Rodriguez
  • 452
  • 1
  • 5
  • 16
5
votes
3 answers

How to calculate the inverse cumulative beta distribution function in java

I am looking for a java library / implementation which supports the calculation of the inverse cumulative distribution function for the beta distribution (aka estimation of quantiles) with reasonable precision. Of course I have tried apache commons…
steffen
  • 2,152
  • 4
  • 19
  • 30
4
votes
1 answer

Solve least squares regression in java

I am implementing a pandas DataFrame clone in Java and one of the functionalities I need is resampling. I have found a nice method to do it here. At the referenced link they use python, specifically the lstsq function from numpy that takes a matrix…
Santi Peñate-Vera
  • 1,053
  • 4
  • 33
  • 68
4
votes
1 answer

How to multiply a RealVector by a RealMatrix?

How can I multiply a given RealVector by a RealMatrix? I can't find any "multiply" method on both classes, only preMultiply but it seems not work: // point to translate final RealVector p = MatrixUtils.createRealVector(new double[] { 3, 4,…
Vertex
  • 2,682
  • 3
  • 29
  • 43
4
votes
1 answer

How to use SimplexSolver or SimplexOptimizer in java apache math?

I'm trying to use the apache commons math library version 3.5+ to solve an optimization problem. Basically, I'm trying to fit a (gamma) distribution to some data points. I can't seem to find any simple examples of how to use the new (version 3.5)…
homesalad
  • 477
  • 1
  • 5
  • 10
4
votes
2 answers

Commons Math: java.lang.ClassNotFoundException

I have this tiny bit of Java code: import java.io.*; import org.apache.commons.math3.linear.*; class Test { public static void main(String[] args){ RealVector alpha= MatrixUtils.createRealVector(new double[10]); …
user8472
  • 726
  • 1
  • 8
  • 16
4
votes
2 answers

Fast Fourier Transform difference in result between wolframalpha and commons-math

I have a question related with Fast Fourier Transform. I downloaded "Math Commons 3.2" library where is FFT. But the result is different than I expected. For instance, for data like, real: 1,0,0,0,0,0,0,0,0 imaginary: 0,0,0,0,0,0,0,0,0 I've…
Dawid D
  • 1,057
  • 13
  • 28
4
votes
1 answer

How to compute integration of a function in apache commons math3 library?

I am trying to integrate a very simple function. integral(x.dx). Instead of getting an answer of 1, I am getting an answer as 0, or 0.5 when I include limits from 0 to 1. Is there something I misunderstand about the implementation of the integration…
mtleis
  • 712
  • 1
  • 9
  • 28
4
votes
2 answers

Java - Computation of Derivations with Apache Commons Mathematic Library

I have a problem in using the apache commons math library. I just want to create functions like f(x) = 4x^2 + 2x and I want to compute the derivative of this function --> f'(x) = 8x + 2 I read the article about Differentiation…
4
votes
4 answers

Create a uniform random number based on a hash

I need a good pseudo random number based on a key consisting of a string and a long. I should get the same random number when I query using the same key and also, I should get a very different number if I query using a slightly different key, even…
fodon
  • 4,565
  • 12
  • 44
  • 58
3
votes
1 answer

Apache Commons math optimization "Hello World" example

I am attempting to implement the apache commons math optimization package. I am searching for a "hello world" example to solve a constrained non-linear system of two equations. My system is differentialable and consists of two independent variables.…
1
2
3
13 14