gradf_func: Gradient function for linear regression

Description Usage Arguments Details Value Examples

View source: R/gradf_func.R

Description

Gradient function for linear regression

Usage

1
gradf_func(x, AtA, Atb)

Arguments

x

coeffcient vector (matrix)

AtA

cross-product of design matrix

Atb

cross-product of design matrix and response vector

Details

This function returns the gradient for linear regression formula

Value

the gradient matrix with respect to A, b, and x

Examples

1
2
3
4
5
6
7
set.seed(1)
x <- stats::rnorm(10)
A <- matrix(stats::rnorm(200), 20, 10)
b <- stats::rnorm(20)
AtA <- t(A) %*% A
Atb <- t(A) %*% b
gradf_func(x, AtA, Atb)

kevinbai92/LSvarEstimate documentation built on May 8, 2020, 1:04 a.m.