필터 지우기
필터 지우기

Fitting non linear function, R^2 and p value

조회 수: 5 (최근 30일)
Cristina
Cristina 2017년 4월 8일
댓글: Cristina 2017년 4월 8일
Hi
I am new to this kind of task so pardon me if my question is basic. I am trying to fit parameters for non-linear known functions, and I have understood how to do so using, for example, fmincon or fminspleas. I also need the R^2 and p values that indicate how good my model fit is. As far as I understand, the R^2 value should increase as the fit improves. Also, while I noticed some functions return the parameter range for 95% confidence interval, I notice people refer to the goodness of a model reporting a single p value.
How do I obtain R^2 and p value for my parameter fit? I am also open to use a different parameter fitting function, if that would return p and r^2 values. Thanks

답변 (1개)

John D'Errico
John D'Errico 2017년 4월 8일
You don't say what is your model, and that can be important. Note that R^2 has significant problems when no constant term is in the model. There are adjusted R^2 measures if you lack a constant term. They are not that difficult to generate.
Yes. It is true that as R^2 increases, the model generally improves. But something I would never recommend is to decide that your model is a good one just because R^2 is ANY given number. Never rely on a number to make the decision for you here.
Plot the model. Plot the data. Plot the residuals. LOOK at them. Is there significant lack of fit? Are you happy with the result? If so, then don't bother even looking at R^2. If you are not happy with the result, then consider a different model.
Computing p-values for the parameters is something that can be done, but you will need to compute the Jacobian matrix at the optimum. That can be done for fminspleas too, but you will need to do the differentiation of the terms. Given the Jacobian, a Google search will give you the formula for the p-values. As I recall, you will need the residuals of the model at the optimum, then computing a standard error.
If you are talking about an overall p-value for the model, then I'm not sure what you are thinking.
  댓글 수: 1
Cristina
Cristina 2017년 4월 8일
Fitting logistic and hyperbolic functions. Some papers I read about the topic, they state the R^2 value for their logistic models and for their hyperbolic models. You mention there are adjusted R^2 measures. Are these always calculated in the same manner given a function (eg hyperbolic...)? Ie, would my calculation of the R^2 value match that I read about in these papers?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by