Skip to content

Commit

Permalink
Minimum instead of maximum (hadley#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
duju211 authored and hadley committed Oct 3, 2016
1 parent 5ea91ca commit c989bae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model-basics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ sim1_mod <- lm(y ~ x, data = sim1)
coef(sim1_mod)
```

These are exactly the same values we got with `optim()`! Behind the scenes `lm()` doesn't use `optim()` but instead takes advantage of the mathematical structure of linear models. Using some connections between geometry, calculus, and linear algebra, `lm()` actually finds the closest model by (effectively) inverting a matrix. This approach is both faster, and guarantees that there is a global maximum.
These are exactly the same values we got with `optim()`! Behind the scenes `lm()` doesn't use `optim()` but instead takes advantage of the mathematical structure of linear models. Using some connections between geometry, calculus, and linear algebra, `lm()` actually finds the closest model by (effectively) inverting a matrix. This approach is both faster, and guarantees that there is a global minimum.

### Exercises

Expand Down

0 comments on commit c989bae

Please sign in to comment.