[R] BesselI(.) {was "Existence of non-vectorised functions"}

Ben Bolker ben at zoo.ufl.edu
Wed Nov 27 15:06:06 CET 2002


  I have hacked together some pre-existing code (using C code from TOMS
written by D. E. Amos) for computing complex Bessel functions.  I 
considered sending it in, but (1) it's part of a larger package I haven't 
cleaned up yet, (2) I wasn't sure about the licensing/redistribution 
implications of the ACM license (permission required for commercial use: 
http://www.acm.org/pubs/copyright_policy/softwareCRnotice.html).
  If anyone would find it useful, drop me a line.

  Ben Bolker

On Wed, 27 Nov 2002, Martin Maechler wrote:

> In R, the Bessel functions have been available for long time,
> in fast and vectorized form  --- although for "numeric" (i.e
> non-complex) arguments only, and help(bessel) {e.g.} gives you
> 
>      besselI(x, nu, expon.scaled = FALSE)
>      besselK(x, nu, expon.scaled = FALSE)
>      besselJ(x, nu)
>      besselY(x, nu)
> 
> i.e. I.0(x) = besselI(x,0) \
>      I.1(x) = besselI(x,1)  > when x is numeric
>      I.p(x) = besselI(x,p) /
> 
> Only if you are interested in the non-numeric complex case,
> you (and even more the maintainer of CircStats) should
> investigate improving I.1 (and I.p) to work vectorized and you
> are right,  ifelse() might a good way to do so.
> 
> Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
> Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
> ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
> phone: x-41-1-632-3408		fax: ...-1228			<><
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-- 
318 Carr Hall                                bolker at zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list