-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinearfit.m
32 lines (29 loc) · 999 Bytes
/
linearfit.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
S =[
3 2 2 4
6 8 5 12
12 26 20 38
24 85 70 109
48 236 206 288
96 615 552 719
192 1514 1388 1726
384 3605 3350 4029
768 8360 7850 9212
1536 19027 18004 20731
3072 42662 40616 46074
6144 94545 90450 101369
12288 207524 199334 221176
24576 451919 435536 479223
49152 977570 944804 1032182
98304 2102605 2037070 2211829
196608 4500128 4369058 4718580
393216 9590091 9327948 10026995
786432 20359838 19835552 21233650
];
X = zeros(length(S),2);
X(:,2) = S(:,1);
X(:,1) = S(:,1).* log2(S(:,1));
for i = 2:4
y = S(:,i);
A3B3 = inv(X'*X)*X'*y;
display(A3B3);
end