03-24-2014 10:01 AM
I have a problem of computing numerical derivative using finite difference method. Obviously, I have to concern two problems, the rounding error and truncation error. The truncation error can be dealt by extrapolation. But the rounding error problem has something to do with machine accuracy and finding the proper scale of perturbation. This probably related to the fundamental of SAS, ie. how the number is stored in SAS and how SAS executes C language. I have already read numerical recipes in C. But I don't know how to apply the method to SAS. Any comment is truly appreciated. Thank you in advance.
03-24-2014 11:27 AM
It is an Intel issue not microsoft or SAS or any other program. There is even an IEE-standard.
floating point double-precision is what Intel is using as standard at the moment. Precision is 15 digits.
Welcome in the digital age and the caveats.
"There are 10 types of people in the world; those that understand BINARY and those that do not"..
03-25-2014 08:52 AM
Thanks Reeza. Now I want to follow the book Numerical Recipe in C to reduce the round off error. In its 3rd edition page 230, it says one needs to use the trick temp=x+h
to achieve the exact h. Any idea how to apply this trick in SAS?
04-03-2014 11:34 AM
To understand more about floating-point arithmetic, see the paper "What Every Computer Scientist Should Know About Floating-Point Arithmetic."
If you are doing numerical analysis in SAS, you should look at the SAS/IML language. The SAS/IML language supports numerical integration, differentiation, optimization, matrix computations, and other operations covered in Numerical Recipes. There is even a separate SAS/IML Support Community for questions about numerical operations.
Here are a few blog posts about numerical differentiation (also call finite differencing):