STA302 Lecture 01
sta302-classical-SLR-assumptions.pdf
- What we finna do?:
- Datasets like:
explanatory variable, or a predictor. the response variable. - Like input is related to output how?
are numerical variables. - Example:
- Suppose we have some data points.
- Goals:
- Summarize the relationship between the explanatory and response.
- Start with a simple linear model.
- We want to find the line of best fit.
- Keep in mind overfitting.
- Criteria:
- Least squares estimator
- Maximum Likelihood Estimator
- Hypothesis Testing
- Model:
- Suppose we have a model like so
- Price of unknown car
is predicted by some unknown mileage.
- Estimates
- Hypo test
vs - Are these things even related?
- If not related, then just use
, the avg.
- If not related, then just use
- Suppose we have a model like so
- Model:
- If
is rejected (useful model), then we try to make a CI to estimate - Lots of data to predict the average
- If
is rejected, then provide a prediction for - One piece of data to predict another single piece of data
- More variability for this case.
- Simple linear regression model.
- SLR
- Generalize to model with several predictors
- Multiple linear regression
- MLR
- Like adding '# of previous owners' and 'colour' and such to the previous example model
- Use simpler models if we get the same result
- Multiple linear regression
- Summarize the relationship between the explanatory and response.
- Datasets like:
- Regression Model with Conditional Distributions
seqis a sequence of elements.- Types of regression:
- If
- normal = classical
- poisson = poisson
- … = …
- MLE and Least Squares type estimators have nice formulas.
- But the other types don't exactly have those.
- If
- We don't say the regression model came from the data. We say that the regression model created the data, we're just trying to find the things which produce that data.
- Classical SLR model
- Assuming
#tk prac deriv - We can't use a linear model in this case
- Before fitting, make scatter plot and see if it's reasonable to use one.
- This can work:
- Here you can see that the variance increases as we go, non-constant variance.
- LINE assumptions:
- L
- Linear
- Expected value is a linear function
- I
- Errors are independent
- N
- Errors are normal
- E
- Errors have equal variance
- Also referred to as "homoscedasticity"?
- L
- In the previous model we have these assumptions.
- Understand regression models with simulation
- Produce widgets
prod cost widgets 
- Then you can guess
, then simulate and see if the scatter plot looks similar. - We can use least square estimation to find these.
- Least squares estimation
- For
and - Minimize with respect to
- We have our observations:
- We minimize that.
- Simplify further
is a quadratic function, which is our function we wanted to minimize. - Diff and set to 0?? Crit vals?
- K
- Part diffs 🙏
- ?
- Teach steppin in
- Find
and - I think I did
- Then solve the system of equations.
- 1:
- 2:
- Find
- Normal equations
- 1:
- 2:
- Find
using Cramer's rule and with substitution. deteminant - How do we get this?
- You can multiply by inverse and other methods too.
- Otherwise, we want
. - Denominator is
of the system. The coeffs of the system from eq 1. is the coeffs of the eq 2. - #tk
- Find
using Cramer's rule - Show it's the same as
- Find
- Compute the deteminant.
- I remember something about
#tk
- Find
- 1:
- 1:
- Test problem 1:
- Soln:
- 5x
- 1-2
- Same answer.
- Or cramers
- same answer.
- We can also do:
- #tk homework:
what's the formula for ?
- Proof:
is the same as the previous jawn with cramers. - Note that for
we have would have as . - If we extrapolate that we see that we basically have the same proof for the bottom.
- So
- 1:
- Example:
- Cool shit:
s.xy=(x-x.bar)%*%(y-y.bar); - That will do the matrix multiplication in R.
- Cool shit:
- Maximum Likelihood Estimator for
for , , - SLR
- Likelihood for one observation of
- The PDF of that observation
- You can show that constant plus normal is normal with mgf method, simple.
- Likelihood for random samples.
- Take products.
- For