File: weibull_spec.rb

package info (click to toggle)
ruby-distribution 0.7.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 624 kB
  • ctags: 379
  • sloc: ruby: 4,283; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 586 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require File.expand_path(File.dirname(__FILE__)+"/spec_helper.rb")
require "distribution/weibull"

include ExampleWithGSL

describe Distribution::Weibull do

	 #shared_examples for "Weibull engine" do
	        it "should return correct pdf" do
		   Distribution::Weibull::pdf(2, 1, 1).should be_within(1e-3).of(0.13533)
		end
	 	it "should return correct cdf" do 
		   Distribution::Weibull::cdf(2, 1, 1).should be_within(1e-3).of(0.86466)
		end
		it "should return correct p-value" do 
		   Distribution::Weibull::p_value(0.86466, 1, 1).should be_within(1e-3).of(2.0)
		end
	 #end
end