Home > Blockchain >  Impulse response function in R not generating plots due to not applicable method
Impulse response function in R not generating plots due to not applicable method

Time:10-18

i try to run a IRF analysis on a Data frame with 3 variables:

Time Series Data Frame

Where Model1 looks like this:

Model1

library(vars) and library(varEst) are used

However, when i try

plot(varp.irfs, plot.type="multiple")

following error appears:

Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'plot': object 'varp.irfs' not found

Which refers to a missing object varp.irfs.

Also, if i try alternatives like:

plot(irf(Model1,n.ahead=10))

I get similar error message:

Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'plot': no applicable method for 'irf' applied to an object of class "varest"

CodePudding user response:

That is clearly an error related to the handling of packages. So no sample data or likewise is needed.

loading the library(vars) results in:

Loading required package: MASS

Attaching package: ‘MASS’

The following object is masked from ‘package:dplyr’:

    select

Loading required package: strucchange
Loading required package: sandwich

Attaching package: ‘strucchange’

The following object is masked from ‘package:stringr’:

I will now try to load the library as first one.

CodePudding user response:

Solution - as expected was independent of any data examples. The library (vars) has to be loaded singularly, so no other libary uses same function. So disabling and enabling libraries in multiple code runs was the solution.

  • Related