Location : Home > Languages > Perl > Package
Title : Statistics::PointEstimation
Toolbox Logo

名称

 Statistics::PointEstimation - スチューデントの t-分布に基づくパラメータの信頼区間の計算
 Statistics::PointEstimation::Sufficient - 十分統計量を用いた信頼区間の計算


概要

# Statistics::PointEstimation の例
use Statistics::PointEstimation;

my @r=();
for($i=1;$i<=32;$i++) # 平均が 5 の一様分布に従う標本の生成
{
   $rand=rand(10);
   push @r,$rand;
}

my $stat = new Statistics::PointEstimation;
$stat->set_significance(95); #set the significance(confidence) level to 95%
$stat->add_data(@r);
$stat->output_confidence_interval(); #output summary
$stat->print_confidence_interval();  #output the data hash related to confidence interval estimation

#the following is the same as $stat->output_confidence_interval();
print "Summary  from the observed values of the sample:\n";
print "\tsample size= ", $stat->count()," , degree of freedom=", $stat->df(), "\n";
print "\tmean=", $stat->mean()," , variance=", $stat->variance(),"\n";
print "\tstandard deviation=", $stat->standard_deviation()," , standard error=", $stat->standard_error(),"\n";
print "\t the estimate of the mean is ", $stat->mean()," +/- ",$stat->delta(),"\n\t",
" or (",$stat->lower_clm()," to ",$stat->upper_clm," ) with ",$stat->significance," % of confidence\n";
print "\t t-statistic=T=",$stat->t_statistic()," , Prob >|T|=",$stat->t_prob(),"\n";


# Statistics::PointEstimation::Sufficient の例
use strict;
use Statistics::PointEstimation;

my ($count,$mean,$variance)=(30,3.996,1.235); 
my $stat = new Statistics::PointEstimation::Sufficient;
$stat->set_significance(99);
$stat->load_data($count,$mean,$variance);
$stat->output_confidence_interval();
$stat->set_significance(95);
$stat->output_confidence_interval();

説明

Statistics::PointEstimation

 本モジュールは Statistics::Descriptive::Full のサブクラスである。データが正規分布しているか標本数が十分に大きいとして T-分布で点推定を行う。指定された優位水準(デフォルトは 95%)で信頼区間を計算するために Statistics::Descriptive の add_data() をオーバライドする。対のあるT検定(paired T-tests)を計算するために t統計値が = Tとなる値、 Prob > |T| となる値も計算する。

Statistics::PointEstimation::Sufficient

 本モジュールは Statistics::PointEstimation のサブクラスである。入力として実際のデータを取る代わりに十分統計量と標本の大きさに基づく信頼区間を計算する。本モジュールを利用するためには標本の大きさ・標本平均・標本分散を load_data() 関数を用いて入力しなければならない。出力は厳密に Statistics::PointEstimation モジュールのものと同じである。


著者

 Yun-Fang Juan , Yahoo! Inc. yunfang@yahoo-inc.com


参考資料

 Statistics::Descriptive, Statistics::Distributions

Toolbox Logo
Updated : 2007/02/26