Closed AnastaDim closed 2 years ago
Hi Anastasia
It seems you are running into various issues, and asking here many distinct questions. I think the main problem is that you did not install rtools on your computer (see message: WARNING: Rtools is required to build R packages
)? This would allow you to have the dev version of tsdyn, and then run the reproducible (your example was not reproducible) example below:
library(tsDyn)
#> Registered S3 method overwritten by 'quantmod':
#> method from
#> as.zoo.data.frame zoo
packageVersion("tsDyn")
#> [1] '0.9.48.999'
t5<-TVAR(zeroyld, lag=3, nthresh=1, thDelay=1, trim=0.1, mTh=2, plot=FALSE)
#> Best unique threshold 9.91
sig=apply(t5$residuals,2,sd);sig
#> short.run long.run
#> 0.2949858 0.5022370
grifs.t=tsDyn::GIRF(t5)
plot(grifs.t)
Created on 2021-11-28 by the reprex package (v2.0.1)
Thank you very much ! L will try that right now.
Hi Anastaia. Could you solve the problem?? I have same problem!!
hi, have you solved the problem? thank you
Hello,
Still trying to solve it. As soon as I find out I will let you know.
Best, Anastasia
Από: ninowski @.> Στάλθηκε: Τετάρτη, 28 Σεπτεμβρίου 2022 12:38 μμ Προς: MatthieuStigler/tsDyn @.> Κοιν.: AnastaDim @.>; Author @.> Θέμα: Re: [MatthieuStigler/tsDyn] TVAR and GIRF (Issue #37)
hi, have you solved the problem? thank you
— Reply to this email directly, view it on GitHubhttps://github.com/MatthieuStigler/tsDyn/issues/37#issuecomment-1260649426, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWSPANLNYI7XOZCZIXBFDKLWAQGZNANCNFSM5IM7BHKA. You are receiving this because you authored the thread.Message ID: @.***>
Hi everyone, the issue reported above is not reproducible, and I believe it has been solved in the meanwhile. Find the reprex below, where the code works as expected.
@zahrasaranik @AnastaDim @ninowski can you please indicate what is not working, by providing a clear reprex, or showing how you are not able to replicate the issue below? Without more information and clear output error, it is hard to provide any help.
install.packages("tsDyn")
#> Installing package into '/home/mstigler/R/x86_64-pc-linux-gnu-library/4.2'
#> (as 'lib' is unspecified)
library(tsDyn)
#> Registered S3 method overwritten by 'quantmod':
#> method from
#> as.zoo.data.frame zoo
packageVersion("tsDyn")
#> [1] '11.0.2'
t5<-TVAR(zeroyld, lag=3, nthresh=1, thDelay=1, trim=0.1, mTh=2, plot=FALSE)
#> Best unique threshold 9.91
sig=apply(t5$residuals,2,sd);sig
#> short.run long.run
#> 0.2949858 0.5022370
grifs.t=tsDyn::GIRF(t5)
plot(grifs.t)
Created on 2022-09-28 with reprex v2.0.2
Thank you for your prompt reply. I would like to know how I can graph the generalised impulse responses for the shock of one variable on the other variables in my non-linear model. I can only get the graph of the density function. One last thing: how can I get confidence bound from the empirical distribution of simulated GIRFs assuming normality? This is my code: tvv <- TVAR(g3, lag=2, nthresh=1, thDelay=1, trim=0.1, mTh=1, plot=FALSE) girf<-GIRF(tvv) sig=apply(tvv$residuals,2,sd);sig
grifs.t=tsDyn::GIRF(tvv) plot(grifs.t)
Thank you for your help
these are very different questions form the one here. Can you please open a distinct issue for each of these questions, with reproducible example on how far you went?
As another issue was open, I am going to close this one, as it us not specific enough and does not provide a reproducible example.
My name is Anastasia, and I am a PhD student. This period I am working on a project using TVAR model and GIRF functions. However, I am facing some difficulties and I would appreciate it if you could provide me some insight regarding the coding. I use the dataset attached below.
data<-read.csv("two.csv") y <- ts(data$Total, start = c(1985,1,1), frequency = 12) x <- ts(data$Core, start = c(1985,1,1), frequency = 12) library(tsDyn)
>Registered S3 method overwritten by 'quantmod':
> method from
>as.zoo.data.frame zoo
v2 <- cbind(y, x) colnames(v2) <- cbind("t","c") t5<-TVAR(v2, lag=3, nthresh=1, thDelay=1, trim=0.1, mTh=2, plot=FALSE)
>Best unique threshold 3.16
sig=apply(t5$residuals,2,sd);sig
> t c
>0.4030384 0.2723124
library(tvarGIRF) grifs.t=GIRF(t5,shock=sig) print(grifs.t)
> GIRF of tvar t5
My questions are:
Also, I tried to install " install_github("MatthieuStigler/tsDyn/tsDyn", ref = "Dev94", force = T)", and this is the outcome:
library(devtools) install_github("MatthieuStigler/tsDyn/tsDyn", ref = "Dev94", force = T)
>WARNING: Rtools is required to build R packages, but no version of Rtools compatible with R 4.1.2 was found. (Only the following #>incompatible version(s) of Rtools were found:3.5)
>Please download and install Rtools 4.0 from https://cran.r-project.org/bin/windows/Rtools/.#>
>Downloading GitHub repo MatthieuStigler/tsDyn@Dev94
>Please download and install Rtools 4.0 from https://cran.r-project.org/bin/windows/Rtools/.
>Error: Failed to install 'tsDyn' from GitHub:
>Could not find tools necessary to compile a package
>Call pkgbuild::check_build_tools(debug = TRUE) to diagnose the problem.
install_github("MatthieuStigler/tsDyn/tsDyn", ref = "Dev94", force = T)
>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: tibble (3.1.5 -> 3.1.6 ) [CRAN]
>5: glue (1.4.2 -> 1.5.0 ) [CRAN]
>6: RcppArmad... (0.10.7.0.0 -> 0.10.7.3.0) [CRAN]
>7: tseries (0.10-48 -> 0.10-49 ) [CRAN]
>8: lmtest (0.9-38 -> 0.9-39 ) [CRAN]
Enter one or more numbers, or an empty line to skip updates: 1
>tibble (3.1.5 -> 3.1.6 ) [CRAN]
>glue (1.4.2 -> 1.5.0 ) [CRAN]
>RcppArmad... (0.10.7.0.0 -> 0.10.7.3.0) [CRAN]
>tseries (0.10-48 -> 0.10-49 ) [CRAN]
>lmtest (0.9-38 -> 0.9-39 ) [CRAN]
>Installing 5 packages: tibble, glue, RcppArmadillo, tseries, lmtest
>Installing packages into ‘C:/Users/DEF/Documents/R/win-library/4.1’
>(as ‘lib’ is unspecified)
>trying URL 'https://mirror.csclub.uwaterloo.ca/CRAN/bin/windows/contrib/4.1/tibble_3.1.6.zip'
>Content type 'application/zip' length 871879 bytes (851 KB)
>downloaded 851 KB
>trying URL 'https://mirror.csclub.uwaterloo.ca/CRAN/bin/windows/contrib/4.1/glue_1.5.0.zip'
>Content type 'application/zip' length 162840 bytes (159 KB)
>downloaded 159 KB
>trying URL 'https://mirror.csclub.uwaterloo.ca/CRAN/bin/windows/contrib/4.1/RcppArmadillo_0.10.7.3.0.zip'
>Content type 'application/zip' length 2388490 bytes (2.3 MB)
>downloaded 2.3 MB
>trying URL 'https://mirror.csclub.uwaterloo.ca/CRAN/bin/windows/contrib/4.1/tseries_0.10-49.zip'
>Content type 'application/zip' length 410064 bytes (400 KB)
>downloaded 400 KB
>trying URL 'https://mirror.csclub.uwaterloo.ca/CRAN/bin/windows/contrib/4.1/lmtest_0.9-39.zip'
>Content type 'application/zip' length 414874 bytes (405 KB)
>downloaded 405 KB
>package ‘tibble’ successfully unpacked and MD5 sums checked
>Warning: cannot remove prior installation of package ‘tibble’
>Warning: restored ‘tibble’
>package ‘glue’ successfully unpacked and MD5 sums checked
>Warning: cannot remove prior installation of package ‘glue’
>Warning: restored ‘glue’
>package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
>package ‘tseries’ successfully unpacked and MD5 sums checked
>Warning: cannot remove prior installation of package ‘tseries’
>Warning: restored ‘tseries’
>package ‘lmtest’ successfully unpacked and MD5 sums checked
>Warning: cannot remove prior installation of package ‘lmtest’
>Warning: restored ‘lmtest’
>The downloaded binary packages are in
> C:\Users\DEF\AppData\Local\Temp\RtmpYfOfXL\downloaded_packages
> checking for file 'C:\Users\DEF\AppData\Local\Temp\RtmpYfOfXL\remotes27d03d4c7d66\MatthieuStigler-tsDyn-#>0852a54\tsDyn/DESCRIPTION' ...
> checking for file 'C:\Users\DEF\AppData\Local\Temp\RtmpYfOfXL\remotes27d03d4c7d66\MatthieuStigler-tsDyn-#>0852a54\tsDyn/DESCRIPTION' ...
>√ checking for file 'C:\Users\DEF\AppData\Local\Temp\RtmpYfOfXL\remotes27d03d4c7d66\MatthieuStigler-tsDyn-#>0852a54\tsDyn/DESCRIPTION'
>- preparing 'tsDyn':
>checking DESCRIPTION meta-information ...
>checking DESCRIPTION meta-information ...
>√ checking DESCRIPTION meta-information
>- cleaning src
>- checking for LF line-endings in source and make files and shell scripts
>- checking for empty or unneeded directories
>- building 'tsDyn_0.9-48.999.tar.gz'
>Warning: package ‘tsDyn’ is in use and will not be installed
>Warning messages:
>1: In file.copy(savedcopy, lib, recursive = TRUE) :
> problem copying C:\Users\DEF\Documents\R\win-libr
two.csv ary\4.1\00LOCK\tibble\libs\x64\tibble.dll to C:\Users\DEF\Documents\R\win-#>library\4.1\tibble\libs\x64\tibble.dll: Permission denied
>2: In file.copy(savedcopy, lib, recursive = TRUE) :
> problem copying C:\Users\DEF\Documents\R\win-library\4.1\00LOCK\glue\libs\x64\glue.dll to C:\Users\DEF\Documents\R\win-#>library\4.1\glue\libs\x64\glue.dll: Permission denied
>3: In file.copy(savedcopy, lib, recursive = TRUE) :
> problem copying C:\Users\DEF\Documents\R\win-library\4.1\00LOCK\tseries\libs\x64\tseries.dll to #>C:\Users\DEF\Documents\R\win-library\4.1\tseries\libs\x64\tseries.dll: Permission denied
>4: In file.copy(savedcopy, lib, recursive = TRUE) problem copying
>C:\Users\DEF\Documents\R\win-library\4.1\00LOCK\lmtest\libs\x64\lmtest.dll to C:\Users\DEF\Documents\R\win-library\4.1\lmtest\libs\x64\lmtest.dll: Permission denied
Thank you, Anastasia two.csv