Deriving the least squares estimators of the slope and intercept (simple linear regression)

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 มี.ค. 2019
  • I derive the least squares estimators of the slope and intercept in simple linear regression (Using summation notation, and no matrices.) I assume that the viewer has already been introduced to the linear regression model, but I do provide a brief review in the first few minutes. I assume that you have a basic knowledge of differential calculus, including the power rule and the chain rule.
    If you are already familiar with the problem, and you are just looking for help with the mathematics of the derivation, the derivation starts at 3:26.
    At the end of the video, I illustrate that sum(X_i-X bar)(Y_i - Y bar) = sum X_i(Y_i - Y bar) =sum Y_i(X_i - X bar) , and that sum(X_i-X bar)^2 = sum X_i(X_i - X bar).
    There are, of course, a number of ways of expressing the formula for the slope estimator, and I make no attempt to list them all in this video.

ความคิดเห็น • 195

  • @AnDr3s0
    @AnDr3s0 4 ปีที่แล้ว +151

    Finally, someone who made it simple to understand! Thank you!

    • @victoriabrimm5014
      @victoriabrimm5014 3 ปีที่แล้ว +4

      Right! i went through like a million videos trying to understand this one segment and this was the first to do it.

    • @agustinlawtaro
      @agustinlawtaro 3 ปีที่แล้ว

      True.

    • @cmacompilation4649
      @cmacompilation4649 6 หลายเดือนก่อน

      please, how is it possible to consider Beta variable (when taking derivatives) and then consider Beta constant (to take it out of the sum) ???

    • @cleisonarmandomanriqueagui9176
      @cleisonarmandomanriqueagui9176 หลายเดือนก่อน

      Best video . i was looking for something like this

    • @TheJolgo
      @TheJolgo 15 ชั่วโมงที่ผ่านมา

      This guy literally skipped vital parts of the proof xD

  • @anuraghavsai5575
    @anuraghavsai5575 3 ปีที่แล้ว +41

    This is an underrated video.

  • @sajibmannan
    @sajibmannan 3 ปีที่แล้ว +36

    My god, you explained this so easily. It took me hours trying to understand this before watching this video but still couldn’t understand it properly. After watching this video, it's crystal-clear now. ❤️

    • @DHDH_DH
      @DHDH_DH 5 หลายเดือนก่อน

      me, too. I spent a whole morning figuring this. He is a savior

  • @amberxv4777
    @amberxv4777 2 ปีที่แล้ว +6

    I don't usually comment on teaching videos. But this really deserves thanks for how clearly and simply you explained everything. The lecture I had at the university left much to be desired

  • @augustinejunior3361
    @augustinejunior3361 2 ปีที่แล้ว +2

    I never thought that I could understand simple linear regression using this approach. Thank you

  • @alimortadahoumani1134
    @alimortadahoumani1134 8 หลายเดือนก่อน +1

    unbelievably perfect video, one of the best videos I have watched in the statistics field, so rare to find high-quality in this field idk why

  • @JFstriderXgaming
    @JFstriderXgaming 3 ปีที่แล้ว +4

    My Physical Chemistry teacher spent ~1.5 hrs showing this derivation and I got completely lost. Watching your video, it's so clear now. Thank you for your phenomenal work.

  • @aaskyboi
    @aaskyboi 4 ปีที่แล้ว +17

    I can't thank you enough for this brilliant explanation!

  • @user-jk2tp6gs2g
    @user-jk2tp6gs2g 2 ปีที่แล้ว +5

    I have gone through tons of materials on this topic and they either skip the derivation process or go direct into some esoteric matrix arithmetics. This video explains everything I need to know. Thanks.

  • @valeriereid2337
    @valeriereid2337 ปีที่แล้ว +2

    The best part of this video is finally figuring out where that "n" came from in the equation for beta-naught-hat. Thank you so very much for making this available.

  • @nak6608
    @nak6608 2 ปีที่แล้ว +4

    phenomenal video. Thank you for taking the time to explain each step of the derivations such as the sum rule for derivation. Thank you for helping me learn.

  • @monojitchatterjee3185
    @monojitchatterjee3185 4 ปีที่แล้ว +11

    Absolutely beautiful derivation!
    Crystal clear!
    Thanks very much.

  • @yixuanliu8368
    @yixuanliu8368 ปีที่แล้ว

    you have no idea how you saved my life, I was struggling so hard to find out why xi(xi-xbar)=(xi-xbar)^2 and etc. you are the first one I found explained that.

  • @pkeric2626
    @pkeric2626 4 ปีที่แล้ว +3

    Thanks so much, this was so easy to follow and comprehend!

  • @ghunter958
    @ghunter958 4 ปีที่แล้ว +2

    Really, really good explanation!! Thank you!!

  • @Murraythis
    @Murraythis 2 ปีที่แล้ว

    Amazing video! Slight bumps where my own knowledge was patchy but you provided enough steps for me to work those gaps out.

  • @TheProblembaer2
    @TheProblembaer2 ปีที่แล้ว

    This is FANTASTIC. THANK YOU!

  • @danverzhao9912
    @danverzhao9912 2 ปีที่แล้ว +6

    Thank you so much! This explanation is literally perfect, helped me so much!

    • @jbstatistics
      @jbstatistics  2 ปีที่แล้ว +1

      Thanks for the kind words! I'm glad to be of help!

  • @martijnbos9873
    @martijnbos9873 4 ปีที่แล้ว

    Absolutely brilliant video!!! Thanks so much

  • @TheMatthyssen
    @TheMatthyssen 8 หลายเดือนก่อน

    thank you for actually explaining it, most of videos are just like "hi, if you want to solve this, plug in this awesome formula and thats it, thank you for watching :)"

  • @daniyal98
    @daniyal98 4 ปีที่แล้ว +1

    one video on youtube that actually explains something properly

  • @process6996
    @process6996 5 ปีที่แล้ว +6

    Glad you're back!

    • @jbstatistics
      @jbstatistics  5 ปีที่แล้ว +3

      Thanks! Glad to be back! Just recording and editing as I type this!

  • @muhammaddzakyrafliansyah3587
    @muhammaddzakyrafliansyah3587 ปีที่แล้ว

    You made it simpler than my lecturer do. Thank you!

  • @jingyiwang5113
    @jingyiwang5113 7 หลายเดือนก่อน

    Thank you so much for such a clear explanation! It helps me a lot in preparing for my upcoming final exam.

  • @jackhasfun4752
    @jackhasfun4752 8 หลายเดือนก่อน

    thank you so much, this video has cleared all my confusions cuz the book im reading just says 'by doing some simple calculus'

  • @tastypie2276
    @tastypie2276 3 ปีที่แล้ว

    Thank you very much! Very clear and interesting explanation!

  • @aron4317
    @aron4317 2 หลายเดือนก่อน

    Beautiful video, good explanation

  • @asad_rez
    @asad_rez 2 ปีที่แล้ว

    Thank you for explaining in such details ❤️

  • @eltuneyvazzade8845
    @eltuneyvazzade8845 ปีที่แล้ว

    Very helpful video to understand. Many thanks!

  • @Zydres_Impaler
    @Zydres_Impaler ปีที่แล้ว

    thanks a lot for simplifying the derivation

  • @raitup00
    @raitup00 4 ปีที่แล้ว

    Great explanation! Step by step...

  • @AJ-et3vf
    @AJ-et3vf 2 ปีที่แล้ว

    Awesome video sir! Thank you!

  • @preethidonthu2433
    @preethidonthu2433 ปีที่แล้ว

    Thank u soooo much! For explaining this. You made my day

  • @louism.4980
    @louism.4980 5 หลายเดือนก่อน +1

    This is incredible, thank you so much! :)

    • @jbstatistics
      @jbstatistics  5 หลายเดือนก่อน

      You are very welcome!

  • @satyarath7723
    @satyarath7723 2 ปีที่แล้ว

    Thanks a lot sir I really got this what I need indeed. 🙏🙏🙏🙏🙏🙏🙏🙏There is no words for appreciation of your efforts

  • @soryegetun529
    @soryegetun529 2 ปีที่แล้ว +1

    finally, I've understood this bloody thing. Thank u sooooo much m8.

    • @jbstatistics
      @jbstatistics  2 ปีที่แล้ว +1

      I'm glad you found it helpful!

  • @wuttinanlerkmangkorn7009
    @wuttinanlerkmangkorn7009 3 ปีที่แล้ว

    Best explanation, thank you so much

  • @frequencyspectra1
    @frequencyspectra1 2 ปีที่แล้ว

    Excellent video

  • @ericricky808
    @ericricky808 3 ปีที่แล้ว

    This is talent. Thank you so much 😊

  • @loden5677
    @loden5677 8 หลายเดือนก่อน

    This was really helpful thanks!

  • @DHDH_DH
    @DHDH_DH 5 หลายเดือนก่อน

    You are awesome! I am not a native speaker and still struggling with the master program courses in the US, but your instruction is so helpful. I appreciate your great help

    • @jbstatistics
      @jbstatistics  5 หลายเดือนก่อน

      Thanks! I'm happy to be of help!

  • @CaptainCalculus
    @CaptainCalculus 3 ปีที่แล้ว

    Excellent video!

  • @arjoy4942
    @arjoy4942 5 ปีที่แล้ว

    Great sir, very helpful!

  • @fatemehmaroufkhani7104
    @fatemehmaroufkhani7104 2 ปีที่แล้ว

    Thank you very much. This video helped me a lot.

  • @mangaart3366
    @mangaart3366 3 ปีที่แล้ว

    Exactly what I was looking for. Thank you so much!

    • @jbstatistics
      @jbstatistics  3 ปีที่แล้ว +1

      You are very welcome!

    • @herodmoonga4799
      @herodmoonga4799 2 ปีที่แล้ว

      Greatful, you are wonderful Sir,you have made me understand economics

  • @olympusexothermic1752
    @olympusexothermic1752 ปีที่แล้ว

    Thank you so much am really enjoying and understanding what your teaching

  • @stretch8390
    @stretch8390 ปีที่แล้ว

    Easiest subscribe of my life.

  • @renata8938
    @renata8938 3 ปีที่แล้ว

    Thank you. This is very clear

  • @mpandesyambayi5898
    @mpandesyambayi5898 2 ปีที่แล้ว

    Greatly explained

  • @joansome951
    @joansome951 10 หลายเดือนก่อน

    Great job! Thank you sir!

  • @promasterliuss
    @promasterliuss ปีที่แล้ว

    good explanation!

  • @mohe4ever514
    @mohe4ever514 2 ปีที่แล้ว

    Very well explained

  • @fisher4651
    @fisher4651 2 ปีที่แล้ว

    LEGEND, HAVE TO SAY YOU ARE BETTER THAN A PROFFESOR

  • @tnorton314
    @tnorton314 3 ปีที่แล้ว

    Thanks, so helpful!

  • @girlstrends8204
    @girlstrends8204 6 หลายเดือนก่อน

    you make it sooo easy

  • @robin-bird
    @robin-bird 2 ปีที่แล้ว

    definitely the best video out there on this topic
    makes me wonder why its not the top recommendation / search result
    maybe because of the title

    • @jbstatistics
      @jbstatistics  2 ปีที่แล้ว

      Thanks! How about "Finding the formulas for the slope and intercept the EASY WAY! (When I got to step 8, my jaw DROPPED!)" :)

    • @robin-bird
      @robin-bird 2 ปีที่แล้ว

      @@jbstatistics no idea, I'm not good at making up titles. Maybe something like this?
      Simple Linear Regression | Derivation

    • @jbstatistics
      @jbstatistics  2 ปีที่แล้ว

      @@robin-bird I was just joking, but thanks for the input :)

    • @robin-bird
      @robin-bird 2 ปีที่แล้ว

      @@jbstatistics I was wondering - thanks for clearing that up ^^

  • @poojachhachhiya1574
    @poojachhachhiya1574 3 ปีที่แล้ว

    Wow. This is great.thanku so much.

  • @umedina98
    @umedina98 2 ปีที่แล้ว

    Really nice derivation!

  • @sasirekhamsvl9504
    @sasirekhamsvl9504 3 ปีที่แล้ว

    Great video Brother

  • @mautasimsiddiqui8618
    @mautasimsiddiqui8618 ปีที่แล้ว

    Thank you so much.

  • @jesabumaras4758
    @jesabumaras4758 2 ปีที่แล้ว

    Thank you very to clear explanation ❤

  • @atomu9663
    @atomu9663 ปีที่แล้ว

    Good video Thanks!

  • @hellothere9298
    @hellothere9298 5 หลายเดือนก่อน +1

    Thank you very much sir !

    • @jbstatistics
      @jbstatistics  5 หลายเดือนก่อน

      You are very welcome!

  • @LucyMburu605
    @LucyMburu605 หลายเดือนก่อน

    Thanks alot it really helped

  • @omarzodiac
    @omarzodiac 5 ปีที่แล้ว

    Yes! New stuff 👍🏼👍🏼

  • @dalkeiththomas9352
    @dalkeiththomas9352 2 ปีที่แล้ว

    You sir are AMazing

  • @user-fn6lz8pp6j
    @user-fn6lz8pp6j 4 ปีที่แล้ว

    THANKS GOD FINALLY SOMEONE TRIED TO DERIVE THE FORMULA,
    INSANE THAT NEARLY ALL OTHER RESOURCES OMIT THIS SHIT

  • @ezozakamolova885
    @ezozakamolova885 8 หลายเดือนก่อน

    Thank you so much

  • @zumichetiapator
    @zumichetiapator หลายเดือนก่อน

    finally got my doubt resolved.😊

  • @tezike
    @tezike 3 ปีที่แล้ว +7

    holy hell I wish you were my econometrics professor. mine is useless

  • @ethanchung1541
    @ethanchung1541 3 ปีที่แล้ว

    u are a life saver

  • @AnuarPhysics
    @AnuarPhysics 2 ปีที่แล้ว

    Nice trick! Adding an intelligent zero huh?
    Thanks for this video!

  • @singsongsou1865
    @singsongsou1865 3 ปีที่แล้ว +1

    Thanks a lot!!!

  • @MudahnyaFizik
    @MudahnyaFizik 3 ปีที่แล้ว

    Thanks so much!

  • @Sulegibongtoo176
    @Sulegibongtoo176 2 ปีที่แล้ว

    Wow many university lecturers can’t explain it this well!

  • @anangelsdiaries
    @anangelsdiaries 2 หลายเดือนก่อน

    The result represent the minimas since the original function that we were minimizing is convex and open upwards, so the only way for a critical value to exist is for it to be a minimum.

  • @katerinagk2681
    @katerinagk2681 ปีที่แล้ว

    THANK YOU

  • @sajibmannan
    @sajibmannan 3 ปีที่แล้ว +2

    Question: 6:24 Why and how beta zero hat is multiplied with n? Does n mean sample size? What's the reasoning behind n adjoining with beta zero hat?

  • @virgilhawkins4575
    @virgilhawkins4575 4 ปีที่แล้ว

    Awesome!

  • @MahnoorNaveed-
    @MahnoorNaveed- 2 ปีที่แล้ว

    thank u so much.

  • @anannaanu9918
    @anannaanu9918 2 ปีที่แล้ว

    Thanks a lot

  • @IvanJacobsvelocity
    @IvanJacobsvelocity 2 ปีที่แล้ว

    thank you 100^100 times

  • @hawasadiki5292
    @hawasadiki5292 3 หลายเดือนก่อน

    Thank you

  • @SiddharthPrabhu1983
    @SiddharthPrabhu1983 5 ปีที่แล้ว

    Thanks Dr. Balka! Is it computationally expensive to estimate the parameters in this manner for models with many independent variables or very large datasets? Is that the reason why iterative methods such as gradient descent are sometimes employed instead?

    • @Tusharchitrakar
      @Tusharchitrakar 5 หลายเดือนก่อน

      The matrix inversion operation in ols is computationally expensive, hence numerical methods like gradient descent are useful.

  • @harchitb
    @harchitb 4 ปีที่แล้ว

    this is great

  • @natachajouonang2710
    @natachajouonang2710 2 ปีที่แล้ว +1

    Amazing and super helpful video! Extremely simple and easy to follow! But please, quick question: Why did you switch the Xi and Xbar at 7:51? This drastically changes the ending solution.

    • @malolanbalaji98
      @malolanbalaji98 2 ปีที่แล้ว

      When he removes the inner paranthesis, the term Xi becomes negative and Xbar becomes positive. So when you multiply it by (-ve)Beta, the signage of both terms reverses

  • @ciasuryani5422
    @ciasuryani5422 4 ปีที่แล้ว

    Thanks so much

  • @deborahsakazhila4068
    @deborahsakazhila4068 4 ปีที่แล้ว +8

    Hi, do you have a video on deriving coefficients in multiple regression?

    • @mattstats399
      @mattstats399 ปีที่แล้ว

      That is a fun derivation using linear algebra and calculus. First step is the same here which is taking the first derivative and setting it equal to zero. The book "The Elements of Statistical Learning" has a good proof. I'd say one needs a calc 1 and linear algebra background first though.

  • @kexinfang1093
    @kexinfang1093 3 ปีที่แล้ว

    Thanks a lot!!!!!

  • @xavieribanez-padron4857
    @xavieribanez-padron4857 7 หลายเดือนก่อน

    god bless you brother

  • @badrftouh9322
    @badrftouh9322 ปีที่แล้ว

    Nailed it

  • @peehugupta5803
    @peehugupta5803 3 ปีที่แล้ว

    thank you so so much :)))))

  • @reinier5355
    @reinier5355 3 ปีที่แล้ว

    great video, my summary just gave the formula with the text: 'just remember this' hate that

  • @gan_luo1909
    @gan_luo1909 2 ปีที่แล้ว

    saved my life

  • @menghongpor2667
    @menghongpor2667 4 ปีที่แล้ว +2

    At 10:52 timeline, how can we switch the role of X sub i and Y sub i? Could you help explain how this happens?

    • @harveywilliams7013
      @harveywilliams7013 3 ปีที่แล้ว +1

      In the first step, we choose to expand (Xi - Xbar) but we could have chosen to expand (Yi - Ybar) and it would follow a similar route.

  • @girlstrends8204
    @girlstrends8204 6 หลายเดือนก่อน

    thank you so much ...............

    • @jbstatistics
      @jbstatistics  6 หลายเดือนก่อน

      You are very welcome!

  • @Jason-mx5de
    @Jason-mx5de 2 ปีที่แล้ว

    It's cool how if you rearrange the straight line equation for c, you get c = y - mx, and by this method you find b0 = ybar - b1*xbar. You could've almost guessed it as a joke and been correct. The b1 isn't as obvious though.

  • @egnos
    @egnos 4 ปีที่แล้ว +3

    2:24, where did you discuss why it makes sense to minimize the sum of squared residuals ?

    • @aakarshan01
      @aakarshan01 4 ปีที่แล้ว +2

      makes it more sensitive to bigger errors. And it's differentiable at all points. In the Mod function , it is not differentiable at the point it pivots up

    • @SuperYtc1
      @SuperYtc1 3 ปีที่แล้ว

      @@aakarshan01 but why not to power 1.5? why not to power 4? why is it exactly power 2?

    • @aakarshan01
      @aakarshan01 3 ปีที่แล้ว +1

      @@SuperYtc1 you can.but there is no need to. The differentiability is achieved in square. Why calculate a bigger number that could lead to problems since power 4 of a decimal number of more likely to break the minimum number limit of a float than a square. But in theory, you can

  • @anonymousAI-pr2wq
    @anonymousAI-pr2wq 2 ปีที่แล้ว

    Thanks for the video. Just wondering why x and y can be considered constant when differentiate against B0 or B1? Is it because of partial differentiation or X and Y are known numbers?

    • @yaweli2968
      @yaweli2968 ปีที่แล้ว

      I think you are arguing why Bo hat and B1 hat should be considered constants for the sample.They are clearly not going to change for that sample.

  • @bdrgn
    @bdrgn 2 ปีที่แล้ว

    Great tutorial! I could use some ideas of how to better teach the material.