Displaying 20 results from an estimated 2000 matches similar to: "Floating point precision / guard digits? (PR#13771)"
2008 Apr 04
4
Arbitrary Precision Numbers
Hi
(If you're wondering, this is a Project Euler question :))
If I wanted to calculate the sum of the digits in the decimal representation
of 2^1000, what would be a good way to go about that? I've tried the
following methods:
# Calculate the sum of digits in the decimal representation of 2^n
# Only works for smaller values of n
bsum <- function(n) {
s <- 0
e <-
2015 Dec 16
2
Mystifying SEGFAULT on 3.2.3 but not 3.2.2
Dear R developers,
(Apologies about previous incomplete e-mail, I fat-fingered a keyboard
shortcut)??
I recently upgraded to 3.2.3 and am getting mystifying errors with my
in-development code (available at
https://github.com/gertvv/gemtc/tree/feature/regression). Every few hundred
LPs that I solve using the rcdd package will result in a SEGFAULT in the
garbage collector (address 0x10, cause
2005 Aug 29
2
test for readline installation fails if installation location non-standard (PR#8104)
Full_Name: D Kreil
Version: 2.1.1
OS: HP-UX B.11.23 U ia64 0029870451 unlimited-user license
Submission from: (NULL) (62.178.15.60)
When the dependency readline is installed in a non-standard location the
installation procedure fails.
If using a non-standard installation location like
--prefix=/bi/common --exec-prefix=/bi/arch
the configure script default include and library paths should
2018 Feb 26
3
Precision in R
Hi,
Why sum() on a 10-item vector produces a different value than its
counterpart on a 2-item vector? I understand the problems related to
the arithmetic precision in storing decimal numbers in binary format,
but shouldn't the errors be equal regardless of the method used?
See my example:
> options(digits=22)
> x=rep(.1,10)
> x
[1] 0.10000000000000001 0.10000000000000001
2005 Aug 29
1
"finite" vs "R_FINITE" in colors.c (PR#8108)
Full_Name: D Kreil
Version: 2.1.1
OS: HP-UX B.11.23 U ia64 0029870451 unlimited-user license
Submission from: (NULL) (62.178.15.60)
During compiliation, I get:
ld: Unsatisfied symbol "finite" in file colors.o
Fix: replace "finite" with R_FINITE in colors.c line 269.
I have, this time, searched through the R-admin.html, but not found a mention.
This is all a bit hard for me
2009 Jan 17
2
Concave Hull
Dear Friends,
Here is an algorithm for finding concave hulls: http://get.dsi.uminho.pt/local/
Has anyone implemented such an algorithm in R?
RSiteSearch('concave hull') didn't reveal one (I think).
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
Postal Address:
P.O.Box 400400, Charlottesville, VA 22904-4400
Express Parcels
2011 Jun 24
2
Is there an implementation of loess with more than 3 parametric ...
Dear John,
> I suggest that you look at the abilities of the mgcv package.
> There are notes of mine at
>
> http://www.maths.anu.edu.au/%7Ejohnm/r-book/xtras/autosmooth.pdf
>
> that may help you get started.
Thank?you very much for the suggestion and the link to your write-up,
it was indeed very helpful!
I have experimented with this library for a while now and am really
happy
2003 Dec 09
1
How to append to a data.frame?
Hi,
I have a data.frame that I need to construct iteratively.
At the moment, I'm doing:
d<-data.frame(x=c(),y=c(),z=());
# {and, within some loop}
d<-rbind(d,data.frame(x=newx,y=newy,z=newz);
While this works, it is horribly verbose and probably not efficient, either.
My real data.frame has, of course, many more columns, which can be of
different modes.
I vaguely recall that
2004 May 17
1
Change in how R handles assignments?
Dear R-users and experts,
I have been using the following code in earlier versions of R:
q[,names(info)]<-info[no,];
with
> class(info)
[1] "data.frame"
> class(q)
[1] "data.frame"
> dim(q)
[1] 7488 68
> dim(info)
[1] 12 8
> dim(info[no,])
[1] 1 8
The column names(info) did not exist in q before the assignment.
What used to happen (as intended) was
2003 Jan 31
2
floating point question
Does anyone know precisely what is different about the arithmetic
and/or storage of double precision floating point to produce the
following differences between the Sun and Windows versions (Splus 6
on the same Windows 2000 machine gives the same results as Solaris)?
R 1.6.1, Sun Solaris, gcc + an old Sun f77
> options(digits=20)
> 1+(1/2^53+1/2^106)
[1] 1
> 1+(1/2^53+1/2^105)
[1]
2005 Sep 01
1
controlling where *.Rout gets printed. Possible?
OK, my journey to make lab machines automagically install & update all
desirable R packages is nearing an end! The only question I have now is
this: How can I control where the system prints the *.Rout file that is
created automatically when the R batch program runs. In "man R" I don't
find any information about it. When the cron job runs "R_installAll.sh"
(see
2008 May 28
2
Linear Programming.
An embedded and charset-unspecified text was scrubbed...
Name: n?o dispon?vel
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20080528/96325940/attachment.pl>
2011 Jun 11
1
Is there an implementation loess with more than 4 parametric predictors or a trick to similar effect?
Dear R experts,
I have a problem that is a related to the question raised in this earlier
post
https://stat.ethz.ch/pipermail/r-help/2007-January/124064.html
My situation is different in that I have only 2 predictors (coordinates x,y)
for local regression but a number of global ("parametric") offsets that I
need to consider.
Essentially, I have a spatial distortion overlaid over a
2006 Apr 05
2
Problems in package management after Linux system upgrade
I upgraded from Fedora Core 4 to Fedora Core 5 and I find a lot of
previously installed packages won't run because shared libraries or
other system things have changed "out from under" the installed R
libraries. I do not know for sure if the R version now from
Fedora-Extras (2.2.1) is exactly the same one I was using in FC4.
I see problems in many packages. Example, Hmisc:
unable
2013 May 11
1
prediction in a loop with only one sample
Dear all,
I have a sample with 920 observations. I want to create a loop which takes
300 of these observations for the prediction and the rest to estimate the
model.
My idea was to create something like this:
cs.training.dat <- read.table...
cs.training.dat_sub1 <- subset(cs.training.dat, Income>10)
cs.training.dat_sub2 <- subset(cs.training.dat_sub1, Dept.Ratio<=1)
2010 Jun 27
2
floating point in single precision
Hello,
is there a possibilty in R to convert numbers (double precision, 64bit) into
single precision ones (32bit).
I need that for compatibility reasons. Until now I call a C application which
casts a double to a float.
float precision32(double value) {
return (float)value;
}
But I want to use a R only method. What can I do?
Kind regards,
Sebastian
2006 Nov 16
1
Looking for greater floating-point precision
Dear All
For my calculations, I am needing to use more floating-point precision
than the default one of R. Is that possible? And, if yes, how?
Thanks in advance,
Paul
2011 Mar 04
3
integrate a fuction
I'm having a function of the form
1> f<-function(x){
1+
1+ return(x^p)
1+
1+ }
,and I would like to integrate it with respect to x, where p should be any
constant.
One way would be to set a value for p globally and then call integrate
function:
p=2
integrate(f, lower = -1, upper = 1)
However, I would like to use 'integrate' inside a function, so I could call
it passing
2011 Nov 15
2
Controlling the precision of the digits printed
Has anyone come across the right combinations to print a limited number of
digits? My trial and error approach is taking too much time. Here is what I
have tried:
> op <- options()
> a <- c(1e-10,1,2,3,.5,.25)
> names(a) <- c("A", "B", "C", "D", "E", "F")
> # default
> a
A B C D
2008 Feb 25
1
To get more digits in precision of predict function of randomForests
Hi,
I am using randomForests for a classification problem. The predict
function in the randomForest library, when asked to return the
probabilities, has precision of two digits after the decimal. I need
at least four digits of precision for the predicted probabilities. How
do I achieve this?
Thank you,
Nagu