Sha256: 1e6160e4d9d0b055301a5e547686fd747d85d94ee09441c2a4728b8522276fbe

Contents?: true

Size: 425 Bytes

Versions: 1

Compression:

Stored size: 425 Bytes

Contents

require 'glm/base'

class GLM::Linear < GLM::Base
  

  def hi
    return "Hi, this is #{self.class}"
  end


  # Canonical response function
  # It's identity function here, obviously
  def self.g(eta)
    return eta
  end
  
  #Normal equation estimation
  def ne_est(x)
    @theta = ne_fit
    [@theta, x * @theta]
  end

  #Normal equation fit
  def ne_fit
    ( @x.transpose * @x ).invert * @x.transpose * @y
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glm-0.0.2 lib/glm/linear.rb