Ranjan Maitra
2007-Mar-21 13:38 UTC
[R] question on suppressing error messages with Rmath library
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
James W. MacDonald
2007-Mar-21 14:06 UTC
[R] question on suppressing error messages with Rmath library
Hi Ranjan, 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?See ?options, particularly the section on 'warn'. Best, Jim> > 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.-- James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
ronggui
2007-Mar-21 14:08 UTC
[R] question on suppressing error messages with Rmath library
op <- options(warn=-1) [main codes here] options(op) On 3/21/07, Ranjan Maitra <maitra at iastate.edu> 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. >-- Ronggui Huang Department of Sociology Fudan University, Shanghai, China
Luke Tierney
2007-Mar-21 15:04 UTC
[R] question on suppressing error messages with Rmath library
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