How do I print/save parameters from fitnlm?

3 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Support Vector Machine Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by