Package check result: ERROR Check: examples, Result: ERROR Running examples in ‘DistributionIV-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: div > ### Title: Distributional IV Model Function > ### Aliases: div > > ### ** Examples > > ## No test: > # Simulate data ------------------------------------------------------------- > p_Z <- 4 > p_X <- 2 > > set.seed(2209) > n_train <- 1000 > Z <- matrix(rnorm(n_train * p_Z, mean = 2), ncol = p_Z) > H <- rnorm(n_train, mean = 0, sd = 1.5) > X1 <- 0.1 * (Z[, 1] + rnorm(n_train, sd = 0.1)) ^ 2 + + (Z[, 2] + rnorm(n_train, sd = 1)) ^ 2 + H + rnorm(n_train, sd = 0.1) > X2 <- 0.5 * (Z[, 3] + Z[, 4]) ^ 2 + 0.1 * H ^ 2 + rnorm(n_train, sd = 0.1) > X <- matrix(cbind(X1, X2), ncol = p_X) > Y <- 0.5 * X[, 1] + 0.2 * (X[, 2] + rnorm(n_train, sd = 0.2) + H) ^ 2 + + rnorm(n_train, sd = 0.1) > > n_test <- n_train > Ztest <- matrix(rnorm(n_test * p_Z, mean = 2), ncol = p_Z) > Htest <- rnorm(n_test, mean = 0, sd = 1.5) > X1test <- 0.1 * (Ztest[, 1] + rnorm(n_test, sd = 0.1)) ^ 2 + + (Ztest[, 2] + rnorm(n_test, sd = 1)) ^ 2 + Htest + rnorm(n_test, sd = 0.1) > X2test <- 0.5 * (Ztest[, 3] + Ztest[, 4]) ^ 2 + 0.1 * Htest ^ 2 + rnorm(n_test, sd = 0.1) > Xtest <- matrix(cbind(X1test, X2test), ncol = p_X) > Ytest <- 0.5 * Xtest[, 1] + 0.2 * (Xtest[, 2] + rnorm(n_test, sd = 0.2) + Htest) ^ 2 + + rnorm(n_test, sd = 0.1) > > # Fit generativeIV model ---------------------------------------------------- > # Consider increasing number of epochs. Here: num_epochs = 100 for fast computation only. > DIV_model <- div(Z = Z, X = X, Y = Y, num_epochs = 100) Torch dependencies are missing. Please install them using torch::install_torch(). Error in (function (size, options, memory_format) : Lantern is not loaded. Please use `install_torch()` to install additional dependencies. Calls: div ... call_c_function -> do_call -> do.call -> Execution halted