Table of Contents

Least Squares

What does “least” mean in “Least Squares”?

Animation

We want to find an estimate for the slope in 50 candidate slopes, so we just compute the RSS one by one. </ani>

R Code

library(animation)
saveHTML({
    ani.options(interval = 0.3)
    par(mar = c(4, 4, 0.5, 0.1), mgp = c(2, 0.5, 0), tcl = -0.3)
    ## slope changing
    least.squares()
}, img.name = "least_squares", htmlfile = "least_squares.html", 
    ani.height = 450, ani.width = 600, title = "Demonstration of Least Squares (Slope)", 
    description = c("We want to find an estimate for the slope in 50 candidate slopes, so we just compute the RSS one by one. "))

## or with intercept changing
saveHTML({
    ani.options(interval = 0.3)
    par(mar = c(4, 4, 0.5, 0.1), mgp = c(2, 0.5, 0), tcl = -0.3)
    # slope changing
    least.squares(ani.type = "intercept")
}, img.name = "least_squares", htmlfile = "least_squares.html", 
    ani.height = 450, ani.width = 600, title = "Demonstration of Least Squares (Slope)", 
    description = c("We want to find an estimate for the slope in 50 candidate slopes, so we just compute the RSS one by one. "))

lm/least_squares.txt · Last modified: 2011/01/14 22:35 by oyster8
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki