angusmoore / tvargirf Goto Github PK
View Code? Open in Web Editor NEWGIRFs for threshold VARs from the R tsDyn package
License: MIT License
GIRFs for threshold VARs from the R tsDyn package
License: MIT License
I want to estimate a TVAR with a threshold external to the model.
I cannot get the state-dependent GIRFs and the relative confidence interval. Specifically, I would like to get confidence bound from the empirical distribution of simulated GIRFs, assuming normality.
I run the below code:
data(zeroyld)
x=rnorm(482)
xx=as.vector(x)
xx=as.vector(x,mode="any")
t5<-TVAR(zeroyld, lag=3, nthresh=1, thDelay=1, thVar=xx, gamma=0.248, trim=0.1, mTh=2, plot=FALSE)
library(tvarGIRF)
c1=GIRF(t5, c(0,1),restrict.to=1)
I get an error: c1=GIRF(t5, c(0,1),restrict.to=1)
Error: Simulations of models with external transition variables (argument thVar in TVAR) not supported
So i detach the package tvarGIRF and I calculate the GIRF with GIRF {tsDyn}.
detach("package:tvarGIRF", unload = TRUE)
c2<-GIRF(t5)
A<-plot(c2,
plot_type = c( "line"),
n.ahead = c(1, 5, 10),
var = unique(c2$var)[1],
n_simu = c(50))
This command works but I can not obtain the state-dependent GIRF and the relative confidence intervals.
Thank you in advance,
Antonino
Hi~Moore,I have a bug when I run the following code related to GIRF:
the bugs demostrate that "Error in if (round(z2[i - thDelay], round_digits) <= Thresh[1]) { :
missing value where TRUE/FALSE needed"
And I have tied to figure out the problem but ended up with failure.
Could you please give me some help ? Thanks for your kind consideration.
Hi~Moore.Thank you for your related work on GIRF of TVAR. I have some question about the result. And I would appreciate it if you could reply.
After I run the following code
library(tsDyn)
library(tvarGIRF)
data(zeroyld)
exampleTVAR <- TVAR(zeroyld, lag=2, nthresh=1, thDelay=1, mTh=1, plot=FALSE)
girf_full <- GIRF(exampleTVAR4, c(0,1), horizon =10, H = 10, R = 50,restrict.to =NA )
girf_full[["responses"]]
the results show:
short.run long.run
1 -0.00493 0.996
2 0.0380 0.954
3 0.0105 0.888
4 0.0381 0.849
5 0.0828 0.831
6 0.110 0.799
7 0.126 0.795
8 0.105 0.729
9 0.131 0.671
10 0.142 0.643
The color of number " -0.00493" is red. And there are some underlines in the last number of "-0.00493"、“0.0380”、“0.0380”、“0.0380”、“0.0828”. What is the meaning of the red color and these underlines? Does these indicate the negtive number and redundant fractional parts ?
Is not correctly extending the generic
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.