how to use cfit to get fitobject and gof from a separately provided line
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi all,
I have a basic general question:
I am using [fitobject,gof]=fit(x,y,'poly1') to fit line segments.
I want to provide my own fit coefficients and get the same type of output about the goodness of fit.
How can I generate fitobject and gof using my independently provided fit coefficients, so that they will be in the same structure format as those generated by the 'fit' function?
thanks,
Rory
댓글 수: 0
답변 (1개)
Richard Willey
2011년 4월 29일
The aren't any constructor options for the Fit Objects in Curve Fitting Toolbox.
The easiest way to accomplish your goal is to set upper and lower bounds for your coefficients that will constraint them to a precise value. For example, suppose that you wanted to force the regression coefficients to be "3" and "8"
X = 1:100
X = X'
Y = 5 + 10*X + randn(100,1)
[foo GoF] = fit(X,Y, 'poly1', 'Lower',[3 8], 'Upper',[3 8])
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!