Class: Num4RegAnaLib::SmplRegAnaLib
- Inherits:
-
Object
- Object
- Num4RegAnaLib::SmplRegAnaLib
- Defined in:
- lib/num4regana.rb
Overview
単回帰分析
Instance Method Summary collapse
-
#getr(yi, xi) ⇒ double
相関係数.
-
#getr2(yi, xi) ⇒ double
決定係数.
-
#initialize ⇒ SmplRegAnaLib
constructor
A new instance of SmplRegAnaLib.
-
#line_reg_ana(yi, xi) ⇒ Hash
単回帰分析.
Constructor Details
#initialize ⇒ SmplRegAnaLib
Returns a new instance of SmplRegAnaLib.
12 13 14 |
# File 'lib/num4regana.rb', line 12 def initialize @regana = SmplRegAna.getInstance() end |
Instance Method Details
#getr(yi, xi) ⇒ double
相関係数
66 67 68 |
# File 'lib/num4regana.rb', line 66 def getr(yi, xi) return @regana.getR(yi.to_java(Java::double), xi.to_java(Java::double)) end |
#getr2(yi, xi) ⇒ double
決定係数
51 52 53 |
# File 'lib/num4regana.rb', line 51 def getr2(yi, xi) return @regana.getR2(yi.to_java(Java::double), xi.to_java(Java::double)) end |
#line_reg_ana(yi, xi) ⇒ Hash
単回帰分析
31 32 33 34 35 36 37 38 |
# File 'lib/num4regana.rb', line 31 def line_reg_ana(yi, xi) ret = @regana.lineRegAna(yi.to_java(Java::double), xi.to_java(Java::double)) retRb = { "intercept": ret.getIntercept(), # 定数項 "slope": ret.getSlope(), # 回帰係数 } return retRb end |