Hello everybody and thanks for your work on gretl.

I am experimenting in porting parts of libgretl to javascript via emscripten. After a couple of afternoons i have been able to "compile" to javascript some unit root tests, mostly thanks to some kind soul who did the same for GMP and mpfr and posted their work to github.

My first intent was to verify if there are differences in the output from the C and JS versions, and the only one I could find is this, in adf_test() :

diff OUTPUT_FROM_C.txt OUTPUT_FROM_JS 

59c59
<   lagged differences: F(3, 5) = 0.395 [0.7626]
---
>   lagged differences: F(3, 5) = 0.344 [0.7954]

80c80
<   lagged differences: F(3, 4) = 20.327 [0.0070]
---
>   lagged differences: F(3, 4) = 1.297 [0.3904]

(all other results, pvalues, statistics and values were the same btw)

The results were created using the dataset generated in simple_client.c ;  the only relevant change I've made is stitching some plugin code in the main code in order to avoid using dlopen() (which didnt work well in emscripten). I then ran adf_test() and kpss_test() on the same dataset.

I was wondering if you had any insights into this small discrepancy; are the lagged differences computed using GMP or lapack? I am thinking it is a CLAPACK+emscripten+different architecture issue.

Output for both versions is attached.