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

Calculate average request durration over time using Java + Apache commons math

I have a dataset of pairs that represent HTTP request samples (request time, request duration) By using apache math EmpiricalDistribution I can calculate the average request count over time like this double[] input = [request times from the…
Borislav Stoilov
  • 3,247
  • 2
  • 21
  • 46
1
vote
1 answer

Optimisation in Java Using Apache Commons Math

I'm trying to minimise a value in Java usingcommons-math. I've had a look at their documentation but I don't really get how to implement it. Basically, in my code below, I have a Double which has the expected goals in a soccer match and I'd like to…
1
vote
1 answer

How to get Apache commons math SummaryStatistics to use a better minimum?

org.apache.commons.math4.stat.descriptive.SummaryStatistics SummaryStatistics appears to use a naive implementation of min(). It uses the default constructor of the internal container which defaults to a zero value. If your data set is greater than…
chadum
  • 341
  • 1
  • 5
1
vote
0 answers

Multiple probabilities and EnumeratedDistribution in Java

Table Source The above table are a set of items and its ownership value amongst households in the UK. I'm using EnumeratedDistribution to generate a list of items based on a set of probability values which works fine. String[] applianceNames = new…
devturnip
  • 216
  • 1
  • 8
1
vote
1 answer

Spearman correlation of two m×n arrays (using Apache Commons Math)

How can I compute the Spearman correlation of two m×n arrays in Java? Right now I'm using Apache Commons Math, and all the examples I can find are for calculating the Spearman correlation of two 1×n arrays. I know how to do it using Excel, but I…
Nativ Vered
  • 83
  • 1
  • 8
1
vote
0 answers

How can I calculate an estimated x'y'z' using input arrays containing nominal and measured data points of the physical coordinate system?

My requirement is to provide a function in Java that uses linear algebra to find a 'calibrated' xyz location within a three-dimensional coordinate frame. The following is the interface I am trying to implement. The arguments can be changed to fit a…
Eric Hansen
  • 187
  • 1
  • 1
  • 10
1
vote
1 answer

Curve fitting through the Origin for Linear equation y = mx

Is there a way to force Apache commons math to fit a linear curve of the form (y = mx + 0) through the origin (0,0). So far I've used both PolynomialCurveFitter and SimpleCurveFitter, but none of them is returning a result that passes through the…
1
vote
1 answer

1D Array resizing with Spline Functions using Apache Math - How to?

I am looking for an example on resizing an 1D array using the Spline Functions with the Apache Commons - Math. What I need is a method to expand and/or shrink the input array (double[]). I could not find a good example trying to search online.
3xCh1_23
  • 1,491
  • 1
  • 20
  • 39
1
vote
0 answers

Apache GaussianCurveFitter runs into deadlock (?)

I am working on a code analyzing a periodic, noisy signal. The signal is given in my example as a CSV file containing about 382 periods of the signal in about 25000 bins which is loaded into my class. I split the data into subsets representing one…
WolfiG
  • 1,059
  • 14
  • 31
1
vote
1 answer

How can I get the value of a T-student distribution?

I have been reviewing the documentation of apache commons math and I find that it also calculates distributions, but I can not understand how it works. I have two values degrees of freedom = 13 confidence interval = 0.95 My problem is that it…
royer
  • 615
  • 1
  • 6
  • 19
1
vote
0 answers

Which parameter has the most impact on result in apache OLSMultipleLinearRegression

I'm experimenting with OLSMultipleLinearRegression and I wonder which of my parameters has most impact on the prediction. I do not understand which method in OLSMultipleLinearRegression that will return that information. static void test() { …
user1857773
  • 71
  • 2
  • 7
1
vote
1 answer

How do I fix a org.apache.commons.math3.exception.ConvergenceException

I am trying to make a 4 parameter Hill equation fit using Commons Math version 3.6.1 . I have also tried this with the 4.0-SNAPSHOT version as of 20 June 2018. I get the same result. I have a simple test that runs and doesn't throw an exception.…
Randy
  • 729
  • 5
  • 14
1
vote
1 answer

Apache Commons Math: where are the values for SummaryStatistics stored?

I am using Apache Commons Math in my web application. I need to use this class: SummaryStatistics However, I am puzzled by this description: Computes summary statistics for a stream of data values added using the addValue method. The data…
curious1
  • 14,155
  • 37
  • 130
  • 231
1
vote
2 answers

Computing the complex eigenvectors of a sparse matrix in Java

I am trying to compute the eigenvalues and eigenvectors of a potentially large and sparse non-symmetrical NxN matrix (N > 10^6). I would not need all of them, but maybe the first of them. Ideally, I'd like to do so from Java but could move to C,…
1
vote
2 answers

Apache commons math 3: always getting UnboundedSolutionException when constructing a model

i want to solve the following model with commons math 3 from apache: maximize: 30x + 40y s.t. x+y <= 240; 2x+y <= 320; x,y>=0; My code, related to the docs should be: // objective f = 30x + 40y + 0 LinearObjectiveFunction f = new…