SecreC 2 language  2.8.0 (2023.09)
Language and standard library reference
Functions
weightedLinearRegression

Functions

template<domain D :shared3p >
D float32 weightedLinearRegression (D float32[[2]] variables, D float32[[1]] dependent, D float32[[1]] weights)
 
template<domain D :shared3p >
D float64 weightedLinearRegression (D float64[[2]] variables, D float64[[1]] dependent, D float64[[1]] weights)
 

Detailed Description

Fitting of linear models with observation weights.

Note
D - shared3p protection domain
Supported types - float32 / float64
Parameters
variables- independent variable samples as column vectors
dependent- dependent variable sample
weights- observation weight vector
Returns
returns coefficient vector. The last element is the intercept.
Leakage
None

Function Documentation

◆ weightedLinearRegression() [1/2]

D float32 weightedLinearRegression ( D float32[[2]]  variables,
D float32[[1]]  dependent,
D float32[[1]]  weights 
)

◆ weightedLinearRegression() [2/2]

D float64 weightedLinearRegression ( D float64[[2]]  variables,
D float64[[1]]  dependent,
D float64[[1]]  weights 
)