[R] Is this an appropriate credit (Re: question on suppressing error messages with Rmath library)

Ranjan Maitra maitra at iastate.edu
Thu Mar 22 13:53:29 CET 2007


Dear list,

As a followup to my post here yesterday, I was wondering if this is an appropriate enough credit for the piece of code if experiments show promise and  I eventually make this publicly available as part of some other code to interested researchers and practitioners?

I am modifying pnt and dnt to serve my purpose of switching off low-precision warnings.


/* This program calculates the density and c.d.f of the non-central t 
   distribution. It is the same as the functions dnt and pnt in the R 
   mathemtical library, and indeed is copied with minor modifications
   from them. The modification is to stop warning messages: the modified
   functions are called pnoncentralt and dnoncentralt with the same arguments
   as pnt and dnt. 

  The reason for this separate function is to get around the warnings
  of low precision that come in when we use the R math functions. This
  can slow down the program considerably if there is a huge number of
  calls. Please use it responsibly.

  The function uses R's standalone mathematical library, hence the renaming 
  to avoid conflicts with pnt and dnt.

  Modified by Ranjan Maitra, Ames, IA 50014, USA. 2007/03//21.

  Since this is really a minor modification, all credits should go the R team 
  below. 
 
  If you modify this function in order to get around an undiscovered bug or to 
  speed it up/make it more accurate, please let me know. 

*/


I make no changes to any further acknowledgment comments that came with the pnt.c and dnt.c source files.

Is this good enough? Am I missing something I should be including?

Many thanks and best wishes,
Ranjan



On Wed, 21 Mar 2007 12:55:51 -0500 Ranjan Maitra <maitra at iastate.edu> wrote:

> Hi Luke,
> 
> Thanks! Sorry, my error which I did not realize until after sending out the program. I think I will just extricate the pnt code and compile that separately and that should be fine.
> 
> Thanks very much again, to you and everybody else who replied.
> 
> Best wishes,
> Ranjan
> 
> 
> On Wed, 21 Mar 2007 10:04:05 -0500 (CDT) Luke Tierney <luke at stat.uiowa.edu> wrote:
> 
> > You might get less noise in the replies if you were explicit about
> > using Rmath stand-alone and asked on r-devel.
> > 
> > As far as I can see you would need to compile a version of the
> > stand-alone library that defines the macros for handling of warning
> > messages differently -- the current one just calls printf in the
> > stand-alone library.  (You might be able to trick the linker into using
> > a version of printf for calls from within Rmath that does nothing, but
> > I suspect recompiling the sourses is easier.)  We will probably be
> > rethinking this soon in conjunction with some other changes to
> > vectorized math in R.
> > 
> > 
> > Best,
> > 
> > luke
> > 
> > On Wed, 21 Mar 2007, Ranjan Maitra wrote:
> > 
> > > Dear list,
> > >
> > > I have been using the Rmath library for quite a while: in the current instance, I am calling dnt (non-central t density function) repeatedly for several million. When the argument is small, I get the warning message:
> > >
> > > full precision was not achieved in 'pnt'
> > >
> > > which is nothing unexpected. (The density calls pnt, if you look at the function dnt.) However, to have this happen a huge number of times, when the optimizer is churning through the dataset is bothersome, but more importantly, a bottleneck in terms of speed. Is it possible to switch this off? Is there an setting somewhere that I am missing?
> > >
> > > Many thanks and best wishes,
> > > Ranjan
> > >
> > > ______________________________________________
> > > R-help at stat.math.ethz.ch mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
> > >
> > 
> > -- 
> > Luke Tierney
> > Chair, Statistics and Actuarial Science
> > Ralph E. Wareham Professor of Mathematical Sciences
> > University of Iowa                  Phone:             319-335-3386
> > Department of Statistics and        Fax:               319-335-3017
> >     Actuarial Science
> > 241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
> > Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu
> > 
>



More information about the R-help mailing list