|
| 1 | + |
| 2 | +<!-- README.md is generated from README.Rmd. Please edit that file --> |
| 3 | + |
1 | 4 | # grasps <img src="man/figures/logo.png" align="right" alt="" width="150"> |
2 | 5 |
|
| 6 | +## Groupwise Regularized Adaptive Sparse Precision Solution |
| 7 | + |
| 8 | +<!-- badges: start --> |
3 | 9 |
|
4 | 10 | [](https://github.com/Carol-seven/grasps/blob/main/DESCRIPTION) |
5 | 11 | [](https://github.com/Carol-seven/grasps/commits/main) |
6 | 12 | [](https://github.com/Carol-seven/grasps/actions/workflows/R-CMD-check.yaml) |
7 | 13 | [](https://github.com/Carol-seven/grasps/blob/main/LICENSE.md) |
8 | | - |
| 14 | +<!-- badges: end --> |
9 | 15 |
|
10 | 16 | The goal of **grasps** is to provide a collection of statistical methods that |
11 | 17 | incorporate both element-wise and group-wise penalties to estimate a precision |
12 | 18 | matrix, making them user-friendly and useful for researchers and practitioners. |
13 | 19 |
|
| 20 | +## Penalties |
14 | 21 |
|
15 | | -## Installation |
| 22 | +The package **grasps** provides functions to estimate precision matrices using |
| 23 | +the following penalties: |
| 24 | + |
| 25 | +1. Adaptive lasso (Zou 2006; Fan et al. 2009) |
| 26 | + |
| 27 | +2. Lasso (Tibshirani 1996; Friedman et al. 2008) |
| 28 | + |
| 29 | +3. Minimax concave penalty (MCP) (Zhang 2010) |
16 | 30 |
|
| 31 | +4. Smoothly clipped absolute deviation (SCAD) (Fan and Li 2001; Fan et al. 2009) |
| 32 | + |
| 33 | +## Installation |
17 | 34 |
|
18 | 35 | You can install the development version of **grasps** from |
19 | 36 | [GitHub](https://github.com/) with: |
20 | 37 |
|
21 | | -``` r |
22 | | -# install.packages("devtools") |
23 | | -devtools::install_github("Carol-seven/grasps") |
24 | | -``` |
25 | | - |
| 38 | + # install.packages("devtools") |
| 39 | + devtools::install_github("Carol-seven/grasps") |
26 | 40 |
|
27 | 41 | ## Example |
28 | 42 |
|
| 43 | + library(grasps) |
| 44 | + |
| 45 | + X <- matrix(rnorm(200), 10, 20) |
| 46 | + membership <- c(rep(1,5), rep(2,5), rep(3,4), rep(4,6)) |
| 47 | + |
| 48 | + grasps(X, membership = membership, penalty = "lasso", crit = "BIC") |
| 49 | + |
| 50 | +## Reference |
| 51 | + |
| 52 | +<div id="refs" class="references csl-bib-body hanging-indent"> |
| 53 | + |
| 54 | +<div id="ref-fan2009network" class="csl-entry"> |
| 55 | + |
| 56 | +Fan, Jianqing, Yang Feng, and Yichao Wu. 2009. “Network Exploration via the Adaptive LASSO and SCAD Penalties.” *The Annals of Applied Statistics* 3 (2): 521–41. <https://doi.org/10.1214/08-aoas215>. |
| 57 | + |
| 58 | +</div> |
| 59 | + |
| 60 | +<div id="ref-fan2001variable" class="csl-entry"> |
| 61 | + |
| 62 | +Fan, Jianqing, and Runze Li. 2001. “Variable Selection via Nonconcave Penalized Likelihood and Its Oracle Properties.” *Journal of the American Statistical Association* 96 (456): 1348–60. <https://doi.org/10.1198/016214501753382273>. |
| 63 | + |
| 64 | +</div> |
| 65 | + |
| 66 | +<div id="ref-friedman2008sparse" class="csl-entry"> |
| 67 | + |
| 68 | +Friedman, Jerome, Trevor Hastie, and Robert Tibshirani. 2008. “Sparse Inverse Covariance Estimation with the Graphical Lasso.” *Biostatistics* 9 (3): 432–41. <https://doi.org/10.1093/biostatistics/kxm045>. |
| 69 | + |
| 70 | +</div> |
| 71 | + |
| 72 | +<div id="ref-tibshirani1996regression" class="csl-entry"> |
| 73 | + |
| 74 | +Tibshirani, Robert. 1996. “Regression Shrinkage and Selection via the Lasso.” *Journal of the Royal Statistical Society: Series B (Methodological)* 58 (1): 267–88. <https://doi.org/10.1111/j.2517-6161.1996.tb02080.x>. |
| 75 | + |
| 76 | +</div> |
| 77 | + |
| 78 | +<div id="ref-zhang2010nearly" class="csl-entry"> |
| 79 | + |
| 80 | +Zhang, Cun-Hui. 2010. “Nearly Unbiased Variable Selection Under Minimax Concave Penalty.” *The Annals of Statistics* 38 (2): 894–942. <https://doi.org/10.1214/09-AOS729>. |
| 81 | + |
| 82 | +</div> |
29 | 83 |
|
30 | | -``` r |
31 | | -library(grasps) |
| 84 | +<div id="ref-zou2006adaptive" class="csl-entry"> |
32 | 85 |
|
33 | | -X <- matrix(rnorm(200), 10, 20) |
34 | | -groups <- c(rep(1,5), rep(2,5), rep(3,4), rep(4,6)) |
| 86 | +Zou, Hui. 2006. “The Adaptive Lasso and Its Oracle Properties.” *Journal of the American Statistical Association* 101 (476): 1418–29. <https://doi.org/10.1198/016214506000000735>. |
35 | 87 |
|
36 | | -sggm(X, groups = groups, penalty = "lasso", crit = "BIC") |
37 | | -``` |
| 88 | +</div> |
38 | 89 |
|
| 90 | +</div> |
0 commit comments