L-2 Loss Function for Linear Regression on y=2x
Loading the math board and drawing, please wait…
This example demonstrates the L-2 loss function (Mean Squared Error) in the context of linear regression for the linear function y=2x. It involves core mathematical concepts such as linear regression, loss functions, mean squared error, and function graphing. The construction utilizes GeoGebra objects/commands like a (data points), f (function y=2x), b (variable range), c (error calculation), d (loss function graph), e (distance between data points and function line), and g (overall loss value). Suitable for high school and above students learning about linear regression model evaluation and loss function visualization.
GeoGebra Commands & Parameters
a(x, y) = ((2.1 * x) + y - 1)^(2)f(x, y) = ((2.4 * x) + y - 1.2)^(2)b(x, y) = ((2.6 * x) + y - 1.3)^(2)c(x, y) = ((2.1 * x) + y - 1)^(2) + ((3.4 * x) + y - 1.2)^(2) + ((2.6 * x) + y - 1.3)^(2) + ((8 * x) + y - 4)^(2)d(x, y) = ((8 * x) + y - 4)^(2)e(x, y) = ((2.1 * x) + y - 1)^(2) + ((2.4 * x) + y - 1.2)^(2)g(x, y) = ((2.1 * x) + y - 1)^(2) + ((8 * x) + y - 4)^(2)