Class: Num4GLMRegAnaLib::PoissonRegAnaLib

Inherits:
Object
  • Object
show all
Defined in:
lib/num4glmregana.rb

Overview

ポアソン回帰分析

Instance Method Summary collapse

Constructor Details

#initializePoissonRegAnaLib

Returns a new instance of PoissonRegAnaLib.



64
65
66
# File 'lib/num4glmregana.rb', line 64

def initialize
    @multana = PoissonRegAna.getInstance()
end

Instance Method Details

#non_line_reg_ana(yi, xij) ⇒ Hash

ポアソン回帰分析

Examples:

glsyi = [4, 10, 7, 14]
glsxij = [
    [1],
    [2],
    [3],
    [4],
]
regana = Num4RegAnaLib::PoissonRegAnaLib.new
regana.non_line_reg_ana(glsyi, glsxij)
=> 
  {
     "intercept":  1.3138,    # 定数項
     "slope":      [0.3173],  # 回帰係数
  }

Returns (intercept:定数項 slope:回帰係数).

Parameters:

Returns:

  • (Hash)

    (intercept:定数項 slope:回帰係数)



88
89
90
91
92
93
94
95
# File 'lib/num4glmregana.rb', line 88

def non_line_reg_ana(yi, xij)
    multRet = @multana.nonLineRegAna(yi.to_java(Java::double), xij.to_java(Java::double[]))
    retRb = {
        "intercept":  multRet.getIntercept(), # 定数項
        "slope":      multRet.getSlope().to_a,     # 回帰係数
    }
    return retRb
end