Predicting Weather Temperatures Using Sinusoidal Least-Squares Fit

4 次查看(过去 30 天)
Hey Guys,
I'm in over my head in a coding class and I really need some direction with this problem. Basically I have weather temperature data from now, all the way back to 2013, taken everyday so each year is a [365x1] column vector (except for 2018 which is an [87x1]). I need to use a sinusoidal least-squares fit approach to predict weather 1, 3, and 5 years in the future. From my understanding of sinusoidal least-squares fit and Fourier analysis, I need to overlay a function over the real world data to create a model to predict weather. Again, I have a very limited understanding of this so please correct me if my thinking is incorrect. The function given in the problem that best represents the data is the picture I have included below. I have never inserted an equation this complicated into matlab before. So I need to run the temperature data through this function and use that to predict future weather temperatures, correct? If someone could help me out with this or provide a link to a generic code that would help me that would be great because I haven't made any progress at this point. Thanks in advance.

回答(1 个)

Chad Greene
Chad Greene 2018-7-21
I wrote some functions including one called sinefit to do this for climate data. The three-parameter fit is as easy as
ft = sinefit(t,y)
where t is time, y is your temperature data, and ft contains the amplitude, day of maximum temperature, and mean value.

类别

Help CenterFile Exchange 中查找有关 Weather and Atmospheric Science 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by