1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 function regress
(DATAPOINTS
,SX
,SY
,SXY
,SX2
)
7 b1 =
(DATAPOINTS
* SXY
- SX
* SY
) / (DATAPOINTS
* SX2
- SX
* SX
);
8 b0 =
(SY
- b1
* SX
) / DATAPOINTS
;
9 return b1
" * x + " b0
;
26 #print NR " " sx " " sy " " sxy " " sx2
30 if(Count == Interval
-1)
34 print NR-Count
, "-", NR, ": ", regress
(Count
,isx
,isy
,isxy
,isx2
);
55 print NR-Count
, "-", NR, ": ", regress
(Count
,isx
,isy
,isxy
,isx2
);
57 print regress
(NR-Skip
, sx
, sy
, sxy
, sx2
);