R Under development (unstable) (2025-12-02 r89085 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(pyinit) > X <- cbind(1, mtcars$wt, mtcars$gear) > y <- as.vector(mtcars$mpg) > n <- nrow(X) > p <- ncol(X) > delta <- 0.5 * (1 - p/n) > > pyinit_expr <- quote(pyinit(x = X, y = y, intercept = FALSE, delta = delta, cc = 1.54764, + psc_keep = 0.5 * (1 - p/n), resid_keep_method = 'threshold', + resid_keep_thresh = 2, resid_keep_prop = 0.2, maxit = 20L, eps = 1e-5, + mscale_maxit = 50, mscale_tol = 1e-6, mscale_rho_fun = 'bisquare')) > > expected_obj <- c(3.16984, 3.16984, 3.22770, 3.24876, 3.40174, 3.43364, 3.47512, 3.66026, 5.07470, 5.07470) > > res1 <- eval(pyinit_expr) > res1$objective[[6]] [1] 3.475116 > res2 <- eval(pyinit_expr) > res2$objective[[6]] [1] 3.475116 > > pyinit(x = X, y = y, intercept = FALSE, delta = delta, cc = 1.54764, + psc_keep = 0.5 * (1 - p/n), resid_keep_method = 'threshold', + resid_keep_thresh = 2, resid_keep_prop = 0.2, maxit = 1L, eps = 1e-5, + mscale_maxit = 50, mscale_tol = 1e-6, mscale_rho_fun = 'bisquare') $coefficients [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 37.425903 37.425903 53.543644 53.056121 53.543644 37.470428 45.7619073 [2,] -5.194875 -5.194875 -7.131493 -7.029111 -7.131493 -4.308767 -7.7980279 [3,] -0.230780 -0.230780 -2.677855 -2.644711 -2.677855 -1.099774 -0.6499188 [,8] [1,] 13.969217 [2,] -2.165868 [3,] 3.578238 $objective [1] 3.196457 3.196457 3.932425 3.876725 3.932425 3.368747 3.314068 3.646688 > > proc.time() user system elapsed 0.23 0.14 0.31