-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
83 lines (60 loc) · 2.38 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
---
output: github_document
editor_options:
chunk_output_type: console
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
message = FALSE,
warning = FALSE
)
```
# RRRR
<!-- badges: start -->
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/RRRR)](https://cran.r-project.org/package=RRRR)
[![Monthly\_Downloads](http://cranlogs.r-pkg.org/badges/RRRR)](https://cran.r-project.org/package=RRRR)
[![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![R-CMD-check](https://github.com/FinYang/RRRR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/FinYang/RRRR/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
The R package *RRRR* provides methods for estimating online Robust Reduced-Rank Regression.
To cite package ‘RRRR’ in publications use:
> Yangzhuoran Fin Yang and Ziping Zhao (2023). RRRR: Online Robust Reduced-Rank Regression Estimation. R package version 1.1.1. https://pkg.yangzhuoranyang.com/RRRR/.
## Installation
You can install the **stable** version on [R CRAN](https://CRAN.R-project.org/package=RRRR).
```{r cran-installation, eval = FALSE}
install.packages("RRRR")
```
You can install the **development** version from [Github](https://github.com/FinYang/RRRR) with:
```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("FinYang/RRRR")
```
## Usage
The R package *RRRR* provides the following estimation methods.
1. Reduced-Rank Regression using Gaussian MLE: `RRR`
2. Robust Reduced-Rank Regression using Cauchy distribution and Majorisation-Minimisation: `RRRR`
3. Online Robust Reduced-Rank Regression: `ORRRR`
- SMM: Stochastic Majorisation-Minimisation
- SAA: Sample Average Approximation
4. Online update of the above model (except `RRR`): `update.RRRR`
See the vignette for a more detailed illustration.
```{r}
library(RRRR)
set.seed(2222)
data <- RRR_sim()
res <- ORRRR(y=data$y, x=data$x, z=data$z)
res
plot(res)
newdata <- RRR_sim(A = data$spec$A,
B = data$spec$B,
D = data$spec$D)
res2 <- update(res, newy=newdata$y, newx=newdata$x, newz=newdata$z)
res2
plot(res2)
```
## License
This package is free and open source software, licensed under GPL-3.