loss.gr.squared.error: Squared error Loss Function Gradient

View source: R/StatModels.R

loss.gr.squared.errorR Documentation

Squared error Loss Function Gradient

Description

This function implements the squared error loss gradient with respect to y.hat used for linear regression in the form required by EmpiricalRiskMinimizationDP.KST.

Usage

loss.gr.squared.error(y.hat, y)

Arguments

y.hat

Vector or matrix of estimated values.

y

Vector or matrix of true values.

Value

Vector or matrix of the squared error loss gradient for each element of y.hat and y.

Examples

  y.hat <- c(0.1, 0.88, 0.02)
  y <- c(-0.1, 1, .2)
  loss.gr.squared.error(y.hat,y)


DPpack documentation built on Oct. 20, 2024, 9:07 a.m.