forked from AnthonyChristidis/SplitReg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
55 lines (41 loc) · 1.62 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
output: github_document
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
[![Build Status](https://travis-ci.com/AnthonyChristidis/SplitReg.svg?branch=master)](https://travis-ci.com/AnthonyChristidis/SplitReg) [![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/SplitReg)](https://cran.r-project.org/package=SplitReg) [![Downloads](http://cranlogs.r-pkg.org/badges/SplitReg)](https://cran.r-project.org/package=SplitReg)
SplitReg
==========
This package provides functions for computing the split regularized regression estimators defined in [Christidis, Lakshmanan, Smucler and Zamar (2019)](https://arxiv.org/abs/1712.03561).
------------------------------------------------------------------------
### Installation
You can install the **stable** version on [R CRAN](https://cran.r-project.org/package=SplitReg).
```{r installation, eval = FALSE}
install.packages("SplitReg", dependencies = TRUE)
```
You can install the **development** version from [GitHub](https://github.com/AnthonyChristidis/SplitReg)
``` r
library(devtools)
devtools::install_github("AnthonyChristidis/SplitReg")
```
### Usage
``` r
# A small example
library(MASS)
library(SplitReg)
set.seed(1)
beta <- c(rep(5, 5), rep(0, 45))
Sigma <- matrix(0.5, 50, 50)
diag(Sigma) <- 1
x <- mvrnorm(50, mu = rep(0, 50), Sigma = Sigma)
y <- x %*% beta + rnorm(50)
fit <- cv.SplitReg(x, y, num_models=10) # Use 10 models
coefs <- predict(fit, type="coefficients")
```
### License
This package is free and open source software, licensed under GPL (>= 2).