Class: Num4RegAnaLib::OLSMultRegAnaLib
- Inherits:
-
Object
- Object
- Num4RegAnaLib::OLSMultRegAnaLib
- Defined in:
- lib/num4regana.rb
Overview
重回帰分析(最小2乗法:等分散性checkあり)
Instance Method Summary collapse
-
#getadjr2(yi, xij) ⇒ double
自由度調整済み決定係数.
-
#getr2(yi, xij) ⇒ double
決定係数.
-
#initialize ⇒ OLSMultRegAnaLib
constructor
A new instance of OLSMultRegAnaLib.
-
#line_reg_ana(yi, xij) ⇒ Hash
重回帰分析.
Constructor Details
#initialize ⇒ OLSMultRegAnaLib
Returns a new instance of OLSMultRegAnaLib.
72 73 74 |
# File 'lib/num4regana.rb', line 72 def initialize @multana = MultRegAna.getInstance() end |
Instance Method Details
#getadjr2(yi, xij) ⇒ double
自由度調整済み決定係数
160 161 162 |
# File 'lib/num4regana.rb', line 160 def getadjr2(yi, xij) return @multana.getAdjR2(yi.to_java(Java::double), xij.to_java(Java::double[])) end |
#getr2(yi, xij) ⇒ double
決定係数
134 135 136 |
# File 'lib/num4regana.rb', line 134 def getr2(yi, xij) return @multana.getR2(yi.to_java(Java::double), xij.to_java(Java::double[])) end |
#line_reg_ana(yi, xij) ⇒ Hash
重回帰分析
102 103 104 105 106 107 108 109 110 |
# File 'lib/num4regana.rb', line 102 def line_reg_ana(yi, xij) multRet = @multana.lineRegAna(yi.to_java(Java::double), xij.to_java(Java::double[])) retRb = { "intercept": multRet.getIntercept(), # 定数項 "slope": multRet.getSlope().to_a, # 回帰係数 } return retRb end |