- “lsqcurvefit”: https://www.mathworks.com/help/optim/ug/lsqcurvefit.html
- “fitlm”: https://www.mathworks.com/help/stats/fitlm.html
- “polyfit”: https://www.mathworks.com/help/matlab/ref/polyfit.html
- “datetime”: https://www.mathworks.com/help/matlab/ref/datetime.html?s_tid=doc_ta
- Logical indexing: https://www.mathworks.com/help/matlab/math/array-indexing.html#:~:text=col%20%3D%202-,Indexing%20with%20Logical%20Values,-Using%20true%20and
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)
0 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!