How small is Zero?
Show older comments
I run some statistical analyses which result in p-values=0. Are they < the minimum positive value of a double precision (<2e-308), which is odd to me?
I am worried if another precision is used under the hood in the Statistics and Machine Learning Toolbox (e.g., corr).
Accepted Answer
More Answers (1)
format long g
A = sym(floor(randn(5,2) * 16)) / 16
cord = corr(double(A))
cors = corr(A)
corsv = vpa(cors, 16)
corsd = double(cors)
That is, the corr() function happens to be able to run on symbolic numbers, and will provide exact results over a rather wide range -- 10^-10000 not being a problem for example. So you could test your "exact 0"
Categories
Find more on Analysis of Variance and Covariance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

