How do I print/save parameters from fitnlm?

조회 수: 4 (최근 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 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