[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Linear Regression
From: |
Marco Atzeri |
Subject: |
Re: Linear Regression |
Date: |
Sat, 8 Dec 2018 12:26:41 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 |
Am 08.12.2018 um 10:14 schrieb LucaLuca:
hi,
i don't understand
if i want to get this line :
https://gyazo.com/942676a11228bc3c610419faa0867bc7
how can i do it? :(
Luca,
I understand that learning a new language is difficult, but it seems
you need to follow some tutorial for the basis.
Almost all your questions are very elementary.
polyfit provides the coefficients of N grade polinomial
that fit the data.
For grade 1 the polinomial is m*x+c so
yi =polyfit(b',a',1)
yi =
-0.90000 5.94444
where yi(1) is "m" and yi(2) is "c"
and the Y of the given line for the same x data will be
y=b*yi(1)+yi(2)
y =
Columns 1 through 8:
5.04444 4.14444 3.24444 2.34444 1.44444 0.54444 -0.35556
-1.25556
Column 9:
-2.15556
and you can plot the data and the line together with
plot(b,a,b,y)
I hope that this is enough to clarify you the matter
Regards
Marco
---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus
Re: Linear Regression, Marco Atzeri, 2018/12/07