similar to: Infinite != NaN?

Displaying 20 results from an estimated 20000 matches similar to: "Infinite != NaN?"

2017 Apr 01
1
mean(x) != mean(rev(x)) different with x <- c(NA, NaN) for some builds
On Fri, Mar 31, 2017 at 10:14 PM, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote: > From ?NA > > Numerical computations using ?NA? will normally result in ?NA?: a > possible exception is where ?NaN? is also involved, in which case > either might result. > > and ?NaN > > Computations involving ?NaN? will return ?NaN? or perhaps ?NA?: >
1999 May 11
5
matrix() can't handle NaN (PR#193)
Full_Name: Bill Simpson Version: 0.64.1 OS: linux Submission from: (NULL) (193.62.250.209) Here is the data file: x y z 1 1 1 1 2 2 2 1 NaN 2 2 4 >data<-read.table("~/junk.dat",header=TRUE) > data x y z 1 1 1 1 2 1 2 2 3 2 1 NaN 4 2 2 4 > matrix(data$z,length(y),length(x)) [,1] [,2] [1,] 1 4 [2,] 2 3 This is not the correct matrix. It seems
2012 Jul 31
3
Help with NaN when 0 divided by 0
Hi All, I have some data where I am doing fairly simple calculations, nothing more than adding, subtracting, multiplying and dividing. I’m running into a problem when I divide one variable by another and when they’re both 0 I get NaN. I realize that if you divide a non-zero by 0 then you get Inf, which is, of course, correct. But in my case I never get Inf, just NaN because of the structure
2011 May 26
2
NaN, Inf to NA
Hi, I want to recode all Inf and NaN values to NA, but I;m surprised to see the result of the following code. Could anybody enlighten me about this? > df <- data.frame(a=c(NA, NaN, Inf, 1:3)) > df[is.infinite(df) | is.nan(df)] <- NA > df a 1 NA 2 NaN 3 Inf 4 1 5 2 6 3 > Thanks! Cheers!! Albert-Jan
2011 May 26
2
NaN, Inf to NA
Hi, I want to recode all Inf and NaN values to NA, but I;m surprised to see the result of the following code. Could anybody enlighten me about this? > df <- data.frame(a=c(NA, NaN, Inf, 1:3)) > df[is.infinite(df) | is.nan(df)] <- NA > df a 1 NA 2 NaN 3 Inf 4 1 5 2 6 3 > Thanks! Cheers!! Albert-Jan
2010 Oct 01
4
cleaning up a vector
I calculated a large vector. Unfortunately, I have some measurement error in my data and some of the values in the vector are erroneous. I ended up wih some Infs and NaNs in the vector. I would like to filter out the Inf and NaN values and only keep the values in my vector that range from 1 to 20. Is there a way to filter out Infs and NaNs in R and end up with a clean vector? Mike
2010 May 13
1
results of pnorm as either NaN or Inf
I stumbled across this and I am wondering if this is unexpected behavior or if I am missing something. > pnorm(-1.0e+307, log.p=TRUE) [1] -Inf > pnorm(-1.0e+308, log.p=TRUE) [1] NaN Warning message: In pnorm(q, mean, sd, lower.tail, log.p) : NaNs produced > pnorm(-1.0e+309, log.p=TRUE) [1] -Inf I don't know C and am not that skilled with R, so it would be hard for me to look into
2015 Nov 30
1
Inconsistency in treating NaN-results?
As a side note, Splus makes sin(x) NA, with a warning, for abs(x)>1.6*2^48 (about 4.51e+14) because more than half the digits are incorrect in sin(x) for such x. E.g., in R we get: > options(digits=16) > library(Rmpfr) > sin(4.6e14) [1] -0.792253849684354 > sin(mpfr(4.6e14, precBits=500)) 1 'mpfr' number of precision 500 bits [1]
2015 Nov 26
2
Inconsistency in treating NaN-results?
This question is more out of curiosity than a complaint or suggestion, but I'm just wondering. The behavior of R on calculations that result in NaN seems a bit inconsistent. # this is expected: > 0/0 [1] NaN # but this gives a warning > sin(Inf) [1] NaN Warning message: In sin(Inf) : NaNs produced # and this again does not > exp(NaN) [1] NaN Conceptually, I like to think that R
2009 Jan 29
1
Arima_Like() and NaN - a (possible) problem, a patch, and RFC
Hi, recently I have started working with R (v. 2.7.2), and I have been using R's internal ARIMA_Like() function (from the "stats" package) to estimate some ARIMA models. In particular, I use ARIMA_Like() in a function "fn()" that I feed to the optim() method; the main goal is to find optimal ARIMA prediction models for some time series. The ARIMA_Like() function returns a
2022 Nov 09
1
det(diag(c(NaN, 1))) should be NaN, not 0
Hello, Currently, determinant(A) calculates the determinant of 'A' by factorizing A=LU and computing prod(diag(U)) [or the logarithm of the absolute value]. The factorization is done by LAPACK routine DGETRF, which gives a status code INFO, documented [1] as follows: *> INFO is INTEGER *> = 0: successful exit *> < 0: if INFO = -i, the i-th
2018 Mar 05
2
how to simplify FP ops with an undef operand?
On 05.03.2018 19:27, Sanjay Patel via llvm-dev wrote: > 3. fadd C, undef --> undef (where C is not NaN or Inf) > In the general constant case, the result could be anything as long as > constant operand C is not NaN or Inf. If C is the largest finite positive number, then (fadd C, X) cannot be a finite negative number. So doesn't folding (fadd C, undef) --> undef break the
2011 Sep 20
1
randomForest - NaN in %IncMSE
Hi I am having a problem using varImpPlot in randomForest. I get the error message "Error in plot.window(xlim = xlim, ylim = ylim, log = "") : need finite 'xlim' values" When print $importance, several variables have NaN under %IncMSE. There are no NaNs in the original data. Can someone help me figure out what is happening here? Thanks! [[alternative HTML
2010 Mar 31
2
Should as.complex(NaN) -> NA?
I'm having trouble grokking complex NaN's. This first set examples using complex(re=NaN,im=NaN) give what I expect > Re(complex(re=NaN, im=NaN)) [1] NaN > Im(complex(re=NaN, im=NaN)) [1] NaN > Arg(complex(re=NaN, im=NaN)) [1] NaN > Mod(complex(re=NaN, im=NaN)) [1] NaN > abs(complex(re=NaN, im=NaN)) [1] NaN and so do the following > Re(complex(re=1,
2010 Aug 27
3
predict.loess and NA/NaN values
Hi! In a current project, I am fitting loess models to subsets of data in order to use the loess predicitons for normalization (similar to what is done in many microarray analyses). While working on this I ran into a problem when I tried to predict from the loess models and the data contained NAs or NaNs. I tracked down the problem to the fact that predict.loess will not return a value at all
2010 Sep 21
3
bivariate vector numerical integration with infinite range
Dear list, I'm seeking some advice regarding a particular numerical integration I wish to perform. The integrand f takes two real arguments x and y and returns a vector of constant length N. The range of integration is [0, infty) for x and [a,b] (finite) for y. Since the integrand has values in R^N I did not find a built-in function to perform numerical quadrature, so I wrote my own after
2018 Mar 06
0
how to simplify FP ops with an undef operand?
I need to review the last thread about undef/poison (or someone who knows current status of that can reply), but this would seem to come down to whether undef applies to the entire value or the individual bits? Ie, in your example the sign bit will never be set unless all of the exponent bits are also set. Each bit individually is unknown, but taken together we know that some sequences are
2005 Apr 22
1
Infinite degrees of freedom for F-distribution
This is just a suggestion/wish that it would be nice for the F-distribution functions to recognize limiting cases for infinite degrees of freedom, as the t-distribution functions already do. The t-distribution functions recognize that df=Inf is equivalent to the standard normal distribution: > pt(1,df=Inf) [1] 0.8413447 > pnorm(1) [1] 0.8413447 On the other hand, pf() will accept Inf
2001 Aug 24
1
Reading Inf and NaN values under windows (PR#1072)
Under windows, R supports IEEE floating point arithmetic, but doesn't allow conversion of Inf and NaN from character to numeric. R> is.nan(NaN) [1] TRUE R> as.numeric(as.character(NaN)) [1] NA Warning message: NAs introduced by coercion R> is.infinite(Inf) [1] TRUE R> as.numeric(as.character(Inf)) [1] NA Warning message: NAs introduced by coercion whereas under Linux R>
2005 Aug 26
1
Memory leakage/violation?
Hi, I've spotted a possible memory leakage/violation in the latest R v2.1.1 patched and R v2.2.0dev on Windows XP Pro SP2 Eng. I first caught it deep down in a nested svd algorithm when subtracting a double 'c' from a integer vector 'a' where both had finite values but when assigning 'a <- a - c' would report NaNs whereas (a-c) alone would not. Different runs