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 11:30:13 -0500



On Mon, Dec 16, 2019 at 10:14 AM oxy via Help list for GNU Octave <address@hidden> wrote:
Hey guys,

reading polyfit's help i wander how to calculate r-squared
(coefficient of determination).
Could u pls exemplify in a simple linear fit?

Thx!




x=[  1 2 3];
y=[2 3 5];
q=polyfit(x,y,1)
R=corr(x,y)
r2=R^2

this agrees  with a sample on
https://www.google.com/search?q=(coefficient+of+determination&sxsrf=ACYBGNTlrfVSuV8vceA33mRHHl5mWWP4rw:1576512412534&tbm=isch&source=iu&ictx=1&fir=FTenz8gsrCLX9M%253A%252CHIaPqXzMgUFvoM%252C%252Fm%252F0568ph&vet=1&usg=AI4_-kTls3bKMIvh5fG2ILFplwOW5k63HA&sa=X&ved=2ahUKEwjS39SyxrrmAhUNRqwKHaBrD7YQ_B0wGnoECAcQAw#imgrc=ltKALhNUU6ZXDM:&vet=1



--
DASCertificate for 206392


reply via email to

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