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
0 answers

apache-commons-matrix for clojure not playing well with core.matrix?

I'm trying to use https://github.com/adereth/apache-commons-matrix to access the functionality of Apache Commons Math, via the Maven repo https://mvnrepository.com/artifact/org.apache.commons/commons-math3 . My main guide is Matt…
rikb
  • 630
  • 5
  • 18
2
votes
1 answer

QR-Factorization in least square sense to solve A * w = b

I'm trying to implement the QR24-Algorithm to calibrate flange/tool and robot/world from this paper by Floris Ernst (2012). I need to solve an equation M_i*X - Y*N_i = 0 where M_i and N_i are known and i from 1 to the number of measurements and X…
Bratpommes
  • 39
  • 4
2
votes
0 answers

ClassNotFoundException: org.apache.commons.math3.distribution.EnumeratedDistribution

I'm using the apache-commons-math library to generate a number of items from an enumerated distributed list. Upon writing the code I get no errors and the Netbeans code completion successfully suggests the imports needed for this code. There are no…
Nathan
  • 23
  • 3
2
votes
1 answer

How do I find the pseudo-inverse from Apache Commons Math - Java library

According to this code. It can finding the pseudo-inverse by using Apache Commons Math library. RealMatrix Swinv = new LUDecomposition(Sw).getSolver().getInverse(); // MATLAB: Swinv = pinv(Sw) But even if Sw is square, I can get the exception…
euraad
  • 2,467
  • 5
  • 30
  • 51
2
votes
1 answer

How to use correctly ZipfDistribution from Apache commons math library in Java?

I want to create a source of data (in Java) based on words (from a dictionary) that follow a Zipf distribution. So I come to ZipfDistribution and NormalDistribution of the Apache commons library. Unfortunately, information about how to use these…
Felipe
  • 7,013
  • 8
  • 44
  • 102
2
votes
2 answers

linear programming - how to set variable to be 0 or 1?

I am trying to apply linear programming for my problem using Apache commons Math library. I saw an example online to solve the following example max. 3X + 5Y s.t. 2X + 8Y <= 13 5X - Y <= 11 X >= 0, Y >= 0 The code is like…
Laodao
  • 1,547
  • 3
  • 17
  • 39
2
votes
0 answers

How can I get the residuals from a curve using Apache Commons Math

I'm trying to use Commons Math to fit polynomial curves to a dataset. I have: created a PolynomialCurveFitter, got the coefficients, created a polynomial function with those coefficients, and created an array of values generated by the…
L. Blanc
  • 2,150
  • 2
  • 21
  • 31
2
votes
2 answers

Compile Apache common math for iOS or alternatives

I am trying to compile Apache math for iOS. I am using this fork : https://github.com/j2objc-contrib/j2objc-common-libs-e2e-test This library is using J2Objc version : 0.9.8 and J2Objc-Graddle plugin is also old and it was throwing an error…
Iducool
  • 3,543
  • 2
  • 24
  • 45
2
votes
1 answer

Apache Math generate distribution from data set

In Java's Apache Math library, is there any way to take a set of data points and generate a distribution object from it? More specifically, I am trying to create a BetaDistribution object from a set of data but the only way to create one is by…
Lezorte
  • 473
  • 1
  • 5
  • 13
2
votes
1 answer

Using Apache math for linear regression with weights

I've been using Apache math for a while to do a multiple linear regression using OLSMultipleLinearRegression. Now I need to extend my solution to include a weighting factor for each data point. I'm trying to replicate the MATLAB function fitlm. I…
robkin
  • 56
  • 5
2
votes
0 answers

Apache Commons Math Optim: should I use 4.0 or 3.6.1? 4.0 seems dead, but 3.6.1 is deprecated…

I want to use Apache Commons Math for Optimisation, but 3.6.1 contains APIs that have been deprecated in anticipation of 4.0, however, the latter seems to have received little development since 2016. Any advice on which version to use would be…
2
votes
1 answer

Calculate R-Square for PolynomialCurveFitter in Apache commons-math3

Apache commons-math3 (version 3.6.1) classes like OLSMultipleLinearRegression, SimpleRegression provide a method that calculates RSquare (i.e calculateRSquared(), getRSquare() respectively). But I am not able to find any such method for…
tuk
  • 5,941
  • 14
  • 79
  • 162
2
votes
0 answers

Apache math3 erfInv fails on very small values, while Excel NORM.S.INV does it right…

I have to compute in Java the same result as Excel NORM.S.INV. (actually using LOI.NORMALE.STANDARD.INVERSE in French, that's NORM.S.INV in English) I use org.apache.commons.math3.special.Erf.erfInv this way: return Math.sqrt(2) * Erf.erfInv(2 * p -…
Sxilderik
  • 796
  • 6
  • 20
2
votes
1 answer

commons-math differentiation result is 0

I'm trying to use commons-math library for some numerical differentiation task. I've built a very simple function using DerivativeStructures which I thought would work; apparently I was wrong. public static void main(String[] args) { …
Display name
  • 637
  • 1
  • 7
  • 16
2
votes
1 answer

Multiply vector by matrix

How can I multiply RealVector by matrix (v*M) in apache-commons-math library? I found only multiply Matrix by Matrix and Matrix by RealVector.
Jerome
  • 35
  • 6