MatthieuStigler / tsDyn

tsDyn
tsdyn.googlecode.com
34 stars 20 forks source link

unable to find TVECM two regime impulse response fig #35

Closed Rfileforme88 closed 2 years ago

Rfileforme88 commented 2 years ago

library(tsDyn) data(zeroyldMeta) Warning message: In data(zeroyldMeta) : data set ‘zeroyldMeta’ not found install_github("MatthieuStigler/tsDyn/tsDyn", ref = "Dev94") Downloading GitHub repo MatthieuStigler/tsDyn@Dev94 These packages have more recent versions available. It is recommended to update all of them. Which would you like to update? library(tsDyn) data(zeroyldMeta) Warning message: In data(zeroyldMeta) : data set ‘zeroyldMeta’ not found install_github("MatthieuStigler/tsDyn/tsDyn", ref = "Dev94") Downloading GitHub repo MatthieuStigler/tsDyn@Dev94 These packages have more recent versions available. It is recommended to update all of them. Which would you like to update?

1: All
2: CRAN packages only
3: None
4: Rcpp (1.0.6 -> 1.0.7 ) [CRAN] 5: curl (4.3.1 -> 4.3.2 ) [CRAN] 6: utf8 (1.2.1 -> 1.2.2 ) [CRAN] 7: colorspace (2.0-1 -> 2.0-2 ) [CRAN] 8: fansi (0.4.2 -> 0.5.0 ) [CRAN] 9: tibble (3.1.2 -> 3.1.5 ) [CRAN] 10: rlang (0.4.11 -> 0.4.12) [CRAN] 11: digest (0.6.27 -> 0.6.28) [CRAN] 12: deSolve (1.28 -> 1.30 ) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 2 Rcpp (1.0.6 -> 1.0.7 ) [CRAN] curl (4.3.1 -> 4.3.2 ) [CRAN] utf8 (1.2.1 -> 1.2.2 ) [CRAN] colorspace (2.0-1 -> 2.0-2 ) [CRAN] fansi (0.4.2 -> 0.5.0 ) [CRAN] tibble (3.1.2 -> 3.1.5 ) [CRAN] rlang (0.4.11 -> 0.4.12) [CRAN] digest (0.6.27 -> 0.6.28) [CRAN] deSolve (1.28 -> 1.30 ) [CRAN] Installing 9 packages: Rcpp, curl, utf8, colorspace, fansi, tibble, rlang, digest, deSolve Installing packages into ‘C:/Users/Welcome/Documents/R/win-library/4.1’ (as ‘lib’ is unspecified)

There is a binary version available but the source version is later: binary source needs_compilation rlang 0.4.11 0.4.12 TRUE

zero_hstest <- TVECM.HStest(data = zeroyld[, c("long.run","short.run")],nboot = 500, lag = 2)

zero_hstest

Test of linear versus threshold cointegration of Hansen and Seo (2002)

Test Statistic: 28.25621 (Maximized for threshold value: -0.1329947 ) P-Value: 0.016 ( Fixed regressor bootstrap )

vecm_rest <- VECM(zeroyld[, c("long.run", "short.run")], r=1,lag =1, estim = "ML", beta = c(1, -1)) c(ll_restricted = logLik(vecm_rest), ll_unrestricted =logLik(vecm_simple)) ll_restricted ll_unrestricted -275.3940 -275.2995 tvec_b1 <- TVECM(zeroyld[, c("long.run", "short.run")],lag = 2,ngridTh = 300, beta = list(exact = 1)) 2 (0.7%) points of the grid lead to regimes with percentage of observations < trim and were not computed tvec_b1 Model TVECM with 1 thresholds

$Bdown ECT Const long.run t -1 short.run t -1 long.run t -2 short.run t -2 Equation long.run -0.04539740 -0.01402965 0.1672832 0.14929464 -0.04649894 0.093122884 Equation short.run 0.01224638 0.01531765 0.0781046 -0.03253936 -0.01787635 0.007451146

$Bup ECT Const long.run t -1 short.run t -1 long.run t -2 short.run t -2 Equation long.run -0.9746974 1.2234335 0.06697354 0.5555664 0.08647546 -0.7689766 Equation short.run 0.0763864 0.2211566 -0.20666272 0.1123809 -0.10741548 -0.4395419

Threshold value[1] 0.813

plot_ECT(tvec_b1, legend.location = "bottomright") Error in plot_ECT(tvec_b1, legend.location = "bottomright") : could not find function "plot_ECT"

MatthieuStigler commented 2 years ago

