SecreC 2 language 2.9.0 (2026.10)
Language and standard library reference
Loading...
Searching...
No Matches
Functions
simpleLinearRegression

Functions

template<domain D :shared3p >
D float32 simpleLinearRegression (D int32 x, D int32 y, D bool filter)
 
template<domain D :shared3p >
D float64 simpleLinearRegression (D int64 x, D int64 y, D bool filter)
 
template<domain D :shared3p >
D float32 simpleLinearRegression (D float32 x, D float32 y, D bool filter)
 
template<domain D :shared3p >
D float64 simpleLinearRegression (D float64 x, D float64 y, D bool filter)
 

Detailed Description

Fitting of simple linear models.

Note
D - shared3p protection domain
Supported types - int32 / int64 / float32 / float64
Parameters
x- explanatory variable sample
y- dependent variable sample
filter- filter indicating which elements of the samples are available
Returns
returns vector {α, β} where α, β are such that y ≈ α + β · x
Leakage
Leaks the number of missing values

Function Documentation

◆ simpleLinearRegression() [1/4]

template<domain D :shared3p >
D float32 simpleLinearRegression ( D float32  x,
D float32  y,
D bool  filter 
)

◆ simpleLinearRegression() [2/4]

template<domain D :shared3p >
D float64 simpleLinearRegression ( D float64  x,
D float64  y,
D bool  filter 
)

◆ simpleLinearRegression() [3/4]

template<domain D :shared3p >
D float32 simpleLinearRegression ( D int32  x,
D int32  y,
D bool  filter 
)

◆ simpleLinearRegression() [4/4]

template<domain D :shared3p >
D float64 simpleLinearRegression ( D int64  x,
D int64  y,
D bool  filter 
)