Skip to contents

grad = (2/m) X^T (X theta - y), differentiating the shared MSE core.

Usage

morie_geron_ch4_mse_gradient_vector(X, y, theta)

Arguments

X, y, theta

Design, targets and parameters.

Value

List with gradient, cost, grad_norm.

Examples

morie_geron_ch4_mse_gradient_vector(X = 5L, y = 5L, theta = 0.5)
#> $gradient
#> [1] -25
#> 
#> $cost
#> [1] 6.25
#> 
#> $grad_norm
#> [1] 25
#> 
#> $estimate
#> [1] -25
#> 
#> $n
#> [1] 1
#>