Hello Gud afternoon. I have a data file and I want to do polynomial (4-5 degree) fit and need regression coefficients to be calculated, can you please help me in this.
Ma'am I didn't find your video on sine and cosine fit about which you are talking in this video. Also can you please explain about p-value, chi square value and R-value, residue analysis which we normally talk about when we do curve fitting. Please reply. Also is there any video on Lorentzian or Gaussian fit.
Thank you for your message! I don't have a video on sinusoidal fit. It is quite straight forward. The things you are asking are more about statistical analysis and little bit more advanced. We will deal with them at some point in the future.
Hi! great video and was very easy to learn. In case you have to find the polynomial coefficients where they are given as a, b and c then how would you do that? Can we define the values of a,b and c to fall under the certain limits say within -infinity to +infinity or say some random integer?, plug them into the step where the quadratic equation is required and then go ahead??
What is the numbers in the coefficients with all that "e"? I am assuming it is a float. But could you explain how that would be interpreted as normal number if we want to give the explicit equation for the polynom? Thank you btw, really nice, easy to grasp video.
Thank you! Can you let me know the time in the video where the coefficient in your question comes? I will try to answer your doubt. This way I don't have to look up all the video.
@@JishaandAlessandrosworld Thanks for the reply. I meant the coefficients at 6:51 for example. How do we interpret -1.6854...e-16 as a number? Or the coeffs. at 11:00 for that matter. It has been a while since I dealt with code but now I am trying to understand some data. It is probably a simple silly question. :D
consider i have a data set and I say the first feature(Hours) is for X and the next Feature(test_result) is y. Now i use np.plyplot(x,y,1) i get some values, my question is how to decide the value is to be 1 or 2 or what. Secondly what do these values say, Because when you change the degree in plyplot output values also change.
Thank you for your question. However, what is "np.plyplot"?. I am not familiar with such a function. If you are talking about the function polyfit discussed in the video, then the 1 or 2 corresponds to the degree of the polynomial you are trying to fit. This has been discussed in detail in the video together with how you choose the degree for fitting.
@@JishaandAlessandrosworld My apologies, it had to be np.polyfit, question is how to decide the order of polynomial is, I still could not get it, supposing the data i have is csv file.
Usually you have a theoretical model and you will want to fit the data to that. Most of the time you more or less know how your data might behave and then you check it by fitting it to polynomial or exponential or whatever function. If you think it is a polynomial function, you can try an arbitrary degree and check the values of the coefficients returned. Depending on how many coefficients are returned you can say that it is a linear, quadratic, third degree and so on and so forth. The last part of the video explains that, where we have a data which is linear and we tried to fit it with quadratic. The second order terms are negligible in this case.
You can fit almost any data to any function. To know what is the 'correct' one however can be difficult particularly if you don't know what the relationship should be. Furthermore fitting data to an extremely high order polynomial for example can result in poor conditioning (you need more data points to make the fit). You can look at the sum of squares error between the fit and your data and additionally you can put boundaries on the initial guesses that the fit makes to estimate your parameters. These boundary conditions can be set based on common sense and often the initial values for guessing are the most important for an accurate fit (think of needle in a haystack)
Thank you! If you have some specific question about the video may be you could ask here and could be helpful to others as well. However, you can write to us at cpjisha.personal@gmail.com
Very nice video, thanks a lot!
I am glad that it was helpful.
Thank you so much for explaining in simple words
I am glad that you found it useful!
Thanks for the great video, Jisha!
Thank you Mike. I am glad you liked the video.
thank for your video! I'm having a course about python.. very helpful!
Thank you for your nice words 😊
thnx for this very insightful view , learned a lot .
Thank you for your kind words!! It motivates is to make new videos!
Amazing explanation!!
More videos please!!
It is very helpful. Thank you for sharing
Thank you for your kind words. I am glad it had been useful for you.
simple and understandable, thanks
Thank you 😊
Wow, the best explanation ! Before that I didn t understand for a long time
I am really glad that this helped 😊.
Great video, helped a lot, thank u
Thank you for your kind words!!
Great video! One question, how do I determine the uncertainty of the coefficients produced by polyfit or scipy.optimize?
Hello Gud afternoon. I have a data file and I want to do polynomial (4-5 degree) fit and need regression coefficients to be calculated, can you please help me in this.
Ma'am I didn't find your video on sine and cosine fit about which you are talking in this video. Also can you please explain about p-value, chi square value and R-value, residue analysis which we normally talk about when we do curve fitting. Please reply. Also is there any video on Lorentzian or Gaussian fit.
Thank you for your message! I don't have a video on sinusoidal fit. It is quite straight forward. The things you are asking are more about statistical analysis and little bit more advanced. We will deal with them at some point in the future.
Nice video! How about one on fitting cubic splines in Python?
Sure. I just need to get some free time. However it is really similar to do.
how can do it for multiple independent variables
It's not circle ,we cal it as ring
Hi! great video and was very easy to learn. In case you have to find the polynomial coefficients where they are given as a, b and c then how would you do that? Can we define the values of a,b and c to fall under the certain limits say within -infinity to +infinity or say some random integer?, plug them into the step where the quadratic equation is required and then go ahead??
Thank you. You can follow the same procedure for any polynomial.
I see your a victim of the 50+ tabs in Chrome, hahaha.
Haha yes 😂😂
@@JishaandAlessandrosworld I know, why bookmark when you can keep opening new tabs, then spend a few weeks going though all your tabs.
Exactly!! With bookmark you tend to forget about it. This way there is a finite chance that you will come back to it at some point of time 😁
What is the numbers in the coefficients with all that "e"? I am assuming it is a float. But could you explain how that would be interpreted as normal number if we want to give the explicit equation for the polynom?
Thank you btw, really nice, easy to grasp video.
Thank you! Can you let me know the time in the video where the coefficient in your question comes? I will try to answer your doubt. This way I don't have to look up all the video.
@@JishaandAlessandrosworld Thanks for the reply. I meant the coefficients at 6:51 for example. How do we interpret -1.6854...e-16 as a number? Or the coeffs. at 11:00 for that matter. It has been a while since I dealt with code but now I am trying to understand some data. It is probably a simple silly question. :D
:(
Those numbers are zero. It has a finite value because of the machine precision. Are you confused by the syntax e-13?
@@JishaandAlessandrosworld yeah exactly, so anything with an e is equal to zero?
4.89e, 2.11e, 7.81e etc or do they have a value?
thanku , how 1.6 ,2 and 5 came out can you explain manually in paper
consider i have a data set and I say the first feature(Hours) is for X and the next Feature(test_result) is y. Now i use np.plyplot(x,y,1) i get some values, my question is how to decide the value is to be 1 or 2 or what. Secondly what do these values say, Because when you change the degree in plyplot output values also change.
Thank you for your question. However, what is "np.plyplot"?. I am not familiar with such a function. If you are talking about the function polyfit discussed in the video, then the 1 or 2 corresponds to the degree of the polynomial you are trying to fit. This has been discussed in detail in the video together with how you choose the degree for fitting.
@@JishaandAlessandrosworld My apologies, it had to be np.polyfit, question is how to decide the order of polynomial is, I still could not get it, supposing the data i have is csv file.
Usually you have a theoretical model and you will want to fit the data to that. Most of the time you more or less know how your data might behave and then you check it by fitting it to polynomial or exponential or whatever function. If you think it is a polynomial function, you can try an arbitrary degree and check the values of the coefficients returned. Depending on how many coefficients are returned you can say that it is a linear, quadratic, third degree and so on and so forth. The last part of the video explains that, where we have a data which is linear and we tried to fit it with quadratic. The second order terms are negligible in this case.
You can fit almost any data to any function. To know what is the 'correct' one however can be difficult particularly if you don't know what the relationship should be. Furthermore fitting data to an extremely high order polynomial for example can result in poor conditioning (you need more data points to make the fit). You can look at the sum of squares error between the fit and your data and additionally you can put boundaries on the initial guesses that the fit makes to estimate your parameters. These boundary conditions can be set based on common sense and often the initial values for guessing are the most important for an accurate fit (think of needle in a haystack)
Totally agree.
Excellent tutorial!!! Please, is there a way to contact you guys via email? Thanks
Thank you! If you have some specific question about the video may be you could ask here and could be helpful to others as well. However, you can write to us at cpjisha.personal@gmail.com
Does anyone have the code?
you can find the jupyter notebook here. github.com/cpjisha/Sci-comp-python-files/blob/master/Polynomial_Fitting.ipynb
@@JishaandAlessandrosworld thank u so much!!!