Class: Fathom::DataNode

Inherits:
Node
  • Object
show all
Includes:
NumericMethods
Defined in:
lib/fathom/node/data_node.rb

Overview

A DataNode is a node generated from data itself. It stores the data and reveals some statistical

measurements for the data.  It expects an array or vector of values and generates a vector on demans.

Instance Attribute Summary

Attributes inherited from Node

#description, #distribution, #name, #values

Instance Method Summary collapse

Methods included from NumericMethods

#coefficient_of_variation, #interval_values, #inverse_cdf, #mean, #rand, #standard_deviation, #summary, #upper_bound, #vector

Methods inherited from Node

#add_child, #add_parent, #children, #inspect, #name_sym, #parents, #register_child, #register_parent, #simple_inspect

Constructor Details

#initialize(opts = {}) ⇒ DataNode

Returns a new instance of DataNode.

Raises:

  • (ArgumentError)


11
12
13
14
# File 'lib/fathom/node/data_node.rb', line 11

def initialize(opts={})
  super(opts)
  raise ArgumentError, "Must provided values: DataNode.new(:values => [...])" unless self.values
end