Sha256: c496637414bd34a1a521841fc0ba4c866f5a287b2ac8084a2591aeacb7a232e8

Contents?: true

Size: 415 Bytes

Versions: 2

Compression:

Stored size: 415 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

  def ne_est(x)
    @theta = ne_fit
    [@theta, x * Matrix.column_vector(@theta)]
  end

  #Normal equation fit
  def ne_fit
    (( @x.t * @x ).inverse * @x.t * @y).to_a.flatten
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
glm-0.0.1 lib/glm/linear.rb
glm-0.0.0 lib/glm/linear.rb