Title: | Online Robust Reduced-Rank Regression Estimation |
---|---|
Description: | Methods for estimating online robust reduced-rank regression. The Gaussian maximum likelihood estimation method is described in Johansen, S. (1991) <doi:10.2307/2938278>. The majorisation-minimisation estimation method is partly described in Zhao, Z., & Palomar, D. P. (2017) <doi:10.1109/GlobalSIP.2017.8309093>. The description of the generic stochastic successive upper-bound minimisation method and the sample average approximation can be found in Razaviyayn, M., Sanjabi, M., & Luo, Z. Q. (2016) <doi:10.1007/s10107-016-1021-7>. |
Authors: | Yangzhuoran Fin Yang [aut, cre] , Ziping Zhao [aut] |
Maintainer: | Yangzhuoran Fin Yang <[email protected]> |
License: | GPL-3 |
Version: | 1.1.1 |
Built: | 2024-11-16 04:34:56 UTC |
Source: | https://github.com/finyang/rrrr |
Methods for estimating online Robust Reduced-Rank Regression.
Yangzhuoran Yang. [email protected]
Ziping Zhao. [email protected]
Online robust reduced-rank regression with two major estimation methods:
Stochastic Majorisation-Minimisation
Sample Average Approximation
ORRRR( y, x, z = NULL, mu = TRUE, r = 1, initial_size = 100, addon = 10, method = c("SMM", "SAA"), SAAmethod = c("optim", "MM"), ..., initial_A = matrix(rnorm(P * r), ncol = r), initial_B = matrix(rnorm(Q * r), ncol = r), initial_D = matrix(rnorm(P * R), ncol = R), initial_mu = matrix(rnorm(P)), initial_Sigma = diag(P), ProgressBar = requireNamespace("lazybar"), return_data = TRUE )
ORRRR( y, x, z = NULL, mu = TRUE, r = 1, initial_size = 100, addon = 10, method = c("SMM", "SAA"), SAAmethod = c("optim", "MM"), ..., initial_A = matrix(rnorm(P * r), ncol = r), initial_B = matrix(rnorm(Q * r), ncol = r), initial_D = matrix(rnorm(P * R), ncol = R), initial_mu = matrix(rnorm(P)), initial_Sigma = diag(P), ProgressBar = requireNamespace("lazybar"), return_data = TRUE )
y |
Matrix of dimension N*P. The matrix for the response variables. See |
x |
Matrix of dimension N*Q. The matrix for the explanatory variables to be projected. See |
z |
Matrix of dimension N*R. The matrix for the explanatory variables not to be projected. See |
mu |
Logical. Indicating if a constant term is included. |
r |
Integer. The rank for the reduced-rank matrix |
initial_size |
Integer. The number of data points to be used in the first iteration. |
addon |
Integer. The number of data points to be added in the algorithm in each iteration after the first. |
method |
Character. The estimation method. Either "SMM" or "SAA". See |
SAAmethod |
Character. The sub solver used in each iteration when the |
... |
Additional arguments to function
|
initial_A |
Matrix of dimension P*r. The initial value for matrix |
initial_B |
Matrix of dimension Q*r. The initial value for matrix |
initial_D |
Matrix of dimension P*R. The initial value for matrix |
initial_mu |
Matrix of dimension P*1. The initial value for the constant |
initial_Sigma |
Matrix of dimension P*P. The initial value for matrix Sigma. See |
ProgressBar |
Logical. Indicating if a progress bar is shown during the estimation process.
The progress bar requires package |
return_data |
Logical. Indicating if the data used is return in the output.
If set to |
The formulation of the reduced-rank regression is as follow:
where for each realization is a vector of dimension
for the
response variables,
is a vector of dimension
for the
explanatory variables that will be projected to
reduce the rank,
is a vector of dimension
for the
explanatory variables
that will not be projected,
is the constant vector of dimension
,
is the innovation vector of dimension
,
is a coefficient matrix for
with dimension
,
is the so called exposure matrix with dimension
, and
is the so called factor matrix with dimension
.
The matrix resulted from
will be a reduced rank coefficient matrix with rank of
.
The function estimates parameters
,
,
,
, and
, the covariance matrix of
the innovation's distribution.
The algorithm is online in the sense that the data is continuously incorporated
and the algorithm can update the parameters accordingly. See ?update.RRRR
for more details.
At each iteration of SAA, a new realisation of the parameters is achieved by solving the minimisation problem of the sample average of the desired objective function using the data currently incorporated. This can be computationally expensive when the objective function is highly nonconvex. The SMM method overcomes this difficulty by replacing the objective function by a well-chosen majorising surrogate function which can be much easier to optimise.
SMM method is robust in the sense that it assumes a heavy-tailed Cauchy distribution for the innovations.
A list of the estimated parameters of class ORRRR
.
The estimation method being used
If SAA is the major estimation method, what is the sub solver in each iteration.
The input specifications. is the sample size.
The path of all the parameters during optimization and the path of the objective value.
The estimated constant vector. Can be NULL
.
The estimated exposure matrix.
The estimated factor matrix.
The estimated coefficient matrix of z
.
The estimated covariance matrix of the innovation distribution.
The final objective value.
The data used in estimation if return_data
is set to TRUE
. NULL
otherwise.
Yangzhuoran Yang
update.RRRR
, RRRR
, RRR
set.seed(2222) data <- RRR_sim() res <- ORRRR(y=data$y, x=data$x, z = data$z) res
set.seed(2222) data <- RRR_sim() res <- ORRRR(y=data$y, x=data$x, z = data$z) res
Plot Objective value of a Robust Reduced-Rank Regression
## S3 method for class 'RRRR' plot(x, aes_x = c("iteration", "runtime"), xlog10 = TRUE, ...)
## S3 method for class 'RRRR' plot(x, aes_x = c("iteration", "runtime"), xlog10 = TRUE, ...)
x |
An RRRR object. |
aes_x |
Either "iteration" or "runtime". The x axis in the plot. |
xlog10 |
Logical, indicates whether the scale of x axis is log 10 transformed. |
... |
Additional argument to |
An ggplot2 object
Yangzhuoran Fin Yang
set.seed(2222) data <- RRR_sim() res <- RRRR(y=data$y, x=data$x, z = data$z) plot(res)
set.seed(2222) data <- RRR_sim() res <- RRRR(y=data$y, x=data$x, z = data$z) plot(res)
Gaussian Maximum Likelihood Estimation method for Reduced-Rank Regression. This method is not robust in the sense that it assumes a Gaussian distribution for the innovations which does not take into account the heavy-tailedness of the true distribution and outliers.
RRR(y, x, z = NULL, mu = TRUE, r = 1)
RRR(y, x, z = NULL, mu = TRUE, r = 1)
y |
Matrix of dimension N*P. The matrix for the response variables. See |
x |
Matrix of dimension N*Q. The matrix for the explanatory variables to be projected. See |
z |
Matrix of dimension N*R. The matrix for the explanatory variables not to be projected. See |
mu |
Logical. Indicating if a constant term is included. |
r |
Integer. The rank for the reduced-rank matrix |
The formulation of the reduced-rank regression is as follow:
where for each realization is a vector of dimension
for the
response variables,
is a vector of dimension
for the
explanatory variables that will be projected to
reduce the rank,
is a vector of dimension
for the
explanatory variables
that will not be projected,
is the constant vector of dimension
,
is the innovation vector of dimension
,
is a coefficient matrix for
with dimension
,
is the so called exposure matrix with dimension
, and
is the so called factor matrix with dimension
.
The matrix resulted from
will be a reduced rank coefficient matrix with rank of
.
The function estimates parameters
,
,
,
, and
, the covariance matrix of
the innovation's distribution, assuming the innovation has a Gaussian distribution.
A list of the estimated parameters of class RRR
.
The input specifications. is the sample size.
The estimated constant vector. Can be NULL
.
The estimated exposure matrix.
The estimated factor matrix.
The estimated coefficient matrix of z
. Can be NULL
.
The estimated covariance matrix of the innovation distribution.
Yangzhuoran Yang
S. Johansen, "Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models,"Econometrica, vol. 59,p. 1551, Nov. 1991.
For robust reduced-rank regression estimation see function RRRR
.
set.seed(2222) data <- RRR_sim() res <- RRR(y=data$y, x=data$x, z = data$z) res
set.seed(2222) data <- RRR_sim() res <- RRR(y=data$y, x=data$x, z = data$z) res
Simulate data for Reduced-rank regression. See Detail
for the formulation
of the simulated data.
RRR_sim( N = 1000, P = 3, Q = 3, R = 1, r = 1, mu = rep(0.1, P), A = matrix(rnorm(P * r), ncol = r), B = matrix(rnorm(Q * r), ncol = r), D = matrix(rnorm(P * R), ncol = R), varcov = diag(P), innov = mvtnorm::rmvt(N, sigma = varcov, df = 3), mean_x = 0, mean_z = 0, x = NULL, z = NULL )
RRR_sim( N = 1000, P = 3, Q = 3, R = 1, r = 1, mu = rep(0.1, P), A = matrix(rnorm(P * r), ncol = r), B = matrix(rnorm(Q * r), ncol = r), D = matrix(rnorm(P * R), ncol = R), varcov = diag(P), innov = mvtnorm::rmvt(N, sigma = varcov, df = 3), mean_x = 0, mean_z = 0, x = NULL, z = NULL )
N |
Integer. The total number of simulated realizations. |
P |
Integer. The dimension of the response variable matrix. See |
Q |
Integer. The dimension of the explanatory variable matrix to be projected. See |
R |
Integer. The dimension of the explanatory variable matrix not to be projected. See |
r |
Integer. The rank of the reduced rank coefficient matrix. See |
mu |
Vector with length P. The constants. Can be |
A |
Matrix with dimension P*r. The exposure matrix. See |
B |
Matrix with dimension Q*r. The factor matrix. See |
D |
Matrix with dimension P*R. The coefficient matrix for |
varcov |
Matrix with dimension P*P. The covariance matrix of the innovation. See |
innov |
Matrix with dimension N*P. The innovations. Default to be simulated from a Student t distribution, See |
mean_x |
Integer. The mean of the normal distribution |
mean_z |
Integer. The mean of the normal distribution |
x |
Matrix with dimension N*Q. Can be used to specify |
z |
Matrix with dimension N*R. Can be used to specify |
The data simulated can be used for the standard reduced-rank regression testing with the following formulation
where for each realization is a vector of dimension
for the
response variables,
is a vector of dimension
for the
explanatory variables that will be projected to
reduce the rank,
is a vector of dimension
for the
explanatory variables
that will not be projected,
is the constant vector of dimension
,
is the innovation vector of dimension
,
is a coefficient matrix for
with dimension
,
is the so called exposure matrix with dimension
, and
is the so called factor matrix with dimension
.
The matrix resulted from
will be a reduced rank coefficient matrix with rank of
.
The function simulates
,
from multivariate normal distribution and
by specifying
parameters
,
,
,
, and
, the covariance matrix of
the innovation's distribution. The constant
and the term
can be
dropped by setting
NULL
for arguments mu
and D
. The innov
in the argument is
the collection of innovations of all the realizations.
A list of the input specifications and the data ,
, and
, of class
RRR_data
.
Matrix of dimension N*P
Matrix of dimension N*Q
Matrix of dimension N*R
Yangzhuoran Yang
set.seed(2222) data <- RRR_sim()
set.seed(2222) data <- RRR_sim()
Majorisation-Minimisation based Estimation for Reduced-Rank Regression with a Cauchy Distribution Assumption.
This method is robust in the sense that it assumes a heavy-tailed Cauchy distribution
for the innovations. This method is an iterative optimization algorithm. See References
for a similar setting.
RRRR( y, x, z = NULL, mu = TRUE, r = 1, itr = 100, earlystop = 1e-04, initial_A = matrix(rnorm(P * r), ncol = r), initial_B = matrix(rnorm(Q * r), ncol = r), initial_D = matrix(rnorm(P * R), ncol = R), initial_mu = matrix(rnorm(P)), initial_Sigma = diag(P), return_data = TRUE )
RRRR( y, x, z = NULL, mu = TRUE, r = 1, itr = 100, earlystop = 1e-04, initial_A = matrix(rnorm(P * r), ncol = r), initial_B = matrix(rnorm(Q * r), ncol = r), initial_D = matrix(rnorm(P * R), ncol = R), initial_mu = matrix(rnorm(P)), initial_Sigma = diag(P), return_data = TRUE )
y |
Matrix of dimension N*P. The matrix for the response variables. See |
x |
Matrix of dimension N*Q. The matrix for the explanatory variables to be projected. See |
z |
Matrix of dimension N*R. The matrix for the explanatory variables not to be projected. See |
mu |
Logical. Indicating if a constant term is included. |
r |
Integer. The rank for the reduced-rank matrix |
itr |
Integer. The maximum number of iteration. |
earlystop |
Scalar. The criteria to stop the algorithm early. The algorithm will stop if the improvement
on objective function is small than |
initial_A |
Matrix of dimension P*r. The initial value for matrix |
initial_B |
Matrix of dimension Q*r. The initial value for matrix |
initial_D |
Matrix of dimension P*R. The initial value for matrix |
initial_mu |
Matrix of dimension P*1. The initial value for the constant |
initial_Sigma |
Matrix of dimension P*P. The initial value for matrix Sigma. See |
return_data |
Logical. Indicating if the data used is return in the output.
If set to |
The formulation of the reduced-rank regression is as follow:
where for each realization is a vector of dimension
for the
response variables,
is a vector of dimension
for the
explanatory variables that will be projected to
reduce the rank,
is a vector of dimension
for the
explanatory variables
that will not be projected,
is the constant vector of dimension
,
is the innovation vector of dimension
,
is a coefficient matrix for
with dimension
,
is the so called exposure matrix with dimension
, and
is the so called factor matrix with dimension
.
The matrix resulted from
will be a reduced rank coefficient matrix with rank of
.
The function estimates parameters
,
,
,
, and
, the covariance matrix of
the innovation's distribution, assuming the innovation has a Cauchy distribution.
A list of the estimated parameters of class RRRR
.
The input specifications. is the sample size.
The path of all the parameters during optimization and the path of the objective value.
The estimated constant vector. Can be NULL
.
The estimated exposure matrix.
The estimated factor matrix.
The estimated coefficient matrix of z
.
The estimated covariance matrix of the innovation distribution.
The final objective value.
The data used in estimation if return_data
is set to TRUE
. NULL
otherwise.
Yangzhuoran Yang
Z. Zhao and D. P. Palomar, "Robust maximum likelihood estimation of sparse vector error correction model," in2017 IEEE Global Conference on Signal and Information Processing (GlobalSIP), pp. 913–917,IEEE, 2017.
set.seed(2222) data <- RRR_sim() res <- RRRR(y=data$y, x=data$x, z = data$z) res
set.seed(2222) data <- RRR_sim() res <- RRRR(y=data$y, x=data$x, z = data$z) res
update.RRRR
will update online robust reduced-rank regression model with class RRRR
(ORRRR
) using newly added data
to achieve online estimation.
Estimation methods:
Stochastic Majorisation-Minimisation
Sample Average Approximation
## S3 method for class 'RRRR' update( object, newy, newx, newz = NULL, addon = object$spec$addon, method = object$method, SAAmethod = object$SAAmethod, ..., ProgressBar = requireNamespace("lazybar") )
## S3 method for class 'RRRR' update( object, newy, newx, newz = NULL, addon = object$spec$addon, method = object$method, SAAmethod = object$SAAmethod, ..., ProgressBar = requireNamespace("lazybar") )
object |
A model with class |
newy |
Matrix of dimension N*P, the new data y. The matrix for the response variables. See |
newx |
Matrix of dimension N*Q, the new data x. The matrix for the explanatory variables to be projected. See |
newz |
Matrix of dimension N*R, the new data z. The matrix for the explanatory variables not to be projected. See |
addon |
Integer. The number of data points to be added in the algorithm in each iteration after the first. |
method |
Character. The estimation method. Either "SMM" or "SAA". See |
SAAmethod |
Character. The sub solver used in each iteration when the |
... |
Additional arguments to function
|
ProgressBar |
Logical. Indicating if a progress bar is shown during the estimation process.
The progress bar requires package |
The formulation of the reduced-rank regression is as follow:
where for each realization is a vector of dimension
for the
response variables,
is a vector of dimension
for the
explanatory variables that will be projected to
reduce the rank,
is a vector of dimension
for the
explanatory variables
that will not be projected,
is the constant vector of dimension
,
is the innovation vector of dimension
,
is a coefficient matrix for
with dimension
,
is the so called exposure matrix with dimension
, and
is the so called factor matrix with dimension
.
The matrix resulted from
will be a reduced rank coefficient matrix with rank of
.
The function estimates parameters
,
,
,
, and
, the covariance matrix of
the innovation's distribution.
See ?ORRRR
for details about the estimation methods.
A list of the estimated parameters of class ORRRR
.
The estimation method being used
If SAA is the major estimation method, what is the sub solver in each iteration.
The input specifications. is the sample size.
The path of all the parameters during optimization and the path of the objective value.
The estimated constant vector. Can be NULL
.
The estimated exposure matrix.
The estimated factor matrix.
The estimated coefficient matrix of z
.
The estimated covariance matrix of the innovation distribution.
The final objective value.
The data used in estimation.
Yangzhuoran Yang
ORRRR
, RRRR
, RRR
set.seed(2222) data <- RRR_sim() newdata <- RRR_sim(A = data$spec$A, B = data$spec$B, D = data$spec$D) res <- ORRRR(y=data$y, x=data$x, z = data$z) res <- update(res, newy=newdata$y, newx=newdata$x, newz=newdata$z) res
set.seed(2222) data <- RRR_sim() newdata <- RRR_sim(A = data$spec$A, B = data$spec$B, D = data$spec$D) res <- ORRRR(y=data$y, x=data$x, z = data$z) res <- update(res, newy=newdata$y, newx=newdata$x, newz=newdata$z) res