Bugs: Browse | Submit New | Admin

[#29192] GSL::Stats::quantile_from_sorted_data

Date:
2011-05-10 02:05
Priority:
3
Submitted By:
changheng chang (felix125)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
GSL::Stats::quantile_from_sorted_data

Detailed description
[felix@ngs ~]$ irb
ruby-1.9.2-p180 :001 > require 'gsl'
 => true 
ruby-1.9.2-p180 :002 > include GSL
 => Object 
ruby-1.9.2-p180 :003 > v =  Vector.alloc([1,2,3,4,5])
 => GSL::Vector
[ 1.000e+00 2.000e+00 3.000e+00 4.000e+00 5.000e+00 ] 
ruby-1.9.2-p180 :004 > v.quantile_from_sorted_data 
TypeError: can't convert GSL::Vector to Float (GSL::Vector#to_f gives GSL::Vector)
	from (irb):4:in `stats_quantile_from_sorted_data'
	from (irb):4
	from /home/felix/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>'

--------------

could anyone give me a hint?
thanks a lot.


Add A Comment: Notepad

Please login


Followup

Message
Date: 2011-05-10 03:49
Sender: Yoshiki Tsunesada

This is not a bug. An argument of [0-1] value is not given in
your script.

This method returns a quantile of the vector of a given [0-1]
value. For example,
in a case of your vector, v.quantile_from_sorted_data(0.2) gives
1.8, which is at 20% of the range of the vector elemente (1-5)
. This is calculated as (1 + (5-1)*0.2).

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item