You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While testing Threshold_Panel with gretl4py, I found two bugs affecting double-threshold estimation.
In estimateTpm(), the threshold search passes rhats[lreg,2] to estimate_and_bootstrap(). For the second threshold, this element has not yet been estimated and is still zero. As a result, the routine repeats the single-threshold estimation, producing identical LR profiles for both thresholds. The fix is to pass the previously estimated thresholds, rhats[1:lreg-1,2].
In the bootstrap loop of estimate_and_bootstrap(), the call to compute_optimal_threshold() contains an extra argument (self.trimming_values). Removing it fixes the runtime error encountered after correcting the first issue.
Both fixes have been tested using the package's Hansen (1999) investment panel example with 20 cross-sectional units. Before the fixes, both thresholds were estimated at 0.26826, and the LR profiles were identical. After the fixes, the thresholds are 0.26826 and 0.32031, with a maximum absolute difference of 4.05821 between the LR profiles.
I've attached a single patch against the original version 2.3 of Threshold_Panel.gfn.
Activity