Skip to content
/ SPAR Public
forked from RomanParzer/SPAR

Sparse Projected Averaged Regression for High-dimensional Data

License

Notifications You must be signed in to change notification settings

lauravana/SPAR

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPAR

Licence

This R package enables you to apply Data-Driven Random Projection and Screening for High-Dimensional Generalized Linear Models (see Parzer, Filzmoser and Vana-Guer 2024a for Linear Regression and Parzer, Filzmoser and Vana-Guer 2024b for the extension to GLMs). Exported functions are

  • spar: performs the procedure for given thresholds lambda and numbers of marginal models, and acts as a help-function for the full cross-validated procedure spar.cv.
  • spar.cv: performs the full procedure as described in the corresponding paper will cross-validation of the optimal threshold and number of models.

Installation

# install.packages("remotes")
remotes::install_github("RomanParzer/SPAR") # for current main branch
# remotes::install_github("RomanParzer/SPAR@*release") # for latest release

Usage

The method is designed for linear regression using a high-dimensional data set with more variables than observations. The two main functions return objects, for which coef, predict and plot functions are available.

data("example_data")
spar_res <- spar.cv(example_data$x,example_data$y,nummods=c(5,10,15,20,25,30))
spar_res
coefs <- coef(spar_res)
pred <- predict(spar_res,example_data$x)
plot(spar_res)
plot(spar_res,"MSE","nummod")
plot(spar_res,"numAct","lambda")

License

This package is free and open source software, licensed under GPL-3.

About

Sparse Projected Averaged Regression for High-dimensional Data

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TeX 57.3%
  • HTML 20.8%
  • R 15.0%
  • JavaScript 6.0%
  • Lua 0.9%