#'This Q function is introduced in the original FISTA paper. It is the quadratic approximation of the objective function.
#'
#'@param x coefficient vector (matrix)
#'@param y an alternative coefficient vector (proximal)
#'@param A design matrix in linear regression
#'@param b target vector in linear regression
#'@param L learning step size
#'@param AtA crossproduct of A
#'@param Atb crossproduct of A and b
#'@return the value of Q function
#'@details Q function contributes the quadratic approximation to the objective function (loss + penalties)
#'@examples
#'\dontrun{
#'set.seed(1)
#'x <- stats::rnorm(10)
#'y <- stats::rnorm(10)
#'A <- matrix(stats::rnorm(200), nrow = 20, ncol = 10)
#'b <- stats:rnorm(20)
#'L <- 0.2
#'AtA <- t(A) %*% A
#'Atb <- t(A) %*% b
#'Q_func(x, y, A, b, L, AtA, Atb)
#'}
#'@export
Q_func <- function(x, y, A, b, L, AtA, Atb){
return(f_func(y, A, b) + sum((x - y) * gradf_func(y, AtA, Atb)) + (1/2) * L * norm(x - y, "F")^2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.