Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 531835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:20:32+00:00 2026-05-13T09:20:32+00:00

Ok so I’m trying to use Apache Commons Math library to compute a double

  • 0

Ok so I’m trying to use Apache Commons Math library to compute a double integral, but they are both from negative infinity (to around 1) and it’s taking ages to compute. Are there any other ways of doing such operations in java? Or should it run “faster” (I mean I could actually see the result some day before I die) and I’m doing something wrong?

EDIT: Ok, thanks for the answers. As for what I’ve been trying to compute it’s the Gaussian Copula:
alt text

So we have a standard bivariate normal cumulative distribution function which takes as arguments two inverse standard normal cumulative distribution functions and I need integers to compute that (I know there’s a Apache Commons Math function for standard normal cumulative distribution but I failed to find the inverse and bivariate versions).

EDIT2: as my friend once said “ahhh yes the beauty of Java, no matter what you want to do, someone has already done it” I found everything I needed here http://www.iro.umontreal.ca/~simardr/ssj/ very nice library for probability etc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:20:33+00:00Added an answer on May 13, 2026 at 9:20 am

    There are two problems with infinite integrals: convergence and value-of-convergence. That is, does the integral even converge? If so, to what value does it converge? There are integrals which are guaranteed to converge, but whose value it is not possible to determine exactly (try the integral from 1 to infinity of e^(-x^2)). If it can’t be exactly returned, then an exact answer is not possible mathematically, which leaves only approximation. Apache Commons uses several different approximation schemes, but all require the use of finite bounds for correctness.

    The best way to get an appropriate answer is to repeatedly evaluate finite integrals, with ever increasing bounds, and compare the results. In pseudo-code, it would look something like this:

    double DELTA = 10^-6//your error threshold here
    double STEP_SIZE = 10.0;
    double oldValue=Double.MAX_VALUE;
    double newValue=oldValue;
    double lowerBound=-10; //or whatever you want to start with--for (-infinity,1), I'd
                           //start with something like -10
    double upperBound=1;
    
    do{
         oldValue = newValue;
    
         lowerBound-= STEP_SIZE;
         newValue = integrate(lowerBound,upperBound); //perform your integration methods here
    }while(Math.abs(newValue-oldValue)>DELTA);
    

    Eventually, if the integral converges, then you will get enough of the important stuff in that widening the bounds further will not produce meaningful information.

    A word to the wise though: this kind of thing can be explosively bad if the integral doesn’t converge. In that case, one of two situations can occur: Either your termination condition is never satisfied and you fall into an infinite loop, or the value of the integral oscillates indefinitely around a value, which may cause your termination condition to be incorrectly satisfied (giving incorrect results).

    To avoid the first, the best way is to put in some maximum number of steps to take before returning–doing this should stop the potentially infinite loop that can result.

    To avoid the second, hope it doesn’t happen or prove that the integral must converge (three cheers for Calculus 2, anyone? ;-)).

    To answer your question formally, no, there are no other such ways to perform your computation in java. In fact, there are no guaranteed ways of doing it in any language, with any algorithm–the mathematics just don’t work out the way we want them to. However, in practice, a lot (though by no means all!) of the practical integrals do converge; its been my experience that only about ~20 iterations will give you an approximation of reasonable accuracy, and Apache should be fast enough to handle that without taking absurdly long.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 340k
  • Answers 340k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There are many ways. For example, you can use conv.… May 14, 2026 at 4:47 am
  • Editorial Team
    Editorial Team added an answer Pros: It has some nice new features Cons: Support for… May 14, 2026 at 4:47 am
  • Editorial Team
    Editorial Team added an answer The graphics redraw should not affect audio playback. I have… May 14, 2026 at 4:47 am

Related Questions

I want use html5's new tag to play a wav file (currently only supported
Ok so I thought it was fixed, but I'm getting totally inconsistent results. I
Ok so I've ordered Applying Domain-Driven Design and Patterns: Using .Net , but while
OK so I'm looking a some code which looks roughly like this: void DoSomething(object
Ok so I have an abstract base class called Product, a KitItem class that

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.