R Under development (unstable) (2025-06-30 r88369 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(distfreereg) > > all.equal.distfreereg <- distfreereg:::all.equal.distfreereg > test_dfr_functions <- distfreereg:::test_dfr_functions > > fcl <- function(need, covlist) + distfreereg:::fill_covariance_list(need = need, covariance_list = covlist, + matsqrt_tol = distfreereg:::default_distfreereg_tol()[["matsqrt_tol"]], + solve_tol = distfreereg:::default_distfreereg_tol()[["solve_tol"]]) > > n <- 1e2 > func <- function(X, theta) theta[1] + theta[2]*X[,1] + theta[3]*X[,2] > set.seed(20250516) > Sig_list <- lapply(seq_len(n/2), function(i) rWishart(n/2, df = 2, Sigma = diag(2))[,,i]) > > set.seed(20250516) > Sig <- rWishart(1, df = n, Sigma = diag(n))[,,1] > P <- fcl(need = "P", list(Sigma = Sig))[["P"]] > SqrtSigma <- fcl(need = "SqrtSigma", list(P = P))[["SqrtSigma"]] > Q <- fcl(need = "Q", list(SqrtSigma = SqrtSigma))[["Q"]] > > X <- matrix(rexp(2*n, rate = 1), nrow = n) > colnames(X) <- c("a", "b") > > theta <- c(2,5,1) > Y <- distfreereg:::f2ftheta(f = func, X)(theta) + + as.vector(distfreereg:::rmvnorm(n = n, reps = 1, mean = rep(0,n), SqrtSigma = distfreereg:::matsqrt(Sig))) > > set.seed(20250516) > dfr_func <- distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")) > dfr_func Number of observations: 100 Length of EPSP: 100 Monte Carlo simulations: 10000 Estimated parameter values: theta1 theta2 theta3 1.559e+00 5.363e+00 1.136e+00 Observed statistics: Stat Value Pr(>Value) MCSE KS 6.440e-01 6.885e-01 4.631e-03 CvM 6.841e-02 7.406e-01 4.383e-03 KSmax 6.440e-01 3.628e-01 4.808e-03 KSmin 1.973e-01 8.753e-01 3.304e-03 --- `MCSE' is the Monte Carlo standard error of the estimated p-value. > print(dfr_func, show_params = FALSE) Number of observations: 100 Length of EPSP: 100 Monte Carlo simulations: 10000 Observed statistics: Stat Value Pr(>Value) MCSE KS 6.440e-01 6.885e-01 4.631e-03 CvM 6.841e-02 7.406e-01 4.383e-03 KSmax 6.440e-01 3.628e-01 4.808e-03 KSmin 1.973e-01 8.753e-01 3.304e-03 --- `MCSE' is the Monte Carlo standard error of the estimated p-value. > update(dfr_func, override = list(theta_hat = rep(1, length(dfr_func[["theta_hat"]])))) Number of observations: 100 Length of EPSP: 100 Monte Carlo simulations: 10000 Estimated parameter values: theta1 theta2 theta3 1.000e+00 1.000e+00 1.000e+00 Observed statistics: Stat Value Pr(>Value) MCSE KS 3.725e+01 <1.000e-04 NA CvM 4.675e+02 <1.000e-04 NA KSmax -4.815e-01 >9.999e-01 NA KSmin 3.725e+01 <1.000e-04 NA --- `MCSE' is the Monte Carlo standard error of the estimated p-value. > > dfr_func_mod <- dfr_func > dfr_func_mod[["p"]][["value"]] <- c(0,1,0,1) > names(dfr_func_mod[["p"]][["value"]]) <- names(dfr_func[["p"]][["value"]]) > dfr_func_mod Number of observations: 100 Length of EPSP: 100 Monte Carlo simulations: 10000 Estimated parameter values: theta1 theta2 theta3 1.559e+00 5.363e+00 1.136e+00 Observed statistics: Stat Value Pr(>Value) MCSE KS 6.440e-01 <1.000e-04 4.631e-03 CvM 6.841e-02 >9.999e-01 4.383e-03 KSmax 6.440e-01 <1.000e-04 4.808e-03 KSmin 1.973e-01 >9.999e-01 3.304e-03 --- `MCSE' is the Monte Carlo standard error of the estimated p-value. > > set.seed(20250516) > dfr_func_ungrouped <- distfreereg(Y = Y, X = X, test_mean = func, group = FALSE, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")) > > set.seed(20250516) > dfr_func_no_X <- distfreereg(Y = Y, test_mean = function(theta) theta, + covariance = list(Sigma = Sig), + theta_init = 1, verbose = FALSE, + control = list(return_on_error = FALSE)) > > set.seed(20250516) > dfr_func_verbose <- distfreereg(Y = matrix(Y), X = rnorm(n), + test_mean = function(X, theta) theta*X[,1], + covariance = list(Sigma = Sig), + theta_init = 1, + override = list(J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + mcsim_stats = dfr_func[["mcsim_stats"]]), + control = list(return_on_error = FALSE, + theta_hat_name = "hello"), + stat = c("KS", "CvM", "KSmax", "KSmin")) Coercing Y to vector... Coercing X to matrix... Calculating the inverse square root of the covariance matrix... Estimating parameters... Using supplied fitted values... Using supplied Jacobian... Using supplied inverse square root of the covariance matrix... Calculating mu... Ordering observations by simplex method... Calculating transformation anchors... Calculating r_tilde... Calculating residuals... All covariate observations are unique; no grouping done... Calculating empirical partial sum process... Calculating observed statistic(s)... Using supplied Monte Carlo simulation results... Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : No alternative optimization function specified; using optim() by default, ignoring 'fun_to_optimize_arg', 'theta_init_arg', and 'theta_hat_name' > > set.seed(20250516) > dfr_func_J_for_r <- distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma =Sig), + theta_init = c(1,1,1), verbose = FALSE, + override = list(r = dfr_func[["mu"]]), + control = list(return_on_error = FALSE)) Warning messages: 1: In k2(r_tilde[, i], mu[, j], r_tilde[, j], k2_tol = k2_tol) : Matching columns found in mu and r_tilde that have scalar product nearly equal to 1 2: In k2(r_tilde[, i], mu[, j], r_tilde[, j], k2_tol = k2_tol) : Matching columns found in mu and r_tilde that have scalar product nearly equal to 1 3: In k2(r_tilde[, i], mu[, j], r_tilde[, j], k2_tol = k2_tol) : Matching columns found in mu and r_tilde that have scalar product nearly equal to 1 4: In k2(output, r_tilde[, i], mu[, i], k2_tol = k2_tol) : Matching columns found in mu and r_tilde that have scalar product nearly equal to 1 5: In k2(output, r_tilde[, i], mu[, i], k2_tol = k2_tol) : Matching columns found in mu and r_tilde that have scalar product nearly equal to 1 6: In k2(output, r_tilde[, i], mu[, i], k2_tol = k2_tol) : Matching columns found in mu and r_tilde that have scalar product nearly equal to 1 > > set.seed(20250516) > dfr_func_list <- distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig_list), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")) > > set.seed(20250516) > dfr_func_vec <- distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = runif(n, min = 1, max = 2)), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")) > > set.seed(20250516) > dfr_func_P <- distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(P = P), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")) > set.seed(20250516) > dfr_func_SqrtSigma <- distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(SqrtSigma = SqrtSigma), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")) > set.seed(20250516) > dfr_func_Q <- distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Q = Q), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")) > > stopifnot(all.equal(dfr_func, dfr_func_P)) > stopifnot(all.equal(dfr_func, dfr_func_SqrtSigma)) > stopifnot(all.equal(dfr_func, dfr_func_Q)) > > newdata_function <- matrix(rexp(2*10), nrow = 10) > test_dfr_functions(dfr_func, newdata = newdata_function) theta1 theta2 theta3 1.56 5.36 1.14 2.5 % 97.5 % theta1 0.725 2.39 theta2 4.660 6.07 theta3 0.832 1.44 [1] 7.99 7.34 19.10 18.90 8.89 4.68 7.26 3.19 8.88 9.88 5.94 6.27 [13] 3.84 4.08 6.66 5.92 5.64 3.76 12.00 9.06 11.90 6.93 3.69 7.21 [25] 4.29 7.50 9.34 7.73 3.97 4.98 18.90 20.30 6.33 12.50 11.50 9.32 [37] 5.73 5.48 5.10 12.00 3.73 1.88 2.87 2.74 4.33 4.55 5.14 5.60 [49] 3.49 14.20 5.33 16.10 8.30 12.70 21.40 5.16 9.42 3.71 3.83 8.74 [61] 17.70 10.80 10.20 3.38 10.90 14.50 12.40 11.30 15.70 11.70 7.22 5.52 [73] 22.40 12.90 3.01 10.50 7.36 2.18 13.80 4.55 3.49 4.60 5.22 8.64 [85] 2.87 10.50 3.30 4.55 11.20 14.00 2.28 8.63 11.40 2.01 7.31 5.70 [97] 9.31 8.42 14.90 9.75 [1] 7.99 7.34 19.10 18.90 8.89 4.68 7.26 3.19 8.88 9.88 5.94 6.27 [13] 3.84 4.08 6.66 5.92 5.64 3.76 12.00 9.06 11.90 6.93 3.69 7.21 [25] 4.29 7.50 9.34 7.73 3.97 4.98 18.90 20.30 6.33 12.50 11.50 9.32 [37] 5.73 5.48 5.10 12.00 3.73 1.88 2.87 2.74 4.33 4.55 5.14 5.60 [49] 3.49 14.20 5.33 16.10 8.30 12.70 21.40 5.16 9.42 3.71 3.83 8.74 [61] 17.70 10.80 10.20 3.38 10.90 14.50 12.40 11.30 15.70 11.70 7.22 5.52 [73] 22.40 12.90 3.01 10.50 7.36 2.18 13.80 4.55 3.49 4.60 5.22 8.64 [85] 2.87 10.50 3.30 4.55 11.20 14.00 2.28 8.63 11.40 2.01 7.31 5.70 [97] 9.31 8.42 14.90 9.75 [1] 7.93 3.97 3.00 9.06 12.10 3.64 24.40 4.35 6.74 4.34 theta1 theta2 theta3 theta1 0.181000 -0.14500 0.000426 theta2 -0.145000 0.12900 -0.002180 theta3 0.000426 -0.00218 0.024000 > > plot(dfr_func, confband_args = NULL) > plot(dfr_func, confband_args = FALSE) > plot(dfr_func, confband_args = list(m = 50, + batch_len = 19, + N = 1e3, + conf.level = 0.9, + buffer = 0.05)) Warning message: In (function (x, w, func, m, batch_len, N, conf.level, buffer, matsqrt_tol) : Batch length, 19, does not evenly divide data length, 10000 > > plot(dfr_func, which = "residuals") > plot(dfr_func, which = "epsp") > > > cdfr_func <- asymptotics(dfr_func, reps = 5) Calculating required true covariance specification matrices... Generating errors... Running simulation... Repetition 1 of 5 Repetition 2 of 5 Repetition 3 of 5 Repetition 4 of 5 Repetition 5 of 5 > signif(rejection(cdfr_func, alpha = c(0.1, 0.5))[,2:3], digits = 3) alpha rate 1 0.1 0.0 2 0.5 0.4 3 0.1 0.0 4 0.5 0.4 5 0.1 0.0 6 0.5 0.4 7 0.1 0.0 8 0.5 0.4 > > tryCatch(rejection(cdfr_func, alpha = c(0.1, "a")), error = function(e) warning(e)) Warning message: In validate_numeric(alpha, min_len = 1, min_val = 0, max_val = 1) : alpha must be numeric; supplied value has class 'character' > tryCatch(rejection(cdfr_func, stat = "k"), error = function(e) warning(e)) Warning message: In validate_args_rejection(object = object, alpha = alpha, stat = stat) : Some specified statistic(s) not found in object > > > predict(dfr_func, newdata = 1:3) [1] 9.194051 Warning message: In predict.distfreereg(dfr_func, newdata = 1:3) : Vector supplied as 'newdata' converted into single row of newdata matrix... > > > > # Orderings > > dfr_func_asis <- update(dfr_func, ordering = "asis", verbose = TRUE) Using supplied inverse square root of the covariance matrix... Using supplied parameter estimates... Calculating fitted values... Calculating Jacobian... Using supplied inverse square root of the covariance matrix... Calculating mu... Leaving observation order as is... Calculating transformation anchors... Calculating r_tilde... Calculating residuals... All covariate observations are unique; no grouping done... Calculating empirical partial sum process... Calculating observed statistic(s)... Running Monte Carlo simulation... ...1000 of 10000 ...2000 of 10000 ...3000 of 10000 ...4000 of 10000 ...5000 of 10000 ...6000 of 10000 ...7000 of 10000 ...8000 of 10000 ...9000 of 10000 ...10000 of 10000 > dfr_func_optimal <- update(dfr_func, ordering = "optimal", verbose = TRUE) Using supplied inverse square root of the covariance matrix... Using supplied parameter estimates... Calculating fitted values... Calculating Jacobian... Using supplied inverse square root of the covariance matrix... Calculating mu... Ordering observations using optimal transport... - Creating distance matrix... - Solving linear sum assignment problem using the Hungarian method... Calculating transformation anchors... Calculating r_tilde... Calculating residuals... All covariate observations are unique; no grouping done... Calculating empirical partial sum process... Calculating observed statistic(s)... Running Monte Carlo simulation... ...1000 of 10000 ...2000 of 10000 ...3000 of 10000 ...4000 of 10000 ...5000 of 10000 ...6000 of 10000 ...7000 of 10000 ...8000 of 10000 ...9000 of 10000 ...10000 of 10000 > dfr_func_natural <- update(dfr_func, ordering = "natural", verbose = TRUE) Using supplied inverse square root of the covariance matrix... Using supplied parameter estimates... Calculating fitted values... Calculating Jacobian... Using supplied inverse square root of the covariance matrix... Calculating mu... Ordering observations by natural order... Calculating transformation anchors... Calculating r_tilde... Calculating residuals... All covariate observations are unique; no grouping done... Calculating empirical partial sum process... Calculating observed statistic(s)... Running Monte Carlo simulation... ...1000 of 10000 ...2000 of 10000 ...3000 of 10000 ...4000 of 10000 ...5000 of 10000 ...6000 of 10000 ...7000 of 10000 ...8000 of 10000 ...9000 of 10000 ...10000 of 10000 > dfr_func_colname <- update(dfr_func, ordering = list("a"), verbose = TRUE) Using supplied inverse square root of the covariance matrix... Using supplied parameter estimates... Calculating fitted values... Calculating Jacobian... Using supplied inverse square root of the covariance matrix... Calculating mu... Ordering observations by specified columns... Calculating transformation anchors... Calculating r_tilde... Calculating residuals... All covariate observations are unique; no grouping done... Calculating empirical partial sum process... Calculating observed statistic(s)... Running Monte Carlo simulation... ...1000 of 10000 ...2000 of 10000 ...3000 of 10000 ...4000 of 10000 ...5000 of 10000 ...6000 of 10000 ...7000 of 10000 ...8000 of 10000 ...9000 of 10000 ...10000 of 10000 > dfr_func_res_order <- update(dfr_func, + override = list(res_order = dfr_func[["res_order"]], + r = dfr_func[["r"]]), + verbose = TRUE) Using supplied inverse square root of the covariance matrix... Using supplied parameter estimates... Calculating fitted values... Calculating Jacobian... Using supplied inverse square root of the covariance matrix... Calculating mu... Using supplied observation ordering... Using supplied transformation anchors... Calculating r_tilde... Calculating residuals... All covariate observations are unique; no grouping done... Calculating empirical partial sum process... Calculating observed statistic(s)... Running Monte Carlo simulation... ...1000 of 10000 ...2000 of 10000 ...3000 of 10000 ...4000 of 10000 ...5000 of 10000 ...6000 of 10000 ...7000 of 10000 ...8000 of 10000 ...9000 of 10000 ...10000 of 10000 > > > > > ### default > > set.seed(20250516) > dfr_default <- distfreereg(Y = Y, X = X, test_mean = NULL, + covariance = list(Sigma = Sig), + verbose = FALSE, J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")) > dfr_default Number of observations: 100 Length of EPSP: 100 Monte Carlo simulations: 10000 Observed statistics: Stat Value Pr(>Value) MCSE KS 6.440e-01 6.885e-01 4.631e-03 CvM 6.841e-02 7.406e-01 4.383e-03 KSmax 6.440e-01 3.628e-01 4.808e-03 KSmin 1.973e-01 8.753e-01 3.304e-03 --- `MCSE' is the Monte Carlo standard error of the estimated p-value. > > dfr_default_verbose <- distfreereg(Y = as.matrix(Y), X = X[,1], test_mean = NULL, + covariance = list(Sigma = Sig), + J = rep(1, n), + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")) Coercing Y to vector... Coercing X to matrix... Calculating the inverse square root of the covariance matrix... Calculating mu... Ordering observations by simplex method... Calculating transformation anchors... Calculating r_tilde... Calculating residuals... All covariate observations are unique; no grouping done... Calculating empirical partial sum process... Calculating observed statistic(s)... Running Monte Carlo simulation... ...1000 of 10000 ...2000 of 10000 ...3000 of 10000 ...4000 of 10000 ...5000 of 10000 ...6000 of 10000 ...7000 of 10000 ...8000 of 10000 ...9000 of 10000 ...10000 of 10000 > > test_dfr_functions(dfr_default, newdata = newdata_function) NULL NULL [1] 7.99 7.34 19.10 18.90 8.89 4.68 7.26 3.19 8.88 9.88 5.94 6.27 [13] 3.84 4.08 6.66 5.92 5.64 3.76 12.00 9.06 11.90 6.93 3.69 7.21 [25] 4.29 7.50 9.34 7.73 3.97 4.98 18.90 20.30 6.33 12.50 11.50 9.32 [37] 5.73 5.48 5.10 12.00 3.73 1.88 2.87 2.74 4.33 4.55 5.14 5.60 [49] 3.49 14.20 5.33 16.10 8.30 12.70 21.40 5.16 9.42 3.71 3.83 8.74 [61] 17.70 10.80 10.20 3.38 10.90 14.50 12.40 11.30 15.70 11.70 7.22 5.52 [73] 22.40 12.90 3.01 10.50 7.36 2.18 13.80 4.55 3.49 4.60 5.22 8.64 [85] 2.87 10.50 3.30 4.55 11.20 14.00 2.28 8.63 11.40 2.01 7.31 5.70 [97] 9.31 8.42 14.90 9.75 NULL NULL NULL > > stopifnot(all.equal(dfr_func, dfr_default)) > > > # Orderings > > dfr_default_asis <- update(dfr_default, ordering = "asis") > dfr_default_optimal <- update(dfr_default, ordering = "optimal") > dfr_default_natural <- update(dfr_default, ordering = "natural") > dfr_default_colname <- update(dfr_default, ordering = list("a")) > > > > > > ### Warnings > > > # Partial Outputs > > dfr_func_r_error <- distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), + control = list(orth_tol = 1e-100)) Calculating the inverse square root of the covariance matrix... Estimating parameters... Calculating fitted values... Calculating Jacobian... Using supplied inverse square root of the covariance matrix... Calculating mu... Warning message: Error encountered, partial results returned: Error in calc_mu(J = J_for_mu, solve_tol = solve_tol, orth_tol = orth_tol): crossprod(mu) is not equal to the identity matrix > names(dfr_func_r_error) [1] "call" "data" "test_mean" [4] "theta_hat" "covariance" "optimization_output" [7] "fitted_values" "J" "" > > > > > # fitted_values > > set.seed(20250603) > func_fv <- function(X, theta) theta[1]*X > Sig_fv <- runif(n, min = 1, max = 3) > theta_fv <- 2 > X_fv <- matrix(runif(n, min = 1, max = 5), nrow = n) > Y_fv <- theta_fv[1]*X_fv[,1] + rnorm(n, sd = sqrt(Sig_fv)) > dfr_fv <- distfreereg(Y = Y_fv, X = X_fv, test_mean = func_fv, + covariance = list(Sigma = Sig_fv), + theta_init = 1, B = 1e3) Calculating the inverse square root of the covariance matrix... Estimating parameters... Calculating fitted values... Calculating Jacobian... Using supplied inverse square root of the covariance matrix... Calculating mu... Ordering observations by simplex method... Calculating transformation anchors... Calculating r_tilde... Calculating residuals... All covariate observations are unique; no grouping done... Calculating empirical partial sum process... Calculating observed statistic(s)... Running Monte Carlo simulation... ...100 of 1000 ...200 of 1000 ...300 of 1000 ...400 of 1000 ...500 of 1000 ...600 of 1000 ...700 of 1000 ...800 of 1000 ...900 of 1000 ...1000 of 1000 Warning message: In distfreereg.function(Y = Y_fv, X = X_fv, test_mean = func_fv, : fitted_values being coerced to a vector... > > > > > > > ### Failures > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, group = FALSE, + covariance = list(Sigma = Sig), verbose = FALSE, + J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + ordering = "simplex", B = 1e3, override = NULL, "a"), + error = function(e) warning(e)) Warning message: In validate_extra_arg_list(extra_arg_list, "distfreereg.default()") : Unused unnamed arguments passed to distfreereg.default(): a > > tryCatch(update(dfr_default, extra = "a"), error = function(e) warning(e)) Warning message: In validate_extra_arg_list(extra_arg_list, "distfreereg.default()") : Unused arguments passed to distfreereg.default() with name(s) extra > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, group = FALSE, + covariance = list(Sigma = matrix(1:10, nrow = 5)), verbose = FALSE, + J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE)), + error = function(e) warning(e)) Warning message: In validate_sqmat(covariance_list[[x]], n, message = c("Error in validating ", : Error in validating covariance element Sigma (length>1): The dimensions of covariance_list[[x]] must be 100 by 100 > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, group = FALSE, + covariance = list(Sigma = 1:10), verbose = FALSE, + J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE)), + error = function(e) warning(e)) Warning message: In FUN(X[[i]], ...) : Invalid covariance vector length > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, group = FALSE, + covariance = list(Sigma = 1:10), verbose = FALSE, + J = dfr_func[["J"]], + fitted_values = NA_real_, + control = list(return_on_error = FALSE)), + error = function(e) warning(e)) Warning message: In validate_numeric(fitted_values, len = n, message = "Fitted values failed numeric validation: ") : Fitted values failed numeric validation: fitted_values cannot have NA values > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, group = FALSE, + covariance = list(Sigma = 1:10), verbose = FALSE, + J = dfr_func[["J"]], + fitted_values = numeric(), + control = list(return_on_error = FALSE)), + error = function(e) warning(e)) Warning message: In validate_numeric(fitted_values, len = n, message = "Fitted values failed numeric validation: ") : Fitted values failed numeric validation: fitted_values cannot be empty > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, group = FALSE, + covariance = list(Sigma = 1:10), verbose = FALSE, + J = dfr_func[["J"]], + fitted_values = c(1, NaN), + control = list(return_on_error = FALSE)), + error = function(e) warning(e)) Warning message: In validate_numeric(fitted_values, len = n, message = "Fitted values failed numeric validation: ") : Fitted values failed numeric validation: fitted_values cannot have NaN values > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, group = FALSE, + covariance = list(Sigma = 1:10), verbose = FALSE, + J = dfr_func[["J"]], + fitted_values = c(1, Inf), + control = list(return_on_error = FALSE)), + error = function(e) warning(e)) Warning message: In validate_numeric(fitted_values, len = n, message = "Fitted values failed numeric validation: ") : Fitted values failed numeric validation: fitted_values must be finite > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, group = FALSE, + covariance = list(Sigma = 1:10), verbose = FALSE, + J = dfr_func[["J"]], + fitted_values = c(1, 2), + control = list(return_on_error = FALSE)), + error = function(e) warning(e)) Warning message: In validate_numeric(fitted_values, len = n, message = "Fitted values failed numeric validation: ") : Fitted values failed numeric validation: fitted_values must have length 100, not 2 > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, group = FALSE, + covariance = list(Sigma = 1:10), verbose = FALSE, + J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE, + solve_tol = -1)), + error = function(e) warning(e)) Warning message: In FUN(X[[i]], ...) : Invalid tolerance specification: X[[i]] must be positive > > tryCatch(distfreereg(Y = Y, X = X, test_mean = function(a) a^2, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e)) Warning message: In validate_mean_function_arg_names(f = test_mean) : Invalid argument specification of test_mean > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + override = list(res_order = 1:4)), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_default(Y = Y, X = X, covariance = covariance, : override[['res_order']] must be an ordering > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + override = list(r = 1:5)), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_default(Y = Y, X = X, covariance = covariance, : nrow(as.matrix(override[['r']])) must be equal to length(Y) > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + override = list(J = 1:5)), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : nrow(as.matrix(override[['J']])) must be equal to length(Y) > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + override = list(J = 1:5, r = 1:7)), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : as.matrix(override[['J']]) and as.matrix(override[['r']]) must have the same dimensions > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + override = list(fitted_values = 1:5)), + error = function(e) warning(e)) Warning message: In validate_numeric(override[["fitted_values"]], len = n, message = "override[['fitted_values']] failed numeric validation: ") : override[['fitted_values']] failed numeric validation: override[["fitted_values"]] must have length 100, not 5 > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + override = list(J = c(1,2,NA))), + error = function(e) warning(e)) Warning message: In validate_numeric(override[["J"]], message = "override[['J']] failed numeric validation: ") : override[['J']] failed numeric validation: override[["J"]] cannot have NA values > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + override = list(J = 1:5)), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : nrow(as.matrix(override[['J']])) must be equal to length(Y) > > tryCatch(distfreereg:::distfreereg.function(Y = Y, X = X, test_mean = b ~ a, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e)) Warning message: In distfreereg:::distfreereg.function(Y = Y, X = X, test_mean = b ~ : is.function(test_mean) is not TRUE > > tryCatch(distfreereg(Y = Y, X = X, test_mean = function(x) x, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e)) Warning message: In validate_mean_function_arg_names(f = test_mean) : Invalid argument specification of test_mean > > tryCatch(distfreereg(Y = Y, test_mean = function(x) x, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e)) Warning message: In validate_mean_function_arg_names(f = test_mean) : Invalid argument specification of test_mean > > tryCatch(distfreereg(Y = Y, X = X, test_mean = function(theta) theta, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : 'x' or 'X' must be an argument of test_mean when X is not NULL > > tryCatch(distfreereg(Y = Y, X = X[1:5,], test_mean = function(theta) theta, + covariance = list(Sigma = Sig), + theta_init = 1, verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : The number of rows in X must be the length of Y: nrow(X) is 5, but length(Y) is 100 > > tryCatch(distfreereg(Y = Y, X = NULL, test_mean = function(theta) theta, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : theta_init must have length 1 when X is NULL > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE, + optimization_args = 4), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : control[['optimization_args']] must be a list > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE, + optimization_fun = "hello"), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : control[['optimization_fun']] must be a function > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + ordering = c(1,2)), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : ordering method specification must have length one, or be a list of column specifications > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, + covariance = list(Sigma = Sig), + verbose = FALSE, J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + override = list(dfr = "a")), + error = function(e) warning(e)) Warning message: In validate_named_list(override, valid_names = c("res_order", "r", : override has the following bad names: dfr > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, + covariance = list(Sigma = Sig), + verbose = FALSE, J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + override = list(res_order = 1:4)), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_default(Y = Y, X = X, covariance = covariance, : override[['res_order']] must be an ordering > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, + covariance = list(Sigma = Sig), + verbose = FALSE, J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + override = list(r = 1:5)), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_default(Y = Y, X = X, covariance = covariance, : nrow(as.matrix(override[['r']])) must be equal to length(Y) > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, + covariance = list(Sigma = Sig), + verbose = FALSE, J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + override = list(J = 1:5)), + error = function(e) warning(e)) Warning message: In validate_named_list(override, valid_names = c("res_order", "r", : override has the following bad names: J > > tryCatch(distfreereg(Y = Y, X = X[1:5,], test_mean = NULL, + covariance = list(Sigma = Sig), + verbose = FALSE, J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_default(Y = Y, X = X, covariance = covariance, : The number of rows in X must be the length of Y: nrow(X) is 5, but length(Y) is 100 > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, + covariance = list(Sigma = Sig), + verbose = FALSE, J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin"), + ordering = c(1,4)), + error = function(e) warning(e)) Warning message: In validate_args_distfreereg_default(Y = Y, X = X, covariance = covariance, : ordering method specification must have length one, or be a list of column specifications > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, + covariance = list(Sigma = Sig), + verbose = FALSE, J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE), + stat = c("K")), + error = function(e) warning(e)) Warning message: In value[[3L]](cond) : Unable to evaluate stat[i](rnorm(100)): Error in get(stat[i]): object 'K' not found > > tryCatch(plot(dfr_func, confband_args = ""), error = function(e) warning(e)) Warning message: In validate_args_plot.distfreereg(object = x, stat = stat, density_args = density_args, : confband_args must be NULL, FALSE, or a list > tryCatch(plot(dfr_func, density_args = ""), error = function(e) warning(e)) Warning message: In validate_args_plot.distfreereg(object = x, stat = stat, density_args = density_args, : density_args must be a list > tryCatch(plot(dfr_func, polygon_args = ""), error = function(e) warning(e)) Warning message: In validate_args_plot.distfreereg(object = x, stat = stat, density_args = density_args, : polygon_args must be NULL, FALSE, or a list > tryCatch(plot(dfr_func, abline_args = ""), error = function(e) warning(e)) Warning message: In validate_args_plot.distfreereg(object = x, stat = stat, density_args = density_args, : abline_args must be NULL, FALSE, or a list > tryCatch(plot(dfr_func, text_args = ""), error = function(e) warning(e)) Warning message: In validate_args_plot.distfreereg(object = x, stat = stat, density_args = density_args, : text_args must be NULL, FALSE, or a list > > tryCatch(asymptotics("dfr_default", reps = 5), error = function(e) warning(e)) Warning message: In asymptotics("dfr_default", reps = 5) : 'object' must be an object of class 'distfreereg' > tryCatch(asymptotics(dfr_default, reps = 5), error = function(e) warning(e)) Warning message: In asymptotics(dfr_default, reps = 5) : 'object' must have a non-NULL 'test_mean' value > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, + covariance = list(Sigma = matrix(rnorm(n^2), nrow = n)), + verbose = FALSE, J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE)), + error = function(e) warning(e)) Warning message: In validate_symmetric(covariance_list[["Sigma"]], name = "Sigma", : Sigma not symmetric > > # P_complex_eigen <- kronecker(diag(n/2), matrix(c(cos(0.5), -sin(0.5), sin(0.5), cos(0.5)), nrow = 2)) > # tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, > # covariance = list(P = P_complex_eigen), > # verbose = FALSE, J = dfr_func[["J"]], > # fitted_values = dfr_func[["fitted_values"]], > # control = list(return_on_error = FALSE)), > # error = function(e) warning(e)) > > tryCatch(dfr_func <- distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE)), + error = function(e) warning(e) + ) Warning message: In validate_covariance_list(covariance, n = n, sym_tol = control[["sym_tol"]], : covariance must have at least one element > > tryCatch(dfr_func <- distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = "hello"), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE)), + error = function(e) warning(e) + ) Warning message: In FUN(X[[i]], ...) : All specified elements of covariance element Sigma must be numeric or a list of matrices > > tryCatch(dfr_func <- distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = list("hello")), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE)), + error = function(e) warning(e) + ) Warning message: In FUN(X[[i]], ...) : All elements of list specification must be matrices > > tryCatch(dfr_func <- distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = rep(-1, n)), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE)), + error = function(e) warning(e) + ) Warning message: In FUN(X[[i]], ...) : Elements of a vector specification for covariance must be positive > > tryCatch(plot(dfr_func, confband_args = list(curve_args = 7)), + error = function(e) warning(e)) Warning message: In validate_args_plot.distfreereg(object = x, stat = stat, density_args = density_args, : confband_args[['curve_args']] must be NULL or a list > > tryCatch(plot(dfr_func, confband_args = list(polygon_args = 7)), + error = function(e) warning(e)) Warning message: In validate_args_plot.distfreereg(object = x, stat = stat, density_args = density_args, : confband_args[['polygon_args']] must be NULL, FALSE, or a list > > tryCatch(plot(dfr_func, confband_args = list(w = "a")), + error = function(e) warning(e)) Warning message: In validate_numeric(x = confband_args[["w"]]) : confband_args[["w"]] must be numeric; supplied value has class 'character' > > tryCatch(confint(dfr_func, level = 1), error = function(e) warning(e)) Warning message: In validate_numeric(x = level, max_val_strict = 1, min_val_strict = 0) : level must have value(s) less than 1 > tryCatch(confint(dfr_func, level = 0), error = function(e) warning(e)) Warning message: In validate_numeric(x = level, max_val_strict = 1, min_val_strict = 0) : level must have value(s) greater than 0 > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + override = list(r = matrix(1:n)), + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e) + ) Warning message: In distfreereg.default(test_mean = NULL, Y = Y, X = X, covariance = covariance, : all(dim(mu) == dim(r)) is not TRUE > > tryCatch(predict(dfr_func, newdata = "hello"), error = function(e) warning(e)) Warning message: In predict.distfreereg(dfr_func, newdata = "hello") : 'newdata' must be numeric when object$test_mean does not have a formula method > > tryCatch(distfreereg(Y = Y[1], X = X[1,], test_mean = func, + covariance = list(Sigma = Sig[1,1]), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e) + ) Warning message: In validate_numeric(x = Y, min_len = 2, message = "Y failed numeric validation: ") : Y failed numeric validation: Y must have length at least 2 > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + group = TRUE, + control = list(return_on_error = "hello"), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_default(Y = Y, X = X, covariance = covariance, : control[['return_on_error']] must be TRUE or FALSE > > tryCatch(distfreereg(Y = Y, test_mean = function(X, theta) X * theta, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : X must be supplied if 'x' or 'X' is an argument of test_mean > > tryCatch(distfreereg(Y = Y[1:5], X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : The number of rows in X must be the length of Y: nrow(X) is 100, but length(Y) is 5 > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE, + optimization_fun = optim, + theta_init_arg = 1)), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : control[['theta_init_arg']] must be a character string > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE, + optimization_fun = optim, + theta_init_arg = c("hello", "goodbye"))), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : control[['theta_init_arg']] must have length 1 > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE, + optimization_fun = optim, + theta_init_arg = "hello")), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : control[['theta_init_arg']] must be the name of an argument of optimization_fun > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE, + optimization_fun = optim, + theta_init_arg = "par", + fun_to_optimize_arg = 1)), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : control[['fun_to_optimize_arg']] must be a character string > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE, + optimization_fun = optim, + theta_init_arg = "par", + fun_to_optimize_arg = c("hello", "goodbye"))), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : control[['fun_to_optimize_arg']] must have length 1 > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE, + optimization_fun = optim, + theta_init_arg = "par", + fun_to_optimize_arg = "hello")), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : control[['fun_to_optimize_arg']] must be the name of an argument of optimization_fun > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE, + optimization_fun = optim, + theta_init_arg = "par", + theta_hat_name = 1, + fun_to_optimize_arg = "fn")), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : control[['theta_hat_name']] must be a character vector of length 1 > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE, + optimization_fun = optim, + theta_init_arg = "par", + theta_hat_name = c("hello", "goodbye"), + fun_to_optimize_arg = "fn")), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : control[['theta_hat_name']] must have length 1 > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE, + optimization_fun = optim, + theta_init_arg = "par", + theta_hat_name = "hello", + fun_to_optimize_arg = "fn")), + error = function(e) warning(e) + ) Warning message: In distfreereg.function(Y = Y, X = X, test_mean = func, covariance = list(Sigma = Sig), : No element with name 'hello' found in optimization output > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE, + jacobian_args = "hello")), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_function(Y = Y, X = X, test_mean = test_mean, : jacobian_args must be a list > > tryCatch(update(dfr_func, Y = 1:5, X = matrix(rnorm(10*3), nrow = 10)), + error = function(e) warning(e) + ) Warning message: In update.distfreereg(dfr_func, Y = 1:5, X = matrix(rnorm(10 * 3), : Sample size mismatch in arguments to update() > > tryCatch(update(dfr_func, override = list(J = dfr_func[["J"]]), + theta_init = c(1,1)), + error = function(e) warning(e) + ) Warning message: In update.distfreereg(dfr_func, override = list(J = dfr_func[["J"]]), : Parameter space dimension mismatch in arguments to update() > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1), verbose = FALSE, + control = "hello"), + error = function(e) warning(e) + ) Warning message: In validate_named_list(control, valid_names = c("matsqrt_tol", "solve_tol", : control must be a named list > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, + covariance = list(Sigma = Sig), + verbose = FALSE, J = dfr_func[["J"]][1:5,], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE), + stat = c("KS", "CvM", "KSmax", "KSmin")), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_default(Y = Y, X = X, covariance = covariance, : nrow(as.matrix(J)) must be equal to length(Y) > > bad_stat <- function(x) x > > tryCatch(distfreereg(Y = Y, X = X, test_mean = NULL, + covariance = list(Sigma = Sig), + verbose = FALSE, J = dfr_func[["J"]], + fitted_values = dfr_func[["fitted_values"]], + control = list(return_on_error = FALSE), + stat = c("bad_stat")), + error = function(e) warning(e) + ) Warning message: In validate_args_distfreereg_default(Y = Y, X = X, covariance = covariance, : The following stat functions are invalid: bad_stat. Each failed either because it did not return a (non-NA) numeric value or because its output is not a single number. > > tryCatch(distfreereg(Y = Y, X = X, test_mean = func, + covariance = list(Sigma = Sig), + theta_init = c(1,1,1,1), verbose = FALSE, + control = list(return_on_error = FALSE)), + error = function(e) warning(e)) Warning message: In validate_function_behavior(f = test_mean, X = X, n = n, theta = theta_init) : Element 4 of theta_init unnecessary for function evaluation. Recode test_mean, or shorten theta_init, and retry. > > tryCatch(distfreereg(Y = matrix(Y), X = rep(2, n), + test_mean = function(X, theta) theta*X[,1], + covariance = list(Sigma = Sig), + theta_init = 1, + control = list(return_on_error = FALSE)), + error = function(e) warning(e)) Coercing Y to vector... Coercing X to matrix... Calculating the inverse square root of the covariance matrix... Estimating parameters... Calculating fitted values... Calculating Jacobian... Using supplied inverse square root of the covariance matrix... Calculating mu... Ordering observations by simplex method... Calculating transformation anchors... Calculating r_tilde... Calculating residuals... Determining grouping... Warning messages: 1: In validate_X(X = X, verbose = verbose) : At least one column of X contains only one value. Verify that the model is identifiable. 2: In validate_X(X = X, verbose = verbose) : At least one column of X contains only one value. Verify that the model is identifiable. 3: In define_grouping_matrix(X = X_for_gm, res_order = res_order) : Grouping is unavailable when only one unique combination of covariate values is supplied. > > proc.time() user system elapsed 22.7 1.2 23.9