It really dependes on the nature of the computations that you are doing to 
obtain these real vectors, and also on the objective of your problem.  For 
example, if the real vectors are the result of some numerical approximation, 
then you can set the threshold to be equal to the error involved in the 
approaximation, if you know that.  If these thresholds are too high to be 
appropriate for your objective, then you can increase the accuracy of your 
numerical approximation and obtain a smaller threshold.

Ravi.
____________________________________________________________________

Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology
School of Medicine
Johns Hopkins University

Ph. (410) 502-2619
email: [EMAIL PROTECTED]


----- Original Message -----
From: Hesen Peng <[EMAIL PROTECTED]>
Date: Thursday, October 2, 2008 9:55 pm
Subject: [R] When to set small values to 0?
To: R help forum <r-help@r-project.org>


> My dear R buddies,
>  
>  I've run into a problem when doing numerical computation recently. In
>  a program that I've been working on, I usually get a vector of real
>  values which are theoretically (and it's correct) supposed to decrease
>  until reaching zero after a given value. However, most of the value
>  just wander at 10^-8 scale and never shrink exactly to zero. So I
>  guess I should manually add a threshold to set the values to zero. But
>  does anyone know any choice of these thresholds? Thanks very much.
>  
>  -- 
>  彭河森 Hesen Peng
>  
>  ______________________________________________
>  R-help@r-project.org mailing list
>  
>  PLEASE do read the posting guide 
>  and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to