How do I print/save parameters from fitnlm?

2 ビュー (過去 30 日間)
Anjodenunca
Anjodenunca 2015 年 8 月 18 日
編集済み: Anjodenunca 2015 年 8 月 18 日
Hello, my main objective is to run several excel arrays through a gaussian function and I would like to export certain information including the values from the fitnlm parameters because these correspond to things like peak phase shift and amplitude.
Ideally, each of these arrays will generate a plot of the fit vs. the actual data. It would be awesome to print each of these to an excel sheet with the parameter data I'm after. Is there any way to do those things? Thanks!

採用された回答

Walter Roberson
Walter Roberson 2015 年 8 月 18 日
The output of fitnlm is a nonlinear model object. See http://www.mathworks.com/help/stats/nonlinearmodel-class.html
"To obtain any of these columns as a vector, index into the property using dot notation. For example, in mdl the estimated coefficient vector is
beta = mdl.Coefficients.Estimate "
  1 件のコメント
Anjodenunca
Anjodenunca 2015 年 8 月 18 日
編集済み: Anjodenunca 2015 年 8 月 18 日
Okay I think I understand what you're saying. I apologize, I'm pretty inexperienced with matlab. So if I wanted to assign p(1) to a function from the following model g:
Nonlinear regression model:
y ~ p1*exp(( - 1*(nm - p2)^2)/((2*p3^2)))
Estimated Coefficients:
Estimate SE tStat pValue
__________ _______ ______ ___________
p1 5.1879e+05 5667.1 91.544 5.2609e-164
p2 591.95 0.44573 1328 0
p3 35.363 0.44828 78.887 1.4976e-151
I would use something like beta = g.Coefficients.Estimate which gives beta =
1.0e+05 *
5.1879
0.0059
0.0004
But I don't really know how to store these numbers as functions, and it seems as though they've been rounded a bit..
Update: Nm I totally got it, beta(1), beta(2), beta(3).
Thanks much for your help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSupport Vector Machine Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by