How to plot polynomial by using Data points??

2 次查看(过去 30 天)
I have 2 different time series, among them I want to plot polynomial. How can i get the polynomial plot for these time series, (especially the R-square values)??
Also i want to find out that the relation between both tme series is signigicant or not? How to check it?
Data set is attached in excel file.

回答(1 个)

Walter Roberson
Walter Roberson 2023-5-19
If the idea is that the points are a uniform distance apart, such as at x = 3, x = 5, x = 7, and so on, each position implied by some known starting point (perhaps 1) and some known increment per-row (such as 1); and that the rows give the corresponding y values...
then in that situation there is no meaningful polynomial fit for either of the variables.
The highest R-squared for the first time series, tested up to degree 9, is about 0.4. The highest R-squared for the second time series, tested up to degree 9, is about 0.54. This R-squared numbers already take into account centering and scaling (which would compensate for the fact that we do not know the distance between points, as long as the distance is uniform.)
There is no point testing beyond degree 9: polynomial fit rapidly becomes too inaccurate numerically beyond degree 7 or so.
If you plot the two columns independently you can see that the correlation between them is terrible.

类别

Help CenterFile Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by