search for: log1p

Displaying 20 results from an estimated 91 matches for "log1p".

Did you mean: log10
2003 Aug 25
1
Re: R 1.7.x and inaccurate log1p() on OpenBSD 3.2 and NetBSD 1.6 (PR#3979)
>> I have come across your reported log1p error (#2837) on a NetBSD (1.6W) >> system. I've just made further experiments on the deficient log1p() function on OpenBSD 3.2 and NetBSD 1.6 with this test program: % cat bug-log1p.c #include <stdio.h> #include <stdlib.h> #include <math.h> int main(int argc, char* a...
2003 Aug 25
0
(PR#3979) Re: Re: R 1.7.x and inaccurate log1p() on OpenBSD
Brian Ripley writes today: >> There is already a usable log1p implementation in src/nmath/log1p, for >> platforms without it. All we need to do is to arrange to use it on those >> systems with broken versions. That's not easy without access to such a >> platform to test it, though. I need the same kind of test in my own software, s...
2003 Aug 25
0
Re: R 1.7.x and inaccurate log1p() on OpenBSD 3.2 and NetBSD 1.6 (PR#3982)
Ray Brownrigg <ray@mcs.vuw.ac.nz> writes today about the inaccurate log1p() on NetBSD 1.6 and OpenBSD 3.2: >> Well, the source which I have access to doesn't bear that out. Interesting. Our NetBSD installation is pretty recent: % uname -a NetBSD netbsd.vm.math.utah.edu 1.6 NetBSD 1.6 (GENERIC) #0: Sun Sep 8 19:43:40 UTC 2002 autobuild@tgm.daemon.org...
2013 Nov 09
1
typo in help page for log1p
There is a small typo in the Source section of the help page for log1p: Source: 'log1p' and 'expm1' may be taken from the operating system, but if not available there are based on the Fortran subroutine 'dlnrel' there -> they Jen > sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-unknown-linux-gnu (64-bit) local...
2011 Apr 11
0
Question about GAM (mgcv)
Dear list, i'm using the GAM function from mgcv package. I'm using this syntax: model=gam(y~offset(x)+s(log1p(x1))+s(log1p(x2))+s(x3)+s(x4)+s(5),family=quasipoisson,data=data) and I'm sequentially dropping the single term with the highest non-significant p-value from the model and re-fitting until all term are significant. Now I have: model=gam(y~offset(x)+s(log1p(x1))+s(log1p(x2))+s(x5),family=quasi...
2003 Aug 26
0
Re: R 1.7.x and inaccurate log1p() on OpenBSD 3.2 and NetBSD 1.6 (PR#3984)
Ray Brownrigg <ray@mcs.vuw.ac.nz> writes today about the log1p() problems on NetBSD 1.6 and OpenBSD 3.2: >> Indeed, but since I have acess to a NetBSD developer, this is an >> opportunity to get it fixed for everyone. That's a start, but the reality is that it isn't enough. There will be many sites that don't upgrade O/S versions exc...
2002 Feb 28
4
pexp.c (PR#1335)
Full_Name: M Welinder Version: 1.4 OS: (src) Submission from: (NULL) (192.5.35.38) It seems to me that pexp can be improved in the lower_tail=TRUE and log_p=FALSE case by using expm1. Something like -expm1 (-x / scale); I think. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send
2002 Nov 15
1
Scaling part of a data frame
I have a 30 x 27 data frame, which I'm trying to scale and transform. Only I want to scale certain all variables except one (the dependent, which I want to log+1 transform). I can use split() and then scale() and log1p(), but I'm wondering if I can do this in one call. I tried apply(), but I could only get the whole data frame, not a part of it: > test <- apply(chin.sub, 2, log1p) is fine, but when I try to get only one column transformed > test <- apply(chin.sub, chin.sub$density, log1p) Er...
2020 May 22
1
pbirthday() for larger number of classes
...rts to issue warnings (see (*) below) for larger number of classes (R 4.0.0, R-devel ./src/library/stats/R/birthday.R:47). The default coincident = 2 is computed as 1 - prod((c:(c - n + 1))/rep(c, n)) where c = classes. Using exp(log(...)), one can derive the return value if(n > 0) 1 - exp(sum(log1p(-(0:(n-1))/c))) else 0. Simplifying this a bit further one obtains if(n >= 2) 1 - exp(sum(log1p(-(1:(n-1))/c))) else 0. For large c, sum(log1p(-(1:(n-1))/c)) is close to 0, so a more robust version would be to return if(n >= 2) -expm1(sum(log1p(-(1:(n-1))/c))) else 0 in the default case '...
2012 Feb 10
1
Formatting Y axis.
...-5 to display actual values so that way when reading it I know where my potential problems are. Would just save a lot of time and be an easier more understandable read. Here's sample code to plug in and see. x <- rlnorm(400, 2.3, .8) y <- rlnorm(400, 3, 1.6) plot.new() q1 <- qqnorm(log1p(y)) q2 <- qqnorm(log1p(x)) points( q1, col = "red") points( q2, col = "blue") abline( qqline(log1p(y), col = "red") ) abline( qqline(log1p(x), col = "blue") ) legend( "bottomright", inset = 0.02, title = "Loc_ID", c("Say...
2009 Apr 27
0
Patch proposal for logspace_sub
...re (very) small or the difference between the arguments are vary small. The logic behind logspace_sup, when called with arguments lx and ly, is: log( exp(lx) - exp(ly) ) = log( exp(lx) * ( 1 - exp(ly - lx) ) ) = lx + log( 1 - exp(ly - lx) ) = lx + log1p( - exp(ly - lx) ) and it is the last expression that is evaluated by logspace_sub. However the use of log1p for additional precision is appropriate if exp(ly-lx) is small, i.e. when lx >> ly. If |ly-lx| << 1, then exp(ly-lx) is close to one; if this term becomes numerically one, then...
2002 Jan 14
1
trouble using R Mathlib as standalone
...e cannot be reproduced without all my files, but I am hoping these errors have nothing to do with my code and that the answer will be obvious to those in the know. I get two different errors. The first one I am completely mystified by. It seems to have something to do with a double declaration of log1p which I have not used and not knowingly declared twice in any way. Neither lattice.hh nor mh.hh contain any math headers. The second one clearly has to do with the usage of GetRNGstate() and PutRNGstate() which are correct for use as entry points into the R executable but no longer correct for sta...
2017 Feb 17
4
Wish List: Extensions to the derivatives table
...s written in the S language. R is faster but less flexible, since that table is programmed in C. It would be useful if R provided a mechanism for extending the derivative table, or barring that, provided a broader table. Currently unsupported mathematical functions of one argument include expm1, log1p, log2, log10, cospi, sinpi, and tanpi. While manual differentiation of these proposed additions is straight-forward, their absence complicates what otherwise could be much simpler, such as using deriv() or deriv3() to generate functions, for example to use as an nls model. Thanks, [[alternative...
2002 Jul 25
4
src/nmath/pgeom.c (PR#1834)
Full_Name: Morten Welinder Version: 1.5.1 OS: Solaris/Linux Submission from: (NULL) (192.5.35.38) The line return log(1 - p) * (x + 1); looks like it has problems for p near 1. I would suggest rewriting it to return log1p (-p) * (x + 1); -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-de...
2004 Jun 21
2
Cross build Makefile
...to use Yan and Rossini's Makefile for cross building Windows versions of R packages in Linux with R 1.9.0. When compiling R with the mingw tools I get an error about expm1 being undeclared when first found at src/main/arithmetic.c:1019 If I fiddle a bit with it later on I also get errors about log1p bein undeclared. Any idea what should I look for? I am using R 1.9.0 in Debian, with R-mathlib avaliable, and gcc 3.3. Thanks, iago
2004 Jun 21
2
Cross build Makefile
...to use Yan and Rossini's Makefile for cross building Windows versions of R packages in Linux with R 1.9.0. When compiling R with the mingw tools I get an error about expm1 being undeclared when first found at src/main/arithmetic.c:1019 If I fiddle a bit with it later on I also get errors about log1p bein undeclared. Any idea what should I look for? I am using R 1.9.0 in Debian, with R-mathlib avaliable, and gcc 3.3. Thanks, iago
2009 Sep 06
2
question about ... passed to two different functions
...aluates the log unnormalized density of the ### Markov chain we want to run (log likelihood + log prior) ludfun <- function(beta) { stopifnot(is.numeric(beta)) stopifnot(length(beta) == ncol(modmat)) eta <- as.numeric(modmat %*% beta) logp <- ifelse(eta < 0, eta - log1p(exp(eta)), - log1p(exp(- eta))) logq <- ifelse(eta < 0, - log1p(exp(eta)), - eta - log1p(exp(- eta))) logl <- sum(logp[y == 1]) + sum(logq[y == 0]) val <- logl - sum(beta^2) / 2 return(val) } beta.initial <- as.vector(out$coefficients) out <- metrop(ludfun...
2017 Feb 17
1
Wish List: Extensions to the derivatives table
...ative of more flexible differentiation does not seem to be a difficult addition to R. In S+ (which does not have deriv3) it would simply involve adding the following lines to the switch statement in D expm1 = make.call("*", make.call("exp", expr[[2]]), D(expr[[2]], name)), log1p = make.call("/", D(expr[[2]], name), make.call("+", 1., expr[[2]])), log2 = make.call("/", make.call("/", D(expr[[2]], name), expr[[2]]), quote(log(2)) ), log10 = make.call("/", make.call("/", D(expr[[2]], name), expr[[2]]), quote(log(...
2011 Feb 09
1
Problem installing MCMCpack on SPARC Solaris 10
...opt/csw/include -KPIC -g -c MCMCSVDreg.cc -o MCMCSVDreg.o "error.h", line 598: Error: The function "abort" must have a prototype. "distributions.h", line 550: Error: The function "trunc" must have a prototype. "distributions.h", line 550: Error: log1p is not a member of file level. "distributions.h", line 566: Error: The function "trunc" must have a prototype. "distributions.h", line 566: Error: log1p is not a member of file level. "distributions.h", line 2177: Error: sqrt is not a member of file level. 6...
2003 May 04
0
R-1.7.0 build feedback: NetBSD 1.6 (PR#2837): final report
...incomplete gamma function tests pass. The tests reveal that OpenBSD has these anomalies: exp(-Inf) -> NaN, exp(Inf) -> Inf, but exp(-MAXNORMAL) -> 0 and exp(MAXNORMAL) -> +Inf, as expected. Examination of the R-1.7.0/src/nmath/pweibull.c file shows that pweibull() calls pow(), log(), log1p(), and R_D_exp(), and the latter is defined in ./src/nmath/dpq.h as #define R_D_exp(x) (log_p ? (x) : exp(x)) /* exp(x) */ I therefore tried some experiments with hoc, using log1p() as the most likely candidate for errors, since it is quite new, and much less used than exp() and lo...