Issue starting midas code

Hello, I am trying to start a code with midas package installed. On the internet, I have not found any similar issue.

library(midasml)

high_frequency_data <- c(1, 2, 3, 4, 5)
low_frequency_data <- c(10, 20, 30)

lags <- c(1, 2)  
midas_model <- midas_r(high_frequency_data, low_frequency_data, lags = lags)

summary(midas_model)

even when I use midasr package, the issue persists.

type orlibrary(midasr)

high_frequency_data <- c(1, 2, 3, 4, 5)
low_frequency_data <- c(10, 20, 30)

lags <- c(1, 2)  
midas_model <- midas_r(high_frequency_data, low_frequency_data, lags = lags)

summary(midas_model) paste code here

This is the error I get:

Loading required package: sandwich
Loading required package: optimx
Loading required package: quantreg
Loading required package: SparseM

Attaching package: ‘SparseM’

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

    backsolve

Registered S3 method overwritten by 'quantmod':
  method            from
  as.zoo.data.frame zoo
Error in new.env(parent = environment(formula)) :
  use of NULL environment is defunct
Calls: midas_r -> new.env
Execution halted

Any help would be welcome

The only similarly function is midas.ardl(), which takes these arguments for which no default is specified

x high-frequency variable tags
y the response variable
z another, low-frequency variate or AR lags

library(midasml)
#> Loading required package: Matrix
set.seed(1)
x = matrix(rnorm(100 * 20), 100, 20)
z = rnorm(100)
y = rnorm(100)
midas.ardl(y = y, x = x, z = z)
#>  (Intercept)    other-1       Poly-0     Poly-1      Poly-2     Poly-3
#>   0.06512028 0.01448906 -0.003542081 -0.0349882 -0.02725449 0.01344281
#> attr(,"class")
#> [1] "midas.ardl"     "midas.legendre"

Created on 2023-07-31 with reprex v2.0.2

It appears that at a minimum you need to provide the response variable, y.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.