Mathematica Mathematica: dealing with significant figures

AI Thread Summary
The discussion revolves around analyzing large datasets with varying precision in Mathematica. The main focus is on determining the number of decimal places and calculating significant figure error intervals. The challenge arises from Mathematica interpreting imported data as 'MachinePrecision', which complicates precision analysis. A suggested solution involves converting numbers to scientific notation to easily extract precision levels. By using functions like NumberForm and ScientificForm, users can generate a list of precisions and apply error ranges based on significant figures without slowing down calculations. The Interval function is noted as unsuitable for this specific task, as it requires a range rather than handling single values. Overall, the conversation emphasizes finding efficient methods to manage precision in data analysis.
yourgoldteeth
Messages
9
Reaction score
0
Hi everyone.

Hopefully this is easy to solve.

I have large amounts of mined data that have differing levels of precision. I want to do analysis of:

1) number of decimal places present
2) significant figure error intervals based on the precision (for instance, 0.003 could have been rounded from 0.0025 to 0.0035)

I can't find a clean way to do it in Mathematica, as importing my data makes it all 'MachinePrecision' and it thinks everything has 15.9456 digits of precision.

I've tried back doors, such as doing a StringLength[ToString[x]] but even that doesn't work for very small decimals, as it introduces scientific notation which throws everything off.

Any ideas?
 
Physics news on Phys.org
Have you looked at the Interval function?
 
Hurkyl said:
Have you looked at the Interval function?

The interval function does not appear to be what I am looking for. I have a single value, and need to specify a range based on significant figures rules for that one value. The interval function requires a range as input.
 
I would just force them all to be scientific notation, that way you know the precision. You can pluck out the precision pretty easy.

j = { .00000000000000000001,.00000000000000000000000001.,.0000000000000001}

NumberForm[j, NumberFormat->(#3&)]

Now you have a list of precisions. You can feed those into the interval range function, and just put your error ranges on in front of the exponent.

There is probably a better way, but this probably solves it.. that way you don't have to force variable precision, which will slow down your calculations.
 
This one

ScientificForm[j, NumberFormat -> (#3 &)]
 
Back
Top