Am 17.03.2025 um 09:11 schrieb Riccardo (Jack) Lucchetti:
On 17/03/2025 00:01, Olivo Victor wrote:
Hello Everyone:

Is there a simple way to get and save the residuals in the Bai-Perron and thresh_infer 0.1 packages?

For ther Bai-Perron package,

Ahem, for the record, Jack, our package is called "StrucBreak".

About thresh_infer: Thanks for the feedback; neither the basic inputs like the specified regressor list nor auxiliary output like the residuals are currently stored in the returned bundle, and they probably should be in the next version of the package.

Currently, I think you can get the residuals for the estimated two-regime model as follows:

= y - (b.whichregime==1) * lincomb(const || rhs, b.Regime1.coeff) - (b.whichregime==2) * lincomb(const || rhs, b.Regime2.coeff)

Here, "y" stands for the name of your dependent variable series, "rhs" stands for the list of regressors, and "b" is your chosen name for the returned bundle from the H_thresh_estim call. Adjust the line accordingly. All the other names and identifiers are given by the thresh_infer package. (Except "lincomb", which is a gretl function for doing --guess what-- a linear combination.) OK, the line is a bit long, but quite intuitive and self-explanatory, I think. Please verify if the result makes sense, because I haven't really tested it yet.

cheers

sven

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

Reply via email to