From r.hankin at noc.soton.ac.uk  Mon Mar 10 13:17:32 2008
From: r.hankin at noc.soton.ac.uk (Robin Hankin)
Date: Mon, 10 Mar 2008 12:17:32 +0000
Subject: [Rd] Re Bessel functions of complex argument
In-Reply-To: <alpine.LFD.1.00.0803101056320.6210@gannet.stats.ox.ac.uk>
References: <2CFB86B5-515C-4968-811C-E2F8716D13DB@ex.ac.uk>
	<73ED823A-9F13-4852-A708-633BEA1BE235@noc.soton.ac.uk>
	<18389.3354.944541.776906@stat.math.ethz.ch>
	<alpine.LFD.1.00.0803101056320.6210@gannet.stats.ox.ac.uk>
Message-ID: <062CF2ED-7499-4CFE-8103-FA5C4C65DA99@noc.soton.ac.uk>


On 10 Mar 2008, at 11:03, Prof Brian Ripley wrote:

> On Mon, 10 Mar 2008, Martin Maechler wrote:
>
>> {Diverted from an R-help thread}
>>
>>>>>>> "Robin" == Robin Hankin <r.hankin at noc.soton.ac.uk>
>>>>>>>    on Mon, 10 Mar 2008 08:49:06 +0000 writes:
>>
>>   Robin> Hello Baptiste Bessel functions with complex
>>   Robin> arguments are not supported in R.
>>
>> Hi Robin,
>> have you looked at *how* pari/gp does this?
>> If they have a C routine, it might be worth considering to add
>> ``the'' complex Bessel functionality to R.
>
> To an R package, surely?  They hardly seem important enough for base  
> R.
>
> There are C implementations in several places, e.g. ACM algorithm  
> 644 (also netlib.org/amos).
>


Thanks for this.  I'll have a look at netlib.  Perhaps a wrapper for  
netlib,
  along the lines of  the gsl package, would be possible.  I also need
the gamma function with complex  arguments and I suspect
that this is included.

PARI/GP  is a large multi-developer effort, and provides an
environment not unlike R but geared towards pure mathematics rather
than statistics.  It includes arbitrary-precision arithmetic and many
pure maths constructs such as number theory and p-adic metrics.

(I must confess to being not terribly familiar with the
Bessel suite; I only  really know about PARI/GP's  elliptic  
functions).  There
is no easy way to access the  code  for any specific functionality
in isolation, AFAICS.

One of my "longer-term" plans is to write a package that includes
a wrapper for GP (PARI is the front end, a command line wrapper) but
this is not entirely straightforward. Implementing a useful wrapper  
proved
to be rather tricky.  I expected that  the methodology would
approximate the gsl package but this was not the case:
many of the features of PARI/GP are alien to the precepts and
tenets of R.   My attempts stalled a couple of years ago after
I finished the elliptic package which included a fit-for-purpose, but
very very basic, wrapper for two or three functions.

Notwithstanding this, I think that an R wrapper for PARI/GP would
be very desirable.   Comments anyone?





--
Robin Hankin
Uncertainty Analyst and Neutral Theorist,
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743



[Rd] Re Bessel functions of complex argument
Robin Hankin