On Wed, Jan 3, 2024 at 1:29 PM Meridiana GeoTopo
<meridianageotopo(a)gmail.com> wrote:
Hi everyone. Wish you all a Happy 2024, first of all.
Thanks, Happy New Year to you.
I wonder if there is a way to make gretl work with more decimal
digits. I think I am having a rounding error problem.
I was getting divergent $coeff so I ran against other calculations OLS vs matrix
solutions in gretl - against some book examples
In gretl, all numerical values are stored as 64-bit "doubles" which
support 15 or 16 digits of precision (so there's little point in
supplying more than 16 digits if you're entering numbers via script or
console, or reading numbers from file). Arbitrary calculations may not
yield results that are good to 16 digits (particularly in case of
numerical optimization) , but it would be very unusual for regular
calculations to give results that are not good to at least 6 figures.
Note that by default gretl prints matrices using 5 significant digits,
but you can use the "printf" command to see more digits, as in the
example below:
<input>
set seed 1234
M = mnormal(3,2)
print M
printf "\n%20.16f\n", M
</input>
which gives:
<output>
M (3 x 2)
0.093168 0.18693
1.9911 0.41716
0.20636 0.70415
0.0931677157432836 0.1869250618083392
1.9910903139786742 0.4171582297587720
0.2063573158189349 0.7041473329355175
</output>
If you're comparing results of a calculation with other sources it's
important to import the data with maximal precision. If, say, the data
come from a CSV file with numbers printed to 4 significant digits, you
won't get the same results as if the imported data were good to 16
digits.
Allin Cottrell