The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

varGuid: variance-guided regression for heteroscedastic linear models

Authors

Sibei Liu (sxl4188@miami.edu) and Min Lu (luminwin@gmail.com)

Reference

Liu, S. and Lu, M. (2026). Variance-Guided Regression for Heteroscedastic Data. TechRxiv. DOI: 10.36227/techrxiv.177004877.75352102/v1

Description

The CRAN release of varGuid implements the global linear mean-variance model from Section 2 of the paper via iteratively reweighted least squares (IRLS) and iteratively reweighted lasso estimation. For the grouping-based nonlinear prediction extension from Section 3 of the paper, please use the development version available at:

devtools::install_github("luminwin/varGuid")

Installation

install.packages("varGuid")
library(varGuid)

Examples

data(cobra2d, package = "varGuid")
dat <- cobra2d
set.seed(1)
tid <- sample(seq_len(nrow(dat)), 200)
train <- dat[-tid, ]
test <- dat[tid, ]
yid <- which(colnames(dat) == "y")

IRLS / weighted least squares fit

o <- lmv(X = train[, -yid], Y = train[, yid], lasso = FALSE)
summary(o$obj.varGuid)  # varGuid weighted fit
summary(o$obj.OLS)      # baseline OLS fit

head(prd(o, train[, -yid], model = "baseline"))
head(prd(o, train[, -yid], model = "varGuid"))

# The corresponding base R calls are:
head(stats::predict(o$obj.OLS, newdata = as.data.frame(train[, -yid])))
head(stats::predict(o$obj.varGuid, newdata = as.data.frame(train[, -yid])))

Iteratively reweighted lasso fit

o2 <- lmv(X = train[, -yid], Y = train[, yid], lasso = TRUE)
o2$beta            # varGuid-lasso coefficients
o2$obj.lasso$beta  # baseline lasso coefficients

head(prd(o2, train[, -yid], model = "baseline"))
head(prd(o2, train[, -yid], model = "varGuid"))

# The corresponding glmnet calls are:
head(drop(glmnet::predict.glmnet(o2$obj.lasso,
                                 newx = as.matrix(train[, -yid]))))
head(drop(glmnet::predict.glmnet(o2$obj.varGuid,
                                 newx = as.matrix(train[, -yid]))))

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.