Class: Stan::FitResult

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original_output) ⇒ FitResult

Returns a new instance of FitResult.



5
6
7
8
9
10
11
# File 'lib/stan/fit_result.rb', line 5

def initialize(original_output)
  @rows = Array(original_output.split("\n"))
  @headers = rows[38].to_s.split(",") # In L39 there is the header column
  @data_rows = rows[43..].map { |r| r.split(",") } # From L44 on there is the raw data!

  define_histograms!
end

Instance Attribute Details

#data_rowsObject (readonly)

Returns the value of attribute data_rows.



3
4
5
# File 'lib/stan/fit_result.rb', line 3

def data_rows
  @data_rows
end

#headersObject (readonly)

Returns the value of attribute headers.



3
4
5
# File 'lib/stan/fit_result.rb', line 3

def headers
  @headers
end

#rowsObject (readonly)

Returns the value of attribute rows.



3
4
5
# File 'lib/stan/fit_result.rb', line 3

def rows
  @rows
end

Instance Method Details

#parametersObject



13
14
15
# File 'lib/stan/fit_result.rb', line 13

def parameters
  headers[7..]
end