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

Find integer solutions to a set of equations with more unknowns than equations

I am trying to build a system for which I need to find a solution to a set of linear equations with (much) more variables than equations. The problem boils down to the following: Imagine a set of equations: A = A1*X1 + A2*X2 + ... + AnXn B = B1*X1…
15
votes
2 answers

Using Apache Commons Math to determine confidence intervals

I have a set of benchmark data for which I compute summary statistics using Apache Math Commons. Now I want to use the package to compute confidence intervals for the arithmetic means of e.g. running time measurements. Is this possible at all? I am…
Jannik Jochem
  • 1,516
  • 1
  • 14
  • 28
12
votes
3 answers

Difference between R.loess and org.apache.commons.math LoessInterpolator

I'm trying to compute the convert a R script to java using the apache.commons.math library. Can I use org.apache.commons.math.analysis.interpolation.LoessInterpolator in place of R loess ? I cannot get the same result. EDIT. here is a java program…
Pierre
  • 34,472
  • 31
  • 113
  • 192
12
votes
5 answers

how to generate bins for histogram using apache math 3.0 in java?

I have been looking for away to generate bins for specific dataset (by specifying lower band, upper band and number of bins required) using apache common math 3.0. I have looked at Frequency…
Sami
  • 7,797
  • 18
  • 45
  • 69
10
votes
0 answers

"commons-math"-like Implementation for BigDecimal / BigInteger

I'm looking for suggestions regarding a third-party library to use for statistical analysis on numbers encoded in BigDecimal / BigInteger. Apache commons-math contains all the ideal functionality (it's DescriptiveStatistics and SummaryStatistics)...…
jwa
  • 3,239
  • 2
  • 23
  • 54
8
votes
1 answer

Apache common SimplexSolver ObjectiveFunction for maximizing the sum of values in a matrix

I am trying to solve the following linear problem by using the Simplex solver from apache-commons: org.apache.commons.math3.optim.linear.SimplexSolver. n is the number of rows m is the number of columns L is a global limit for the sum value of each…
8
votes
2 answers

Standard deviation with Apache Commons Math

I am computing the SD of a vector using Apache Commons Math. The problem: I get different values than by hand DescriptiveStatistics stats = new…
dotwin
  • 1,302
  • 2
  • 11
  • 31
7
votes
1 answer

Interpolate function using Apache Commons Math

I'm trying to implement some Interpolation functions to plot some values where the X value = Date.seconds and the Y value = double. I'v been researching using the Apache Commons Math lib to achieve this and I've found a method I think I might be…
JTK
  • 1,469
  • 2
  • 22
  • 39
7
votes
1 answer

Choice of algorithm for incremental floating point mean (java)

I want to compute the mean of a stream of doubles. This is a simple task that only requires storing a double and an int. I was doing this using the apache commons SummaryStatistics class. However, when testing I noticed that the SummaryStatistics…
Erik
  • 6,470
  • 5
  • 36
  • 37
7
votes
2 answers

Generating random integers within range with a probability distribution

I have a problem where I want to generate a set of random integer values between 1 and 5 inclusive using a probability distribution. Poisson and Inverse Gamma are two distributions that show the characteristics I am after (majority at mean, less…
jmc
  • 620
  • 14
  • 24
7
votes
2 answers

Java math package for inverse cumulative distributions of skewed normal together with poisson and exponential

I am looking for a package that provides mathematical functions for the non-symmetrical (skewed) normal distribution and also the poisson and exponential distributions. I originally looked at the Colt package but it does not provide the inverse…
jbx
  • 21,365
  • 18
  • 90
  • 144
6
votes
2 answers

How to print a RealMatrix with table formating

I'm using apache-commons-math RealMatrix on my project to handle matrix operations, however I can't print it with proper formatting. For every matrix i have so far it goes like this: double coord[][] = new double[3][3]; …
Jows
  • 61
  • 3
6
votes
1 answer

Weibull Parameter estimation using Apache Commons Math

I need to estimate the shape and scale parameters of a Weibull distribution from a sample data using MLE. I checked the WeibullDistribution class of Apache commons Math but it doesn't have such functionality. Any suggestion? I need to use the class…
Tesse M
  • 101
  • 1
  • 5
6
votes
3 answers

Commons-math rounding double

I'm using commons-math 3.6.1. I need to round a double value to 2 decimal Let's assume this is my double value: double d = 400.54540997260267; Now by rounding this number I was expecting as result 400.54 Instead if my number was double d1 =…
Angelo Immediata
  • 6,635
  • 4
  • 33
  • 65
6
votes
2 answers

Difference in calculating eigenvectors wih Java and Python

As a current task, I need to calculate eigenvalues and eigenvectors for a 120*120 matrix. For start, I tested those calculations on a simple 2 by 2 matrix in both Java (Apache Commons Math library) and Python 2.7 (Numpy library). I have a problem…
borgmater
  • 658
  • 3
  • 11
  • 35
1
2 3
13 14