Last Time | Next Time |
I forgot the so-called intercept term in the model:
and we'll use this model with three pieces of data to determine the parameters in our model via a system of three equations in three unknowns:
I got this data off of the cargurus website and grabbed three different cars (I was shooting for "good values") with three different years and three different mileages. Then I solved the linear system for the parameters of the model:
Now I can use that model to determine whether my brother-in-law's car prospect -- a 2003 Camry with 87K miles at 7.5 is a good deal:
Wow! Go out and check out that car! The model says it should cost $10.2K, and it's going for $7.5K.... Got it?
A=[3,109,1;2,104,1;4,99,1] B=[8;7;10.5] solution=A \ B A = 3 109 1 2 104 1 4 99 1 B = 8.0000 7.0000 10.5000 solution = 1.500000 -0.100000 14.400000There is no sign of a variable name anywhere, but we know what results: we've used the data to find the values of for our car-buying model:
We write the system in "augmented matrix" form, apply elementary Gaussian row operations, and voila, we have the solution -- the unique solution -- which we write as a vector:
solution = 1.500000 -0.100000 14.400000
Notice
We might write that in a little different way: as vectors.
Notice
Links: