search for: fmax2

Displaying 20 results from an estimated 33 matches for "fmax2".

Did you mean: fmax
2002 Jul 22
2
typsize and fscale arguments to nlm
Dear R list members, I have a question about the proper use of the typsize and fscale arguments to nlm. I use nlm in my sem package to fit general structural-equation models, which entails maximizing a multinormal likelihood with respect to parameters that represent regression coefficients and covariances of variables. The magnitudes of these parameters can be very different. The
2006 Dec 16
1
max.col oddity
...nd find the largest abs(entry) */ + /* first check row for any NAs and find the largest entry */ large = 0.0; isna = FALSE; for (c = 0; c < *nc; c++) { a = matrix[r + c * n_r]; if (ISNAN(a)) { isna = TRUE; break; } - if (do_rand) large = fmax2(large, fabs(a)); + if (!R_FINITE(a)) continue; + if (do_rand) large = fmax2(large, a); } if (isna) { maxes[r] = NA_INTEGER; continue; } ---------------- END ---------------------- This gives the expected behavior in the two examples above. (Sorry to crosspost...
2009 May 20
3
qbinom (PR#13711)
Full_Name: Wolfgang Resch Version: R 2.8.1 GUI 1.27 OS: OS X 10.4.11 Submission from: (NULL) (137.187.89.14) Strange behavior of qbinom: > qbinom(0.01, 5016279, 1e-07) [1] 0 > qbinom(0.01, 5016279, 2e-07) [1] 16 > qbinom(0.01, 5016279, 3e-07) [1] 16 > qbinom(0.01, 5016279, 4e-07) [1] 16 > qbinom(0.01, 5016279, 5e-07) [1] 0
2008 Aug 21
1
pnmath compilation failure; dylib issue?
...kup -single_module -multiply_defined suppress -L/usr/local/ lib -o pnmath.so bd0.o beta.o chebyshev.o choose.o d1mach.o dbeta.o dbinom.o dcauchy.o dchisq.o dexp.o df.o dgamma.o dgeom.o dhyper.o dlnorm.o dlogis.o dnbeta.o dnbinom.o dnchisq.o dnf.o dnorm.o dnt.o dpois.o dt.o dunif.o dweibull.o fmax2.o fmin2.o ftrunc.o gamma.o gamma_cody.o i1mach.o imax2.o imin2.o lbeta.o lgamma.o lgammacor.o mlutils.o pbeta.o pbinom.o pcauchy.o pchisq.o pexp.o pf.o pgamma.o pgeom.o phyper.o plnorm.o plogis.o pnbeta.o pnbinom.o pnchisq.o pnf.o pnmath.o pnorm.o pnt.o polygamma.o ppois.o pt.o ptukey.o pun...
2020 Aug 10
2
qnbinom with small size is slow
...binom.c @@ -104,6 +104,7 @@ double qnbinom(double p, double size, double prob, int lower_tail, int log_p) /* y := approx.value (Cornish-Fisher expansion) : */ z = qnorm(p, 0., 1., /*lower_tail*/TRUE, /*log_p*/FALSE); y = R_forceint(mu + sigma * (z + gamma * (z*z - 1) / 6)); + y = fmax2(0.0, y); z = pnbinom(y, size, prob, /*lower_tail*/TRUE, /*log_p*/FALSE); I used the https://github.com/r-devel/r-svn repo and its continuous integration tools to check that it doesn't break any existing tests: https://github.com/r-devel/r-svn/actions/runs/201327042 I have also requested...
2020 Aug 21
1
qnbinom with small size is slow
...src/nmath/qnbinom.c b/src/nmath/qnbinom.c index b313ce56b2..16845d9373 100644 --- a/src/nmath/qnbinom.c +++ b/src/nmath/qnbinom.c @@ -49,10 +49,18 @@ do_search(double y, double *z, double p, double n, double pr, double incr) { if(*z >= p) { /* search to the left */ for(;;) { + y = fmax2(0, y - incr); if(y == 0 || - (*z = pnbinom(y - incr, n, pr, /*l._t.*/TRUE, /*log_p*/FALSE)) < p) - return y; - y = fmax2(0, y - incr); + (*z = pnbinom(y, n, pr, /*l._t.*/TRUE, /*log_p*/FALSE)) < p){ + if(incr == 1){ + // we know that the sear...
2006 Dec 14
0
max.col: bug or just oddity?
...nd the largest abs(entry) */ + /* first check row for any NAs and find the largest entry */ large = 0.0; isna = FALSE; for (c = 0; c < *nc; c++) { a = matrix[r + c * n_r]; if (ISNAN(a)) { isna = TRUE; break; } - if (do_rand) large = fmax2(large, fabs(a)); + if (!R_FINITE(a)) continue; + if (do_rand) large = fmax2(large, a); } if (isna) { maxes[r] = NA_INTEGER; continue; } --------------------------------------- END ------------------------------------------------- This gives the expected behavio...
2017 Aug 11
2
Issues of R_pretty in src/appl/pretty.c
...e300, n = 1e9, min.n = 1) gave 20 intervals, far from 1e9, but pretty(c(-1,1)*1e300, n = 1e6, min.n = 1) gave 1000000 intervals (on a machine), made me trace through the code to function 'R_pretty' in https://svn.r-project.org/R/trunk/src/appl/pretty.c . *lo is -1e300, *up is 1e300. cell = fmax2(fabs(*lo),fabs(*up)); 'cell' is 1e300. i_small = dx < cell * U * imax2(1,*ndiv) * DBL_EPSILON *3; When *ndiv is (int) 1e9, apparently cell * U * imax2(1,*ndiv) overflows to infinity and 'i_small' is 1 (true). It doesn't happen when *ndiv is (int) 1e6. Putting parentheses may...
2000 Nov 28
1
non-centrality parameter in pf() (PR#752)
Bug Description: Problem with the function pf() when the non-centrality parameter is large. Here is a sample command. You should see a smooth line from 0 to about 55, and then the values of pf() go crazy from 55 to 100. ############################ ncp <- seq(0,100,length=200) plot(ncp,pf(5,7,2,ncp=ncp)) ############################ Version: platform = i686-pc-linux-gnu arch = i686 os =
2017 Aug 18
1
Issues of R_pretty in src/appl/pretty.c
...t; pretty(c(-1,1)*1e300, n = 1e6, min.n = 1) gave 1000000 intervals ? ? >> (on a machine), made me trace through the code to function 'R_pretty' in https://svn.r-project.org/R/trunk/src/appl/pretty.c . ? ? > thank you. ? ? >> *lo is -1e300, *up is 1e300. ? ? >> cell = fmax2(fabs(*lo),fabs(*up)); ? ? >> 'cell' is 1e300. ? ? >> i_small = dx < cell * U * imax2(1,*ndiv) * DBL_EPSILON *3; ? ? >> When *ndiv is (int) 1e9, apparently cell * U * imax2(1,*ndiv) overflows to infinity and 'i_small' is 1 (true). It doesn't happen when *ndiv...
2009 Mar 17
3
R does not compile any more on FreeBSD 8.0-CURRENT
...src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c wilcox.c -o wilcox.o gcc -std=gnu99 -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c signrank.c -o signrank.o rm -rf libnmath.a ar cr libnmath.a mlutils.o d1mach.o i1mach.o fmax2.o fmin2.o fprec.o fround.o ftrunc.o sign.o fsign.o imax2.o imin2.o chebyshev.o log1p.o expm1.o lgammacor.o gammalims.o stirlerr.o bd0.o gamma.o lgamma.o gamma_cody.o beta.o lbeta.o polygamma.o bessel_i.o bessel_j.o bessel_k.o bessel_y.o choose.o snorm.o sexp.o dgamma.o pgamma.o qgamma.o rgamma.o...
2003 Apr 25
4
Kinderman-Ramage (PR#2846)
...return A*(1.13113163544180*u1+u2-1); + /** <modified constant> **/ + return A*(1.131131635444180*u1+u2-1); + /** </modified> **/ } if(u1 >= 0.973310954173898) { /* tail: */ @@ -241,6 +243,10 @@ tt = 0.479727404222441-0.595507138015940*fmin2(u2,u3); if(fmax2(u2,u3) <= 0.805577924423817) return (u2<u3) ? tt : -tt; + /** <added> **/ + if(0.053377549506886*fabs(u2-u3) <= g(tt)) + return (u2<u3) ? tt : -tt; + /** </added> **/ } case BOX_MULLER: if(BM_norm_keep != 0.0) { /* An exact test is intentional *...
2020 Aug 20
0
qnbinom with small size is slow
...uble qnbinom(double p, double size, double prob, > int lower_tail, int log_p) > /* y := approx.value (Cornish-Fisher expansion) : */ > z = qnorm(p, 0., 1., /*lower_tail*/TRUE, /*log_p*/FALSE); > y = R_forceint(mu + sigma * (z + gamma * (z*z - 1) / 6)); > + y = fmax2(0.0, y); > z = pnbinom(y, size, prob, /*lower_tail*/TRUE, /*log_p*/FALSE); > I used the https://github.com/r-devel/r-svn repo and its continuous > integration tools to check that it doesn't break any existing tests: > https://github.com/r-devel/r-svn/actions/runs/2...
2003 May 01
2
qbeta hang (PR#2894)
Full_Name: Morten Welinder Version: 1.6.1 OS: Solaris/sparc Submission from: (NULL) (65.213.85.144) qbeta(0.1, 1e-8, 0.5, TRUE, FALSE) seems to hang for me.
2017 Aug 14
0
Issues of R_pretty in src/appl/pretty.c
...from 1e9, but > pretty(c(-1,1)*1e300, n = 1e6, min.n = 1) gave 1000000 intervals > (on a machine), made me trace through the code to function 'R_pretty' in https://svn.r-project.org/R/trunk/src/appl/pretty.c . thank you. > *lo is -1e300, *up is 1e300. > cell = fmax2(fabs(*lo),fabs(*up)); > 'cell' is 1e300. > i_small = dx < cell * U * imax2(1,*ndiv) * DBL_EPSILON *3; > When *ndiv is (int) 1e9, apparently cell * U * imax2(1,*ndiv) overflows to infinity and 'i_small' is 1 (true). It doesn't happen when *ndiv is (int) 1e...
2002 Jan 22
1
compile problem with bessel_i.c on IRIX64 flexor 6.5 10100655 IP35 (uname -a) (PR#1275)
...o tabulate.o uncmin.o zeroin.o ch2in v.o chol.o dpbfa.o dpbsl.o dpoco.o dpodi.o dpofa.o dposl.o dqrdc.o dqrdc2.o dqrls.o dqrsl.o dqrutl.o dsvdc.o dtrco.o dtrsl.o eigen.o lminfl.o : libappl.a making mlutils.d from mlutils.c making d1mach.d from d1mach.c making i1mach.d from i1mach.c making fmax2.d from fmax2.c making fmin2.d from fmin2.c making fprec.d from fprec.c making fround.d from fround.c making ftrunc.d from ftrunc.c making sign.d from sign.c making fsign.d from fsign.c making imax2.d from imax2.c making imin2.d from imin2.c making chebyshev.d from chebyshev.c making log1p.d from lo...
2000 Oct 31
1
conflicting types for `Rf_stirlerr
...mfa5/gilp/R-versions/R-devel/src/appl' make[2]: Entering directory `/home/mfa5/gilp/R-versions/R-devel/src/nmath' make[3]: Entering directory `/home/mfa5/gilp/R-versions/R-devel/src/nmath' making mlutils.d from mlutils.c making d1mach.d from d1mach.c making i1mach.d from i1mach.c making fmax2.d from fmax2.c making fmin2.d from fmin2.c making fmod.d from fmod.c making fprec.d from fprec.c making fround.d from fround.c making ftrunc.d from ftrunc.c making sign.d from sign.c making fsign.d from fsign.c making fsquare.d from fsquare.c making fcube.d from fcube.c making imax2.d from imax2.c...
2003 Dec 14
1
compile error with C code and standalone R math C library
...int current_pos) { double a, p, y, num, denom, leftval, rtval; a = node[current_pos + 1]; y = node[current_pos] + node[current_pos+2]; num = accept_prob_fn(a, y); leftval = accept_prob_fn(a, -theta + node[current_pos+2]); rtval = accept_prob_fn(a, theta + node[current_pos+2]); denom = fmax2(leftval, rtval); /* function in Rmath which returns max of two doubles */ p = num/denom; assert(p>=0 && p <=1); return p; } /* auxilary function for accept_prob */ double accept_prob_fn(double a, double y) { double f; if(y != 0) f = (exp(y) - exp(-y))/(y*exp(a*y))...
1999 May 03
1
problems compiling R-0.63.3 on alpha
...ct -g -I../include -I../../src/include -c mlutils.c -o mlutils.o gcc -ieee_with_inexact -g -I../include -I../../src/include -c d1mach.c -o d1mach.o gcc -ieee_with_inexact -g -I../include -I../../src/include -c i1mach.c -o i1mach.o gcc -ieee_with_inexact -g -I../include -I../../src/include -c fmax2.c -o fmax2.o gcc -ieee_with_inexact -g -I../include -I../../src/include -c fmin2.c -o fmin2.o gcc -ieee_with_inexact -g -I../include -I../../src/include -c fmod.c -o fmod.o gcc -ieee_with_inexact -g -I../include -I../../src/include -c fprec.c -o fprec.o gcc -ieee_with_inexact -g -I../include...
1998 Nov 06
1
DEC alpha INSTALLATION R-0.62.4
...../lib/libgraphics.a graphics.o ranlib ../lib/libgraphics.a cd nmath; make cc -ieee_with_inexact -g -I../../src/include -c mlutils.c cc -ieee_with_inexact -g -I../../src/include -c d1mach.c cc -ieee_with_inexact -g -I../../src/include -c i1mach.c cc -ieee_with_inexact -g -I../../src/include -c fmax2.c cc -ieee_with_inexact -g -I../../src/include -c fmin2.c cc -ieee_with_inexact -g -I../../src/include -c fmod.c cc -ieee_with_inexact -g -I../../src/include -c fprec.c cc -ieee_with_inexact -g -I../../src/include -c fround.c cc -ieee_with_inexact -g -I../../src/include -c ftrunc.c cc -ieee_wi...