-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathREADME.Rmd
161 lines (124 loc) · 3.82 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::knit_hooks$set(pngquant = knitr::hook_pngquant)
knitr::opts_chunk$set(
echo = FALSE,
message = FALSE,
warning = FALSE,
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
dev = "ragg_png",
dpi = 150,
fig.retina = 2,
fig.width = 10,
fig.height = 5,
out.width = "100%",
pngquant = "--speed=1 --quality=80"
)
```
# msaenet <img src="man/figures/logo.png" align="right" width="120" />
<!-- badges: start -->
[![R-CMD-check](https://github.com/nanxstats/msaenet/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/nanxstats/msaenet/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/msaenet)](https://cran.r-project.org/package=msaenet)
[![CRAN downloads](https://cranlogs.r-pkg.org/badges/msaenet)](https://cran.r-project.org/package=msaenet)
<!-- badges: end -->
msaenet implements the multi-step adaptive elastic-net (MSAENet) algorithm for feature selection in high-dimensional regressions proposed in Xiao and Xu (2015) [[PDF](https://nanx.me/papers/msaenet.pdf)].
Nonconvex multi-step adaptive estimations based on MCP-net or SCAD-net are also supported.
Check `vignette("msaenet")` to get started.
## Installation
You can install msaenet from CRAN:
```r
install.packages("msaenet")
```
Or try the development version on GitHub:
```r
remotes::install_github("nanxstats/msaenet")
```
## Citation
To cite the msaenet package in publications, please use
> Nan Xiao and Qing-Song Xu. (2015). Multi-step adaptive elastic-net: reducing false positives in high-dimensional variable selection. _Journal of Statistical Computation and Simulation_ 85(18), 3755--3765.
A BibTeX entry for LaTeX users is
```bibtex
@article{xiao2015multi,
title = {Multi-step adaptive elastic-net: reducing false positives in high-dimensional variable selection},
author = {Nan Xiao and Qing-Song Xu},
journal = {Journal of Statistical Computation and Simulation},
volume = {85},
number = {18},
pages = {3755--3765},
year = {2015},
doi = {10.1080/00949655.2015.1016944}
}
```
## Gallery
### Adaptive Elastic-Net / Multi-Step Adaptive Elastic-Net
```{r}
library("msaenet")
dat <- msaenet.sim.gaussian(
n = 500, p = 500, rho = 0.8,
coef = c(rep(-1, 2), rep(1, 3)), snr = 1.5, p.train = 0.5,
seed = 1001
)
```
```{r}
#| msaenet
aenet.fit <- aenet(
dat$x.tr, dat$y.tr,
alphas = seq(0.1, 0.9, 0.1), seed = 1003
)
msaenet.fit <- msaenet(
dat$x.tr, dat$y.tr,
alphas = seq(0.1, 0.9, 0.1),
nsteps = 5L, tune.nsteps = "ebic",
seed = 1003
)
par(mfrow = c(1, 2))
plot(aenet.fit)
plot(msaenet.fit)
```
### Adaptive MCP-Net / Multi-Step Adaptive MCP-Net
```{r}
#| msamnet
amnet.fit <- amnet(
dat$x.tr, dat$y.tr,
alphas = seq(0.1, 0.9, 0.1), seed = 1003
)
msamnet.fit <- msamnet(
dat$x.tr, dat$y.tr,
gammas = 3, alphas = seq(0.1, 0.9, 0.1),
nsteps = 4L, tune.nsteps = "ebic",
seed = 1003
)
par(mfrow = c(1, 2))
plot(amnet.fit)
plot(msamnet.fit)
```
### Adaptive SCAD-Net / Multi-Step Adaptive SCAD-Net
```{r}
#| msasnet
asnet.fit <- asnet(
dat$x.tr, dat$y.tr,
alphas = seq(0.1, 0.9, 0.1), seed = 1003
)
msasnet.fit <- msasnet(
dat$x.tr, dat$y.tr,
gammas = 3.7, alphas = seq(0.1, 0.9, 0.1),
nsteps = 4L, tune.nsteps = "ebic",
seed = 1003
)
par(mfrow = c(1, 2))
plot(asnet.fit)
plot(msasnet.fit)
```
## Contribute
To contribute to this project, please take a look at the
[Contributing Guidelines](https://nanx.me/msaenet/CONTRIBUTING.html) first.
Please note that the msaenet project is released with a
[Contributor Code of Conduct](https://nanx.me/msaenet/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.
## License
msaenet is free and open source software, licensed under GPL-3.