Hi Andreas,

that the estimates are usually different is also noted in the help text. The approaches have different criteria which they implicitly or explicitly optimize.

In particular, a deeper problem is non-identification of the threshold estimate under H0, i.e. if no threshold effect exists. In this situation, various estimators of the non-existing effect could be all over the place. Do you find clear rejection of the null of no threshold in your application?

Of course, assuming that a threshold is there, the estimates refer to the same object/parameter, so if it's "totally different", it's very understandable that it feels strange. There would be a bunch of possible reasons for that: econometrically I'd say for example small sample and/or model mis-specification of various kinds, or in terms of usage perhaps different implicit option settings for the two approaches? And finally, to be honest, it's always possible that there's a software bug somewhere. Maybe you could cross-check with the R-packaged version of Hansen's code, e.g. this one: https://github.com/mlkremer/thrreg.

Hope this helps

sven

Am 08.04.2025 um 16:49 schrieb Andreas Zervas:
Hi all, especially Sven,

I was playing with the package thres_infer, and it appears that the threshold estimates from functions H_thresh_test() and H_thresh_estim() differ. Is it intented? Should they be the same? In the particular example from the sample script, which I pasted below, the values are similar, but I run it with data that give totally different results.

Any thought - suggestions?

Best regards,

Andreas





gretl version 2024d
Current session: 2025-04-08 16:37

# Sample script for thresh_infer

Read datafile C:\Program Files\gretl\data\misc\denmark.gdt
periodicity: 4, maxobs: 55
observations range: 1974:1 to 1987:3

Listing 5 variables:
  0) const    1) LRM      2) LRY      3) IBO      4) IDE    

Test of Null of No Threshold Against Alternative of Threshold
Under Maintained Assumption of Homoskedastic Errors

Number of Bootstrap Replications: 1000
Trimming percentage: 0.150000

Threshold Estimate: 0.088000
 (46 % of obs in 1st regime)
LM-test for no threshold: 4.154898
Bootstrap p-value: 0.923000

*******************************************
Threshold regression based on Hansen (2000)
User choice: assume homoskedasticity
*******************************************
Global OLS Estimation, Without Threshold

Dependent Variable: mg
OLS Standard Errors Reported

             coefficient   std. error      z      p-value
  -------------------------------------------------------
  Constant    0.0705718    0.0272334     2.591    0.0096  ***
  IBO        -0.469693     0.229408     -2.047    0.0406  **
  IDE         0.110332     0.500081      0.2206   0.8254

  Observations = 54
  Degrees of Freedom = 51
  Sum of Squared Errors = 0.0487311
  Residual Variance = 0.000955512
  R-squared = 0.162774
  Heterosked. test p-val = 0.365732

*************************************************************
Threshold Estimation, dependent variable: mg

Threshold Variable: IDE
Threshold Estimate = 0.074    90% CI: [0.074, 0.11]
Sum of Sq. Errors = 0.0435625    Residual Var. = 0.000907553
Joint R-squared = 0.252
Heterosked. test p-value: 0.225

*************************************************************
Regime 1: IDE <= 0.074000
 (standard errors do not take into account threshold uncertainty)

             coefficient   std. error      z      p-value
  -------------------------------------------------------
  Constant    -0.833454     0.386015    -2.159    0.0308  **
  IBO         -0.774593     0.915857    -0.8458   0.3977
  IDE         13.4116       6.06844      2.210    0.0271  **

  Observations = 5
  Degrees of Freedom = 2
  Sum of Squared Errors = 0.00612267
  Residual Variance = 0.00306133
  R-squared = 0.425631

Regime 2: IDE > 0.074000
 (standard errors do not take into account threshold uncertainty)

             coefficient   std. error      z      p-value
  -------------------------------------------------------
  Constant    0.0727286    0.0303053     2.400    0.0164  **
  IBO        -0.487763     0.233237     -2.091    0.0365  **
  IDE         0.116314     0.505722      0.2300   0.8181

  Observations = 49
  Degrees of Freedom = 46
  Sum of Squared Errors = 0.0374399
  Residual Variance = 0.000813911
  R-squared = 0.178561




_______________________________________________
Gretl-users mailing list -- gretl-users@gretlml.univpm.it
To unsubscribe send an email to gretl-users-leave@gretlml.univpm.it
Website: https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/