Lowess and Loess, Clearly Explained!!!

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024

Комментарии • 199

  • @statquest
    @statquest  2 года назад +4

    Support StatQuest by buying my book The StatQuest Illustrated Guide to Machine Learning or a Study Guide or Merch!!! statquest.org/statquest-store/

  • @Paboty
    @Paboty 4 года назад +4

    Thank you so much for your intuitive explanation! I'm honestly impressed by how well you explained it. Love the intro jingle as well :)

    • @statquest
      @statquest  4 года назад +1

      Glad you enjoyed it!

  • @JayMinuti
    @JayMinuti 6 лет назад

    HI! Great video. I want to fit a confidence interval band to my loess curve. Any advice on how I do this?

    • @JayMinuti
      @JayMinuti 6 лет назад

      Thank you! Easier than I thought :)

    • @statquest
      @statquest  6 лет назад

      Hooray!!! That's great. :)

  • @sau002
    @sau002 4 года назад

    What is the source of the data for the noisy curve at 8:10 ? Thanks.

  • @spearchew
    @spearchew 2 года назад +1

    great

  • @CainisUponUs
    @CainisUponUs 7 лет назад +32

    man you somehow make statistics feel intuitive somehow O_o

    • @alanytics
      @alanytics 5 лет назад +6

      Cuz stat quest is cool

    • @govamurali2309
      @govamurali2309 4 года назад +5

      Bam!!!!

    • @nysnys3100
      @nysnys3100 4 года назад +1

      It's the intro

    • @christopherrichardson2398
      @christopherrichardson2398 2 года назад +1

      Double, wobble bam! With some ham cooked with eggs and spam on a frying pan sprayed with Pam! Wham! Now we have green eggs, spam, and ham! Enjoy! Mr. Sam I am.

  • @Att3mpt
    @Att3mpt 3 года назад +11

    Thank you so much for these videos! I am currently in a Machine Learning class and my teacher does not explain it very well. And I love your optimism. thank you again!

  • @BrianRisk
    @BrianRisk 6 лет назад +16

    This method has helped me make an amazing stock prediction algorithm! I'm a millionaire now!! THANKS StatQuest!!!

    • @statquest
      @statquest  6 лет назад +8

      Hooray!!! :)

    • @exitudio
      @exitudio 4 года назад +10

      million Bam!!!

    • @ThePrimeChannel780
      @ThePrimeChannel780 3 года назад

      wow, how did you do it? any advice on how to get started?

  • @donleitoso9322
    @donleitoso9322 4 года назад +10

    Hi, Josh! I'm an Economics student from Brazil. Even though it's only an undergraduate course (right after high school), it can be very demanding when it comes to Statistics, Econometrics and Machine Learning. Although I'm very new to this world, I can understand it pretty well with your help. Awesome videos!

    • @statquest
      @statquest  4 года назад +1

      Thank you very much and good luck with your courses! :)

  • @sureshkm
    @sureshkm 4 года назад +6

    I first like the video, then watch it! That's the quality of StatQuest.

  • @jiweihe3413
    @jiweihe3413 2 года назад +3

    Thanks for the clear explanation. Just wonder in the 2nd iteration, how are the two different sets of weights used together. Are they multiplied?

    • @statquest
      @statquest  2 года назад

      To be honest, I don't know the answer to that question off the top of my head.

  • @auzaluis
    @auzaluis 3 года назад +3

    that's the reason why I became a Patreon supporter, you have saved my life again!!!! And the cherry was the R functions explanations, I love this channel bro!

    • @statquest
      @statquest  3 года назад

      Thank you very much!!!! I really appreciate your support!

  • @baharrezaei5637
    @baharrezaei5637 2 года назад +1

    Most common methods used for local regression are
    1- LOESS (locally estimated scatterplot smoothing)
    2- LOWESS (locally weighted scatterplot smoothing)

    • @statquest
      @statquest  2 года назад +1

      My understanding is that LOESS is a multivariable generalization of LOWESS.

  • @leesweets4110
    @leesweets4110 2 года назад +1

    5:34 Did you forget to move the window? I am confused by how you choose your points and windows.

    • @statquest
      @statquest  2 года назад

      I may have forgotten to move the window. Sorry for the confusion.

  • @BrianRisk
    @BrianRisk 6 лет назад +5

    Dude! This is exactly what I need!

  • @lmgpc
    @lmgpc 4 года назад +3

    Your intro made my day on this pandemic season. Thanks!

  • @RealMcDudu
    @RealMcDudu 3 года назад +1

    Note that I think what you show is Robust LOESS (which also accounts for outliers, and gives the extra weight function for distance between y's and predicted y's). I think the LOWESS function in R does it by default, but the LOESS function (it's successor) doesn't do it by default. You have to set family="symmetric" in the LOESS to get it. Specifically these two models do the same:
    fit = loess(y~x, span=0.25, degree=1)
    fit2 = lowess(x, y, f=0.25, iter=0)
    And so does these:
    fit = loess(y~x, span=0.25, degree=1, family="symmetric")
    fit2 = lowess(x, y, f=0.25)

  • @stefank4286
    @stefank4286 4 года назад +1

    This was very helpful, but how do I get the actual regression function? Say I wanted to compute the approximated value for a x which is not a data point?
    In linear regression, you would get two parameters which define a line and use that line to compute the estimated y=f(x) for an x which is not a data point

    • @statquest
      @statquest  4 года назад +1

      I believe you just just connect each point that lowess creates with a straight line. So, for example, I have two consecutive x-axis values, x1, and x2, and corresponding lowess values y1, and y2, I just draw the line between (x1, y1) and (x2, y2) and if I want to make a prediction between x1, and x2, I plug the x value in to that equation for a line.

    • @stefank4286
      @stefank4286 4 года назад +2

      @@statquest Thanks for your reply, I did some further reading and a possibilty is to just use the method for an x which is not a data point. I.e. given a x which is not a data point select the region of data points z_i you want to include into the regression and calculate the weights based off the distance between the x and the z_i. From this you can calculate the regressionweights (beta_0, beta_1) just like you would with a data point z_i.
      For further reference see www.itl.nist.gov/div898/handbook/pmd/section1/dep/dep144.htm

    • @statquest
      @statquest  4 года назад

      @@stefank4286 BAM! :)

  • @BigAsciiHappyStar
    @BigAsciiHappyStar 6 месяцев назад +1

    LOESS is a fine-grained sediment, as per Wikipedia or various Scrabble dictionaries if you are into that stuff. Your pronunciation is correct.

  • @ClaudiaBiguetti
    @ClaudiaBiguetti 4 года назад +2

    I love this channel!!! Thanks for the videos!

  • @Geologist997
    @Geologist997 2 месяца назад +1

    I'm watching this video because loess and lowess are discussed in statistical method in water resources. Loess and lowess are pronounced the same.

    • @statquest
      @statquest  2 месяца назад

      Thanks!

    • @Geologist997
      @Geologist997 2 месяца назад

      @@statquest do you have a video showing implementation of loess and lowess in R?

    • @statquest
      @statquest  2 месяца назад +1

      @@Geologist997 All I have is this code that demonstrates how to use those functions in R: github.com/StatQuest/lowess_loess_demo/blob/master/lowess_loess_demo.R

  • @manuelargos
    @manuelargos 2 месяца назад +1

    Gracias profesor. Usted es el mejor

    • @statquest
      @statquest  2 месяца назад

      ¡Muchas gracias!

  • @aifuli3088
    @aifuli3088 6 лет назад +2

    Hi, at 5'34'' when the focal point changes to 6th, why doesn't the window move forward? Thank you!

    • @statquest
      @statquest  6 лет назад +1

      The window, since it is set to "size = 5", contains the four closest points to the focal point. I explain this at 3:30.

    • @aifuli3088
      @aifuli3088 6 лет назад

      I see. Thank you Josh!

    • @aifuli3088
      @aifuli3088 6 лет назад

      I see. Thank you Josh!

  • @random-ds
    @random-ds 4 года назад +1

    Hello Josh, thanks for this video, it's awesome.
    I was just wondering if you had time to finally make a video about splines? Otherwise can you give me links of any documents that can help. I need especialy the part where we plot K+m graphs (K for knots and m for the order). Thanks in advance :)

  • @콘충이
    @콘충이 4 года назад +2

    How could this vid get dislike? this video is awesome

    • @statquest
      @statquest  4 года назад

      BAM!!! Thank you very much! :)

  • @antoniocastan9229
    @antoniocastan9229 Год назад +1

    thanks i was reviewing The Seasonal and Trend decomposition using Loess , your video is fantastic !

  • @aligatorbhai
    @aligatorbhai 6 лет назад +2

    Could you make a video about fractional polynomials and splines please?great videos.Thanks

    • @statquest
      @statquest  6 лет назад +2

      I'll put that on the to-do list. :)

    • @Coucou1981
      @Coucou1981 5 лет назад +1

      @@statquest pleaaaaaaase :)

    • @statquest
      @statquest  5 лет назад +1

      @@Coucou1981 OK, I've bumped it up a spot on the to-do. :)

  • @Bornleadr
    @Bornleadr 5 лет назад +1

    How are we choosing the new points here? I am talking about all the "Red Xs". Will we just consider a point on the regression line that is perpendicular to the focal point?

    • @statquest
      @statquest  5 лет назад

      The Red Xs are chosen after fitting a line to the data using weighted least squares. If you would like to learn about least squares, check out this video: ruclips.net/video/PaFPbb66DxQ/видео.html

  • @somakkamos
    @somakkamos 5 лет назад +1

    hmmm this is interesting... i thot curves are fit using the kernel trick every time. this is new information. are you aware of any python library that can perform the same trick. and how does this compare to kernel tricks?

    • @statquest
      @statquest  5 лет назад +2

      I just did a quick google search and it seems that some people use the statsmodels package to do Lowess curves in python: www.statsmodels.org/dev/generated/statsmodels.nonparametric.smoothers_lowess.lowess.html

  • @yildizkoca8878
    @yildizkoca8878 5 месяцев назад +1

    thanks for the great content!

  • @Y45HV1N
    @Y45HV1N 3 года назад +1

    Thanks so much for this!!
    Will we have more videos on curvilinear fitting? Do p values and inference work the same with curves ? In what way fiiting a curve is better than fitting a line?

    • @statquest
      @statquest  3 года назад +1

      Statistics (like p-values) are much harder to calculate for non-linear fits than linear fits.

  • @kartikkamboj295
    @kartikkamboj295 5 лет назад +1

    Thanks ! Keep posting such videos🙏🏻.
    Regards :)

  • @technolady227
    @technolady227 6 лет назад +2

    That was so helpful! You really break everything down to basics and let the learner soak it in.

  • @statsdept9416
    @statsdept9416 7 месяцев назад

    Here is something I found on wikipedia: LOESS (LOcally Estimated Scatterplot Smoothing) and LOWESS (LOcally WEighted Scatterplot Smoothing)

  • @sandpiperr
    @sandpiperr 5 лет назад +2

    Thank you! The first time I've ever seen loess explained clearly.

    • @statquest
      @statquest  5 лет назад

      Hooray! I'm glad the video was helpful. :)

  • @pnhkaaaaa
    @pnhkaaaaa 6 лет назад +1

    Great video! Recently I've been working with the "Moving Least Square" concept which is widely used in computer graphics, especially image deformation. This video helps me understand this concept in statistical field. Thank you so much.

  • @ramanmurty1498
    @ramanmurty1498 5 лет назад +1

    Could you please upload some videos clearly explaining Non linear methods such as polynomial regression,step function ,splines,Basis function & GAM .
    Thanks for making such awesome videos.👌

    • @statquest
      @statquest  5 лет назад +1

      To quote the Wikipedia article on Polynomial Regression ( en.wikipedia.org/wiki/Polynomial_regression ): "Conveniently, [polynomial regression] models are all linear from the point of view of estimation, since the regression function is linear in terms of the unknown parameters β0, β1, .... Therefore, for least squares analysis, the computational and inferential problems of polynomial regression can be completely addressed using the techniques of multiple regression. This is done by treating x, x2, ... as being distinct independent variables in a multiple regression model." That means you can watch my videos on Linear Regression to learn about Polynomial Regression: ruclips.net/p/PLblh5JKOoLUIzaEkCLIUxQFjPIlapw8nU

  • @salemalgharbi8834
    @salemalgharbi8834 4 года назад +1

    excellent way explaining this advance concept ... thanks Josh ...

  • @ReesCatOphuls
    @ReesCatOphuls 3 месяца назад

    Nice video. I now realise i made something similar with centre moving averages and different (linear/quadratic) best fit per point. As ever i suspected that a sign of a good idea, is that someone else has done it 10x better already.

  • @davidgl1988peru
    @davidgl1988peru 4 года назад +1

    Great video man! Thanks for sharing.

  • @ericleonhuertamanzanilla4262
    @ericleonhuertamanzanilla4262 5 лет назад +1

    Excellent explanation, clear as crystal. Thank you very much for sharing it.

  • @kavanshah9586
    @kavanshah9586 5 лет назад

    What kind of a curve do you fit to the new-new points? Does the curve have to pass through all the new-new points?

  • @posthocprior
    @posthocprior Год назад +1

    This was a great explanation. Thanks.

  • @serafeiml1041
    @serafeiml1041 2 года назад +1

    Great video.

  • @nelsonjma
    @nelsonjma 6 лет назад +1

    Subscribed, many thanks to the information and how you present it.

  • @vzinko
    @vzinko Год назад

    How can a non-parametric LOESS regression be used for extrapolation?

    • @statquest
      @statquest  Год назад

      Presumably once you have the curve you can use it to make predictions.

  • @nievsbest
    @nievsbest 3 года назад +1

    Mindblowing.

  • @glaswasser
    @glaswasser 4 года назад +1

    I'm German so I always call it "Löss" :P

  • @razzlfraz
    @razzlfraz 4 года назад

    This is why I love R. It has all sorts of fun functions like this.
    For anyone who is playing with timeseries data, eg sensor data, lowess/loess are smoothing functions and are great for preprocessing and cleaning data. To find out more checkout: en.wikipedia.org/wiki/Smoothing

  • @alvaromorales6828
    @alvaromorales6828 4 года назад +1

    Bam!!!

  • @Ratchet2022
    @Ratchet2022 5 лет назад +1

    Thumbs up just for the intro.

  • @yazadjabbarc
    @yazadjabbarc 6 лет назад

    Hello, thats so nice of you to teach us the Lowess fitting, I have a specific parameter which needs to be fitted. Yet i need to change the weighing relationship, can you help with some explanation or some material to study for it. Thankyou.

  • @anzar420316
    @anzar420316 7 лет назад +1

    you are a champion. Great video

  • @paulinefaber997
    @paulinefaber997 3 года назад +1

    Maith an buchaill, StatQuest.

  • @MarioBlancoVilchez
    @MarioBlancoVilchez 3 месяца назад

    What is going on with closed captions in the first minute of the video haha

    • @statquest
      @statquest  3 месяца назад

      I think you can turn them off.

  • @thatipelli1
    @thatipelli1 5 лет назад +1

    Thanks a lot for the succinct explanation!!

  • @ananyajoshi2594
    @ananyajoshi2594 2 года назад

    So, you obtained the new-new points based on the distance of the y axis between the new points and old points? is that so?

    • @statquest
      @statquest  2 года назад

      What time point, minutes and seconds, are you asking about?

  • @ranieri2700
    @ranieri2700 3 года назад +1

    The best theme song so far

  • @Doctorpopets
    @Doctorpopets 3 года назад

    So, are these regressions used for better trend visualization only, or there are any other reasons?

    • @statquest
      @statquest  3 года назад

      You could use them to make predictions with future data. That's essentially what a neural network does (however, it uses a different method to fit lines to the data).

  • @WalkwithSid
    @WalkwithSid 6 лет назад +1

    Saved my Time !! Thank you very much

  • @winniewu8581
    @winniewu8581 5 лет назад

    what will be a normal window size?default? or do we look at other characteristic to determine? what is the relationship between window size and fit?

  • @TwoandaHater
    @TwoandaHater 4 года назад +1

    I was always told it was pronounced "Low-Ess"

  • @navaneethansanthanam7970
    @navaneethansanthanam7970 3 года назад

    Hi Josh, thanks for the video. Does LOWESS allow us to use set of external values to help with smoothing? Let's say I want to smooth some time-series data for one individual in a population. I'd like to do this while keeping in mind the overall population - so, when I smooth this individual, I'm doing it "along with" the population's mean time-series. Is something like this possible with LOWESS? Could I use the population's mean as a some kind of weight?

    • @statquest
      @statquest  3 года назад

      That's a good and interesting question. Unfortunately I don't know the answer to it.

  • @cyrilbaudrillart9690
    @cyrilbaudrillart9690 4 года назад

    I am becoming a big StatQuest fan! Congrat for this great video. Just one question... According to what I understand the last points can be misleading because as we get more data, they will change. First we calculate last value of the curve, let's say corresponding to last point X(10), from points on the left, so X(5) to X(10). But as we get new points, let's say X(11), X(12), the value of the curve corresponding to X(10) will change because we now use points X(8) to X(12) in calculation. Am I correct? I hope this is clear... Thanks

    • @statquest
      @statquest  4 года назад +1

      Yes, as you add more data, the curve will change.

  • @razzlfraz
    @razzlfraz 4 года назад

    Hey Josh great video! Any idea why loess (locally estimated scatterplot smoothing) and lowess (locally weighted scatterplot smoothing), are called a local regression ( en.wikipedia.org/wiki/Local_regression ) instead of a local autoregression?

  • @콘충이
    @콘충이 4 года назад +1

    Thank you so much!

  • @sau002
    @sau002 4 года назад +1

    Great explanation

  • @prithabhattacharya8629
    @prithabhattacharya8629 4 года назад +2

  • @sachinrana7554
    @sachinrana7554 6 месяцев назад

    This lecture was little confusing, how did you make new parabola adding new weight?

    • @statquest
      @statquest  6 месяцев назад

      What time point, minutes and seconds, are you asking about?

    • @sachinrana7554
      @sachinrana7554 6 месяцев назад

      @@statquest from 5:53 sec to 7:00, the question was how did you make that parabola a smooth parabola?

    • @statquest
      @statquest  6 месяцев назад

      @@sachinrana7554 Presumably you are asking for the formula that takes into account the weights, since I've already provided you with the intuition for what that formula does. Here's the formula: en.wikipedia.org/wiki/Local_regression

  • @liamhoward2208
    @liamhoward2208 2 года назад

    Hey Josh,
    Is Lowess and Loess the same thing as splines? If not and if you are taking suggestions, I think some content on interpolation or cubic and polynomial splines would be great!

    • @statquest
      @statquest  2 года назад +2

      I believe they are different from splines, and I'll keep those topics in mind.

  • @jingying6247
    @jingying6247 6 лет назад +1

    Crystal clear!! Thank you so much!

  • @aldoraine7848
    @aldoraine7848 2 года назад

    How big should n be for this method?

    • @statquest
      @statquest  2 года назад

      That depends on your data.

  • @elrishiilustrado9592
    @elrishiilustrado9592 3 года назад

    Very well explained as always! Thanks! but i have a little question: when should we use this method? it looks like it overfits the data.

    • @statquest
      @statquest  3 года назад +1

      It can be useful when your data has some unknown shape and you want to find the "top" or "bottom" of the shape, rather than just the maximum or minimum values.

  • @2und2sind4
    @2und2sind4 4 года назад +1

    Thank you!

  • @iwtwb8
    @iwtwb8 7 лет назад

    Rafael Irizarry pronounces it the same way in his videos: "low-ess"

  • @manuelenriquelunaalegria274
    @manuelenriquelunaalegria274 4 года назад +1

    Graciasss

  • @bu8291
    @bu8291 7 лет назад

    Your videos are amazing! I can finally understand statistics :)

  • @ramenmachinegun
    @ramenmachinegun 6 лет назад +1

    You just earned a sub! ☺

    • @statquest
      @statquest  6 лет назад

      Thank you!!!! I really appreciate it! :)

  • @sau002
    @sau002 2 года назад

    Is Loess susceptible to outliers?

    • @statquest
      @statquest  2 года назад

      It depends on how wide the widow is.

  • @bibiworm
    @bibiworm 3 года назад

    I have a probably way too broad question here. I am reading ESL these days. And local linear regression and cubic smoothing spline are throwing around everywhere in the book. But I can't seem to have a good grasp of their relations and differences. What about them vs. neural network? Essentially, all of them are function approximators. Thank you very much!

    • @statquest
      @statquest  3 года назад

      Yes, they are all used for approximating non-linear functions. In theory Neural Nets are more flexible and can easily approximate more complicated non-linear surfaces. But I don't know all the details.

    • @bibiworm
      @bibiworm 3 года назад +1

      @@statquest thanks!

  • @wenqianchang3471
    @wenqianchang3471 6 лет назад +1

    Thx!pretty intuitive

  • @cw9249
    @cw9249 2 года назад

    i have a question: why does the lowess line look different near the end of my data when i change where my data ends?

    • @statquest
      @statquest  2 года назад

      Probably because there are different datapoints influencing it.

    • @cw9249
      @cw9249 2 года назад

      @@statquest thanks. is there anything that attempts to produce similar results, but only uses data points from the past at each step of the calculation?

    • @statquest
      @statquest  2 года назад

      @@cw9249 Not that I know of, but I'm no expert in this area....

  • @dinajankovic7556
    @dinajankovic7556 6 лет назад

    Fantastic video! thanks a lot.

  • @aragaorenan
    @aragaorenan 7 лет назад

    Thank you for this!! :)

  • @apoorvshrivastava3544
    @apoorvshrivastava3544 5 лет назад

    what is the meaning of weight here ?

    • @2und2sind4
      @2und2sind4 4 года назад

      A weight describes how much a certain factor is concidered in relation to the others. "Importance" is another way to put it.

  • @SteveSolun
    @SteveSolun 6 лет назад

    Thank you for the great explanation of the LOWESS!
    Please explain the last iteration, after I have found the first new points you say that I have new weights, can you please explain in depth how do I use them for the next set of points?

    • @SteveSolun
      @SteveSolun 6 лет назад

      Thanks a lot for you deep explanation.
      I am learning Data Science and wonder if you are familiar with good statistics courses that will also show me why Normal Distribution has such formula, kernels and other topics like CI's and all I need for ML. Please advise.

    • @SteveSolun
      @SteveSolun 6 лет назад

      Would you be so kind to add boosting algorithms like xgboost? Your explanations are super simple and I would like to get an explanation from you how to use these algorithms.

  • @josuevervideos
    @josuevervideos 5 лет назад

    Excellent!!!

  • @govamurali2309
    @govamurali2309 4 года назад

    Please do hypothesis testing.

    • @statquest
      @statquest  4 года назад +1

      That is coming out in March.

    • @govamurali2309
      @govamurali2309 4 года назад +1

      @@statquest Thanks,I think only hypothesis testing and poisson distribution was not included besides that everything is included.

  • @lilyha2470
    @lilyha2470 4 года назад

    Hello Josh, yes StatQuest is cool but do you have anything about weighted least squares?

    • @statquest
      @statquest  4 года назад

      Unfortunately I do not. :(

    • @lilyha2470
      @lilyha2470 4 года назад +1

      @@statquest please please make one, lol

    • @statquest
      @statquest  4 года назад

      @@lilyha2470 :)

    • @lilyha2470
      @lilyha2470 4 года назад +1

      @@statquest well, when I listen to your videos and go to the class I am way ahead of everyone even the teacher, hahahha

    • @statquest
      @statquest  4 года назад

      @@lilyha2470 That is totally awesome!!! :)

  • @alexander191297
    @alexander191297 2 года назад

    Lois!

    • @statquest
      @statquest  2 года назад

      YES!

    • @alexander191297
      @alexander191297 2 года назад +1

      @@statquest That’s how my marketing statistics instructor used to pronounce it, and that’s how we still pronounce it at the agency where I’m currently working as an analyst! 😁

  • @qiyongchung6954
    @qiyongchung6954 7 месяцев назад +1

    I'm a masters student and this is helping me a lot with understanding the idea of LOESS. Thank you!

    • @statquest
      @statquest  7 месяцев назад

      Happy to help!