Displaying 20 results from an estimated 200 matches similar to: "Behaviour of very large numbers"
2008 May 28
1
indexing lists, using brobdingnagian
Dear R-Gurus,
I have ended up with a calculation problem where I need to use brobs.
I have to work my way through a vector with a for loop to act on each
element in a calculation (refering to the previous
value in the new vector of results -- so as far as I know I can't use
"apply") -- this produces a list of brobs.
My problem is, how do I act on, plot this list, or do vector
2009 Feb 11
5
How to handle large numbers?
Dear R,
I have two questions:
1, Why both R and Matlab give 0*Inf==NaN? To my knowledge, it should be zero
mathematically. Am I right?
2, I need to calculate e.g. exp(a)/(exp(b)+c), where both a and b are very
large numbers (>>1000, e.g a=1000, b=1007, and c=5). R gives me NaN when I
use the following command:
> exp(1000)/(exp(1007)+5)
[1] NaN
I am pretty sure this should be close to
2006 Oct 31
1
setReplaceMethod
Hi
If x <- 1:10 then x[5] <- 1i will promote
x to be a complex vector.
Suppose I have an S4 class "brob", and have functions
is.brob(), as.brob(), as.numeric() and so forth (minimal self-contained
code below).
If x is numeric (1:10, say) and y is a brob, what
is the best way to make
x[5] <- y
promote x to a brob in the same way as the complex example?
Or is
2006 Sep 15
1
setMethod() woes
Hello everybody
R version 2.4.0 alpha (2006-09-15 r39323), MacOSX 10.4.7
Next S4 problem.
I have "brob" objects that are large real numbers, and now I want "glub"
numbers that are to be a pair of glubs that represent complex numbers.
I want to define binary operator "+" so that if either the left or right
argument are glubs, it uses .ArithGlub.
If either
2006 Aug 30
1
setMethod() and log()
Hi
I am having difficulty with setMethod(). I have a "brob" class of
objects whose
representation has two slots: "x" and "positive". Slot "x" (double)
holds the log
of a number and slot "positive" (logical) its sign. The idea is
that large numbers
can be handled.
I'm trying to implement a log() method using an analogue of the
2009 Jun 26
3
panel.text and saving to pdf
Dear all,
I am not sure what I am doing wrong, but I have some unexplained behaviour when saving a lattice graph including text to a pdf file. The text seems to move around. It must have something to do with the way coordinates are set in devices other than jpg.
Any suggestions would be helpful
Willem
Here is some example code
setwd("c:/willem/research/misc")
today <-
2006 Sep 04
1
setMethod("Summary")
Hi everyone and thanks for being patient. I've used "!.foo"() et
seq pro tem.
Next problem: how to define "Summary" methods for brobs.
?max says
'max' and 'min' are generic functions: methods can be defined for
them individually or via the 'Summary' group generic. For this to
work properly, the arguments '...' should be
2010 Oct 08
2
Error message in as.brob Usage
I am getting the following error message while using the as.brob function in
some computations:
Error in out.x[ss] <- pmax(x1[ss], x2[ss]) + log1p(+exp(-abs(x1[ss] - :
NAs are not allowed in subscripted assignments
Is there any obvious mistake I am making here that can resolve the above
error message?
Thanks for your help.
Chow
--
View this message in context:
2006 Sep 01
1
setMethod("Logic", ...)
Hi
In V&R the "polynomial" class is explicitly specified to have no
logical operators:
setMethod("Logic", signature(e1="polynomial"), function(e1,e2){stop
("...")})
I too have a class of objects for which I want to
specify that Logic operators do not work, but executing
setClass("brob",
representation = representation
2011 Aug 03
1
NAMESPACE problems
Hi.
I am having difficulty following section 1.6.6 of the R-extensions manual.
I am trying to update the Brobdingnag package to include a NAMESPACE file (the
untb package requires the Brobdingnag package).
Without the NAMESPACE file, the package passes R CMD check cleanly.
However, if I include a NAMESPACE file, even an empty one, R CMD check
gives the following error in 00install.out:
2004 Mar 01
1
non-negative least-squares
Hi all,
I am trying to do an inversion of electromagnetic data with non-negative
least squares method (Tikhonov regularisation) and have got it
programmed in S-Plus. However I am trying to move all my scripts from
S-Plus to R.
Is there an equivalent to nnls.fit in R?
I think this can be done with pcls? Right?
S-Plus script: A, L and data are matrices, lambda is a vector of
possible lambda
2007 Nov 21
1
equivalent of Matlab robustfit?
Hi,
I've been using the Matlab robustfit function for linear regressions
where I suspect some data points are outliers. Is there an equivalent
function in R?
Take care, Darren
PS, This is the Matlab help on robustfit:
>> help robustfit
ROBUSTFIT Robust linear regression
B = ROBUSTFIT(X,Y) returns the vector B of regression coefficients,
obtained by performing robust
2006 Sep 12
1
package.skeleton() in R-2.4.1
Hi
R version 2.4.0 alpha (2006-09-06 r39158)
MacOSX 10.4.7
There was a thread some time ago as to whether the structure created by
package.skeleton() would pass R CMD check.
I have an example where package.skeleton() gives an R file that gives an
error when sourced.
If I type
setClass("brob",
representation = representation
2007 Jan 12
0
Dummy's guide to S4 methods: package Brobdingnag
Hello List.
please find uploaded to CRAN a new package, Brobdingnag.
This package does two things:
(1) allows computation of very large numbers using a logarithmic
representation.
(2) provides a "Hello, World" example of S4 methods in use: there are
two classes of object
(brob and glub) and one virtual class (swift). The package
includes a vignette that is a
2020 Feb 29
3
dput()
I think Robin knows about FAQ 7.31/floating point (author of
'Brobdingnag', among other numerical packages). I agree that this is
surprising (to me).
To reframe this question: is there way to get an *exact* ASCII
representation of a numeric value (i.e., guaranteeing the restored value
is identical() to the original) ?
.deparseOpts has
?"digits17"?: Real and finite complex
2008 Sep 16
0
FW: odesolve dynload example
HI R Gurus,
> This is my first foray into using c-code with R, so ...
> I had a look at the archives and did not find anything on this, so
> hopefully I am not doubling up.
>
I have previously used the following approach where I needed some very
small numbers/large (using Brobdingnag):
surfacewithdiff <- function(t, y, p)
{
const=p["const"]
kay
2008 Sep 16
0
lsoda( linking to GMP for big numbers from C code)
Hi R used with C-code experts,
I had a look at the archives and did not find anything on this, so
hopefully I am not doubling up.
I have previously used the following approach where I needed some very
small/large numbers (using Brobdingnag):
surfacewithdiff <- function(t, y, p)
{
const=p["const"]
kay =p["kay"]
psii=p["psii"]
2008 Feb 11
1
Histogram in Lattice with 3 factors
Dear R-help list,
I am trying to construct a lattice histogram using 3 factors.
My dataframe looks like this: (simulating a waterbalance over
groundwater with different salinities)
s days model EC EC_max
0.4 1 "A" 10 9
0.42 2 "A" 10 9
0.44 3 "A" 10 9
: : : :
2020 Feb 29
2
dput()
Thanks guys, I guess I should have referred to FAQ 7.31 (which I am
indeed very familiar with) to avoid misunderstanding. I have always
used dput() to clarify 7.31-type issues.
The description in ?dput implies [to me at any rate] that there will
be no floating-point roundoff in its output. I hadn't realised that
'deparsing' as discussed in dput.Rd includes precision roundoff
issues.
2007 Oct 04
1
Updating packages for R 2.6.0
Since this has come up already:
It is a good idea to re-install all packages for a minor-version increment
of R, e.g. 2.5.1 -> 2.6.0 (it is major.minor.patchlevel). This is most
easily done by
> update.packages(checkBuilt=TRUE, ask=FALSE)
However, if you don't want to do that yet, be aware that
- Certain S4-using packages must be reinstalled, and using old versions
can make R