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

  • SEARCH
  • Home
  • 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 7043229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:15:50+00:00 2026-05-28T02:15:50+00:00

I’m using Incanter and Parallel Colt for a project, and need to have a

  • 0

I’m using Incanter and Parallel Colt for a project, and need to have a function that returns the modified Bessel function of an order n for a value v.

The Colt library has two methods for order 0 and order 1, but beyond that, only a method that return the Bessel function of order n for a value v (cern.jet.math.tdouble.Bessel/jn).

I’m trying to build the R function, dskellam(x,lambda1, lambda2) for the Skellam distribution, in Clojure/Java

Is there something I can do with the return value of the Bessel method to convert it to a modified Bessel?

  • 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-28T02:15:50+00:00Added an answer on May 28, 2026 at 2:15 am

    No, the difference isn’t a simple transformation, as these links make clear:

    http://mathworld.wolfram.com/BesselFunctionoftheFirstKind.html

    http://mathworld.wolfram.com/ModifiedBesselFunctionoftheFirstKind.html

    I’d have a look at “Numerical Recipes” or Abramowitz & Stegun. It wouldn’t be hard to implement your own in a short period of time.

    Here’s a Java implementation of the modified Bessel functions:

    package math;
    
    /**
     * Functions that are not part of standard libraries
     * User: Michael
     * Date: 1/9/12
     * Time: 9:22 PM
     */
    public class Functions {
    
        public static final double ACC = 4.0; 
        public static final double BIGNO = 1.0e10;
        public static final double BIGNI = 1.0e-10;
    
        public static void main(String[] args) {
            double xmin = ((args.length > 0) ? Double.valueOf(args[0]) : 0.0);
            double xmax = ((args.length > 1) ? Double.valueOf(args[1]) : 4.0);
            double dx = ((args.length > 2) ? Double.valueOf(args[2]) : 0.1);
            System.out.printf("%10s %10s %10s %10s\n", "x", "bessi0(x)", "bessi1(x)", "bessi2(x)");
            for (double x = xmin; x < xmax; x += dx) {
                System.out.printf("%10.6f %10.6f %10.6f %10.6f\n", x, bessi0(x), bessi1(x), bessi(2, x));
            }
        }
    
        public static final double bessi0(double x) {
            double answer;
            double ax = Math.abs(x);
            if (ax < 3.75) { // polynomial fit
                double y = x / 3.75;
                y *= y;
                answer = 1.0 + y * (3.5156229 + y * (3.0899424 + y * (1.2067492 + y * (0.2659732 + y * (0.360768e-1 + y * 0.45813e-2)))));
            } else {
                double y = 3.75 / ax;
                answer = 0.39894228 + y * (0.1328592e-1 + y * (0.225319e-2 + y * (-0.157565e-2 + y * (0.916281e-2 + y * (-0.2057706e-1 + y * (0.2635537e-1 + y * (-0.1647633e-1 + y * 0.392377e-2)))))));
                answer *= (Math.exp(ax) / Math.sqrt(ax));
            }
            return answer;
        }
    
        public static final double bessi1(double x) {
            double answer;
            double ax = Math.abs(x);
            if (ax < 3.75) { // polynomial fit
                double y = x / 3.75;
                y *= y;
                answer = ax * (0.5 + y * (0.87890594 + y * (0.51498869 + y * (0.15084934 + y * (0.2658733e-1 + y * (0.301532e-2 + y * 0.32411e-3))))));
            } else {
                double y = 3.75 / ax;
                answer = 0.2282967e-1 + y * (-0.2895312e-1 + y * (0.1787654e-1 - y * 0.420059e-2));
                answer = 0.39894228 + y * (-0.3988024e-1 + y * (-0.362018e-2 + y * (0.163801e-2 + y * (-0.1031555e-1 + y * answer))));
                answer *= (Math.exp(ax) / Math.sqrt(ax));
            }
            return answer;
        }
    
        public static final double bessi(int n, double x) {
            if (n < 2)
                throw new IllegalArgumentException("Function order must be greater than 1");
            if (x == 0.0) {
                return 0.0;
            } else {
                double tox = 2.0/Math.abs(x);
                double ans = 0.0;
                double bip = 0.0;
                double bi  = 1.0;
                for (int j = 2*(n + (int)Math.sqrt(ACC*n)); j > 0; --j) {
                    double bim = bip + j*tox*bi;
                    bip = bi;
                    bi = bim;
                    if (Math.abs(bi) > BIGNO) {
                        ans *= BIGNI;
                        bi *= BIGNI;
                        bip *= BIGNI;
                    }
                    if (j == n) {
                        ans = bip;
                    }
                }
                ans *= bessi0(x)/bi;
                return (((x < 0.0) && ((n % 2) == 0)) ? -ans : ans);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't

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.