lib/statsample/factor/principalaxis.rb in statsample-1.5.0 vs lib/statsample/factor/principalaxis.rb in statsample-2.0.0

- old
+ new

@@ -4,12 +4,12 @@ # # For PCA, use Statsample::Factor::PCA # # == Usage: # require 'statsample' - # a=[2.5, 0.5, 2.2, 1.9, 3.1, 2.3, 2.0, 1.0, 1.5, 1.1].to_numeric - # b=[2.4,0.7,2.9,2.2,3.0,2.7,1.6,1.1,1.6,0.9].to_numeric - # ds={'a'=>a,'b'=>b}.to_dataset + # a = Daru::Vector.new([2.5, 0.5, 2.2, 1.9, 3.1, 2.3, 2.0, 1.0, 1.5, 1.1]) + # b = Daru::Vector.new([2.4,0.7,2.9,2.2,3.0,2.7,1.6,1.1,1.6,0.9]) + # ds= Daru::DataFrame.new({:a => a,:b => b}) # cor_matrix=Statsample::Bivariate.correlation_matrix(ds) # pa=Statsample::Factor::PrincipalAxis.new(cor_matrix) # pa.iterate(1) # pa.m # => 1