Method: Statsample::Regression::Multiple::GslEngine#matrix_resolution
- Defined in:
- lib/statsample/regression/multiple/gslengine.rb
permalink #matrix_resolution ⇒ Object
Coefficients using a constant Based on www.xycoon.com/ols1.htm
69 70 71 72 73 74 75 76 77 |
# File 'lib/statsample/regression/multiple/gslengine.rb', line 69 def matrix_resolution 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 |