Method: Statsample::Regression::Multiple::AlglibEngine#matrix_resolution
- Defined in:
- lib/statsample/regression/multiple/alglibengine.rb
#matrix_resolution ⇒ Object
Coefficients using a constant Based on www.xycoon.com/ols1.htm
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/statsample/regression/multiple/alglibengine.rb', line 57 def matrix_resolution mse_p=mse columns=@dep_columns.dup.map {|xi| xi.map{|i| i.to_f}} columns.unshift([1.0]*@ds.cases) y=Matrix.columns([@dy.data.map {|i| i.to_f}]) x=Matrix.columns(columns) xt=x.t matrix=((xt*x)).inverse*xt matrix*y end |