Least square fit in Hovmöller

1 次查看(过去 30 天)
How would you do a least square fit onto hovmoller data, i.e. longitude x time. Specifically, considering only negative data
This is to measure the speed of the propagation (in variables like OLR, SST)

回答(1 个)

sai charan sampara
sai charan sampara 2023-10-10
Hello Luis,
I understand that you are trying to do least square fit onto Hovmöller Data.
For doing least square fit onto data MATLAB has the function “lsqcurvefit” which does least square fitting of x and y data onto a model function that is provided as part of input. To use “lsqcurvefit” function onto Hovmöller data first identify a mathematical function (linear, exponential or any other) that can roughly describe the behaviour of the data. Create a function handle of the function with x data and coefficients/constants of this function as the parameters. Then call the “lsqcurvefit” function with the correct inputs to get the coefficients as output.
Other functions like “fitlm”, “polyfit” can also be helpful for doing regression.
In Hovmöller data the variables include longitude, time, and the measured variable. For using regression or least square fit it is essential to first change the data into numerical format. For time values the “datetime” format can be used or other normalizations (assigning numerical value to each data point) can be done to make the data numerical. Similarly, longitude data can also be converted into numerical values. These two variables together can form the x data. For using only the negative data, logical indexing can be used on the data set to choose only the specific values.
You can refer to the below MATLAB documentations for more information:
Hope this helps.
Thanks,
Charan.

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by