Calculating R^2 for a nonlinear least squares fit

前端 未结 5 1904
别跟我提以往
别跟我提以往 2020-12-14 02:36

Suppose I have x values, y values, and expected y values f (from some nonlinear best fit curve).

How can I compute R^2 in R? N

5条回答
  •  难免孤独
    2020-12-14 03:37

    As an alternative to this problem I used at several times the following procedure:

    1. compute a fit on data with the nls function
    2. using the resulting model make predictions
    3. Trace (plot...) the data against the values predicted by the model (if the model is good, points should be near the bissectrix).
    4. Compute the R2 of the linear régression.

    Best wishes to all. Patrick.

提交回复
热议问题