mir-algorithm ~master (2021-09-24T13:11:04Z)
Dub
Repo
simpleLinearRegression.simpleLinearRegression
mir
math
stat
simpleLinearRegression
sumType
!
YRange
[
2
]
simpleLinearRegression
(XRange x, YRange y)
template
simpleLinearRegression
(Summation summation = Summation.kbn)
@
safe
@
fmamath
sumType
!
YRange
[2]
simpleLinearRegression
(
XRange
YRange
)
(
XRange
x
,
YRange
y
)
if
(
isInputRange
!
XRange
&&
isInputRange
!
YRange
&&
!
(
isArray
!
XRange
&&
isArray
!
YRange
)
&&
isFloatingPoint
!(
sumType
!
YRange
)
)
sumType
!(
Y
[])[
2
]
simpleLinearRegression
(X[] x, Y[] y)
template
simpleLinearRegression
(string summation)
Parameters
x
XRange
x[i]
points
y
YRange
f(x[i])
values
Return Value
Type:
sumType
!
YRange
[2]
The pair of shift and slope of the linear curve.
Meta
Source
See Implementation
mir
math
stat
simpleLinearRegression
functions
simpleLinearRegression