great. Can you please close the corresponding issue, as well as remove the text you added on another unrelated issue?

Thanks!

Le mer. 27 oct. 2021 à 08:26, Rfileforme88 @.***> a écrit :

library(tsDyn) data(zeroyldMeta) Warning message: In data(zeroyldMeta) : data set ‘zeroyldMeta’ not found install_github("MatthieuStigler/tsDyn/tsDyn", ref = "Dev94") Downloading GitHub repo @. These packages have more recent versions available. It is recommended to update all of them. Which would you like to update? library(tsDyn) data(zeroyldMeta) Warning message: In data(zeroyldMeta) : data set ‘zeroyldMeta’ not found install_github("MatthieuStigler/tsDyn/tsDyn", ref = "Dev94") Downloading GitHub repo @. These packages have more recent versions available. It is recommended to update all of them. Which would you like to update?

1: All 2: CRAN packages only 3: None 4: Rcpp (1.0.6 -> 1.0.7 ) [CRAN] 5: curl (4.3.1 -> 4.3.2 ) [CRAN] 6: utf8 (1.2.1 -> 1.2.2 ) [CRAN] 7: colorspace (2.0-1 -> 2.0-2 ) [CRAN] 8: fansi (0.4.2 -> 0.5.0 ) [CRAN] 9: tibble (3.1.2 -> 3.1.5 ) [CRAN] 10: rlang (0.4.11 -> 0.4.12) [CRAN] 11: digest (0.6.27 -> 0.6.28) [CRAN] 12: deSolve (1.28 -> 1.30 ) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 2 Rcpp (1.0.6 -> 1.0.7 ) [CRAN] curl (4.3.1 -> 4.3.2 ) [CRAN] utf8 (1.2.1 -> 1.2.2 ) [CRAN] colorspace (2.0-1 -> 2.0-2 ) [CRAN] fansi (0.4.2 -> 0.5.0 ) [CRAN] tibble (3.1.2 -> 3.1.5 ) [CRAN] rlang (0.4.11 -> 0.4.12) [CRAN] digest (0.6.27 -> 0.6.28) [CRAN] deSolve (1.28 -> 1.30 ) [CRAN] Installing 9 packages: Rcpp, curl, utf8, colorspace, fansi, tibble, rlang, digest, deSolve Installing packages into ‘C:/Users/Welcome/Documents/R/win-library/4.1’ (as ‘lib’ is unspecified)

There is a binary version available but the source version is later: binary source needs_compilation rlang 0.4.11 0.4.12 TRUE

zero_hstest <- TVECM.HStest(data = zeroyld[, c("long.run","short.run")],nboot = 500, lag = 2)

zero_hstest

Test of linear versus threshold cointegration of Hansen and Seo (2002)

Test Statistic: 28.25621 (Maximized for threshold value: -0.1329947 ) P-Value: 0.016 ( Fixed regressor bootstrap )

vecm_rest <- VECM(zeroyld[, c("long.run", "short.run")], r=1,lag =1, estim = "ML", beta = c(1, -1)) c(ll_restricted = logLik(vecm_rest), ll_unrestricted =logLik(vecm_simple)) ll_restricted ll_unrestricted -275.3940 -275.2995 tvec_b1 <- TVECM(zeroyld[, c("long.run", "short.run")],lag = 2,ngridTh = 300, beta = list(exact = 1)) 2 (0.7%) points of the grid lead to regimes with percentage of observations < trim and were not computed tvec_b1 Model TVECM with 1 thresholds

$Bdown ECT Const long.run t -1 short.run t -1 long.run t -2 short.run t -2 Equation long.run -0.04539740 -0.01402965 0.1672832 0.14929464 -0.04649894 0.093122884 Equation short.run 0.01224638 0.01531765 0.0781046 -0.03253936 -0.01787635 0.007451146

$Bup ECT Const long.run t -1 short.run t -1 long.run t -2 short.run t -2 Equation long.run -0.9746974 1.2234335 0.06697354 0.5555664 0.08647546 -0.7689766 Equation short.run 0.0763864 0.2211566 -0.20666272 0.1123809 -0.10741548 -0.4395419

Threshold value[1] 0.813

plot_ECT(tvec_b1, legend.location = "bottomright") Error in plot_ECT(tvec_b1, legend.location = "bottomright") : could not find function "plot_ECT"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MatthieuStigler/tsDyn/issues/35, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2SKFQZHW7KMPK4NLBOF3UI74XRANCNFSM5G2LKOJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.