help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coefficient of determination (R^2) on polyfit


From: Doug Stewart
Subject: Re: coefficient of determination (R^2) on polyfit
Date: Mon, 16 Dec 2019 20:13:33 -0500



On Mon, Dec 16, 2019 at 3:23 PM Nir Krakauer <address@hidden> wrote:
or corr(q, y) to find the correlation between the fitted and original values.
@nir to do that you need:

x=[1 2 3];
y=[2 3 5];
[q s]=polyfit(x,y,1);
R=corr(x,y)
r2=R^2
yy=s.yf
RR=corr(y,yy)
plot(x,y,x,yy)

and RR is equal to R
  --
DASCertificate for 206392


reply via email to

[Prev in Thread] Current Thread [Next in Thread]