cfit extract normalization mean and std

24 ビュー (過去 30 日間)
Tony Tse
Tony Tse 2018 年 1 月 31 日
回答済み: Tobias Held 2022 年 1 月 5 日
Hello,
I am fitting a rational function to some data, in my case x varies over many orders of magnitude, so I used to 'Normalize' option when fitting. There is a normalization mean and std to the x, how do I extract that? There isn't a public method to cfit for this as far as I know.
I have attached the fit function in question. The values I am interest in are:
where x is normalized by mean 6.21e+05 and std 1.65e+06

採用された回答

Maeri
Maeri 2019 年 5 月 6 日
In the cfit source code, the mean and std are private variables, and there exists no access function as for coeffvalues.
Thus I don't think there is a way to access mean and std. A work around is just taking mean and std of your xdata input.

その他の回答 (1 件)

Tobias Held
Tobias Held 2022 年 1 月 5 日
I would like to share my code for the answer from @Maeri, thank you I was looking for this!
Add this to your Fit function.
[fitresult,norm, gof] = createFitNom(xData, yData)
[...]
% Save Normalize values
[x,mean,std] = normalize(xData);
norm.mean = mean;
norm.std = std;
[...]
end
I am not yet sure if a struct is a good data type for this, but the idea should be clear now.

カテゴリ

Help Center および File ExchangeCurve Fitting Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by