JP2010039756A - Independence test device, data analysis device, and independence test program - Google Patents
Independence test device, data analysis device, and independence test program Download PDFInfo
- Publication number
- JP2010039756A JP2010039756A JP2008201945A JP2008201945A JP2010039756A JP 2010039756 A JP2010039756 A JP 2010039756A JP 2008201945 A JP2008201945 A JP 2008201945A JP 2008201945 A JP2008201945 A JP 2008201945A JP 2010039756 A JP2010039756 A JP 2010039756A
- Authority
- JP
- Japan
- Prior art keywords
- independence
- items
- test
- resample
- sample data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Complex Calculations (AREA)
Abstract
Description
本発明は、独立性判定装置、データ解析装置、及び独立性検定プログラムに関する。 The present invention relates to an independence determination device, a data analysis device, and an independence test program.
統計学において、ある変数どうしに相互の依存性があるのかどうかを知ることは基本的で重要な分析である。例えば、医療分野における病気の症状と薬効、年齢、または性別との関係や、また、生産工場における欠陥の発生と様々な環境要因との関係など数多くの例が挙げられる。こうした変数間の独立性を調べる手法として、統計的仮説検定方法と呼ばれる手法が発達しており、χ二乗検定、尤度比検定(G検定)などが知られている(例えば、非特許文献1参照)。これら従来の統計的仮説検定方法は多くのデータが得られているという仮定の下に、データを出力する確率分布関数が中心極限定理より正規分布で近似でき、統計量がその近似から導かれるχ二乗分布で表現できることを前提としているため、少数のデータしか得られない場合には正規分布による近似の精度が劣化するためその閾値の信頼性が下がり、従って仮説検定結果の信頼性が低下する。 In statistics, knowing whether certain variables have interdependencies is a basic and important analysis. For example, there are many examples such as the relationship between disease symptoms and efficacy, age, or gender in the medical field, and the relationship between the occurrence of defects in production plants and various environmental factors. As a method for examining the independence between variables, a method called a statistical hypothesis test method has been developed, and a chi-square test, a likelihood ratio test (G test), and the like are known (for example, Non-Patent Document 1). reference). With these conventional statistical hypothesis testing methods, the probability distribution function that outputs data can be approximated by a normal distribution by the central limit theorem, assuming that a lot of data is obtained, and the statistic is derived from the approximation. Since it is assumed that it can be expressed by a square distribution, when only a small number of data can be obtained, the accuracy of approximation by the normal distribution deteriorates, so that the reliability of the threshold value is lowered, and therefore the reliability of the hypothesis test result is lowered.
また、少数データの統計量を精度よく算出する手法として、ブートストラップによる仮説検定方法が知られている(例えば、非特許文献2参照)。ブートストラップによる仮説検定を行った場合、得られたデータにおける統計量の精度を高めるという効果はあるものの、比較を行なうための閾値を算出するχ二乗分布の近似精度の信頼性が低いため閾値の信頼性は低いままであり、やはり少数データでの仮説検定の信頼性は低い。
本発明は、標本データの標本数が少ない場合でも、標本データの中の項目の独立性を精度よく検定することができる独立性検定装置、データ解析装置、及び独立性検定プログラムを提供することを目的とする。 The present invention provides an independence test apparatus, a data analysis apparatus, and an independence test program that can accurately test the independence of items in sample data even when the number of sample data is small. Objective.
上記目的を達成するために、本発明に係る独立性検定装置は、各々確率変数に対応した事象からなる項目を複数有する複数の標本データの標本数以下の大きさが異なる再標本数を複数設定し、設定した再標本数毎に該再標本数の標本データを前記複数の標本データから抽出する抽出手段と、前記抽出手段で抽出した標本データに基づいて、前記抽出手段で抽出した標本データの複数の項目の中の2つの項目の独立性又は前記2つの項目以外の1つ以上の項目を条件として前記2つの項目の独立性を検定するための条件付の独立性検定量を検定するための独立性検定量であって、前記2つの項目の相関の程度に応じた値を計量するためのG検定量又はχ二乗検定量に基づく独立性検定量を前記再標本数毎に算出する算出手段と、前記算出手段で算出された前記再標本数毎の独立性検定量から定まる近似曲線に基づいて、前記標本数より大きな標本数における独立性検定量を推定する推定手段と、前記推定手段で推定した独立性検定量が予め定めた値以下の場合に前記2つの項目が独立であると判定する判定手段とを含んで構成されている。 In order to achieve the above object, the independence test apparatus according to the present invention sets a plurality of resample numbers whose sizes are not more than the sample number of a plurality of sample data having a plurality of items each consisting of an event corresponding to a random variable. And extracting means for extracting the sample data of the number of resamples from the plurality of sample data for each set number of resamples, and the sample data extracted by the extraction means based on the sample data extracted by the extraction means To test the independence of two items among a plurality of items or a conditional independence test amount for testing the independence of the two items on the condition of one or more items other than the two items A calculation for calculating an independence test amount based on a G test amount or a chi-square test amount for measuring a value corresponding to the degree of correlation between the two items for each resample number. Means and the calculating means An estimation means for estimating an independence test quantity in a larger number of samples than the number of samples based on an approximated curve determined from the independence test quantity for each resample number issued; and an independence test quantity estimated by the estimation means And determining means for determining that the two items are independent when the value is equal to or less than a predetermined value.
また、前記算出手段は、前記G検定量又はχ二乗検定量を相互情報量又は条件付相互情報量に換算して前記独立性検定量を算出するようにすることができる。 Further, the calculation means may calculate the independence test amount by converting the G test amount or the chi-square test amount into a mutual information amount or a conditional mutual information amount.
また、前記抽出手段は、1つの前記再標本数について複数回の抽出を行い、前記算出手段は、前記再標本数毎に抽出回数分の複数の独立性検定量を算出し、前記複数の独立性検定量の平均値から前記再標本数毎の独立性検定量を算出するようにすることができる。 Further, the extraction means performs a plurality of extractions for one resample number, and the calculation means calculates a plurality of independence test amounts for each resample number, and the plurality of independent test quantities. The independence test amount for each resample number can be calculated from the average value of the sex test amount.
また、前記抽出手段は、1つの前記再標本数について複数回の抽出を行い、前記算出手段は、前記再標本数毎に抽出回数分の複数の独立性検定量を算出し、前記推定手段は、前記複数の独立性検定量の分散に基づく重み付き最小二乗法により定まる近似曲線に基づいて、前記標本数より大きな標本数における独立性検定量を推定するようにすることができる。 In addition, the extraction unit performs a plurality of extractions for one resample number, the calculation unit calculates a plurality of independence test amounts for each resample number, and the estimation unit includes: The independence test amount in the number of samples larger than the number of samples can be estimated based on an approximate curve determined by a weighted least square method based on the variance of the plurality of independence test amounts.
また、本発明に係るデータ解析装置は、上記独立性検定装置と、前記判定手段で独立ではないと判定された項目を関連付けて、前記標本データの複数の項目についてベイジアンネットワークまたはマルコフネットワークを構成する構成手段とを含んで構成されている。 The data analysis apparatus according to the present invention relates to the independence test apparatus and items determined to be not independent by the determination means, and constitutes a Bayesian network or a Markov network for a plurality of items of the sample data. And a configuration means.
また、本発明に係る独立性検定プログラムは、コンピュータを、各々確率変数に対応した事象からなる項目を複数有する複数の標本データの標本数以下の大きさが異なる再標本数を複数設定し、設定した再標本数毎に該再標本数の標本データを前記複数の標本データから抽出する抽出手段と、前記抽出手段で抽出した標本データに基づいて、前記抽出手段で抽出した標本データの複数の項目の中の2つの項目の独立性又は前記2つの項目以外の1つ以上の項目を条件として前記2つの項目の独立性を検定するための条件付の独立性検定量を検定するための独立性検定量であって、前記2つの項目の相関の程度に応じた値を計量するためのG検定量又はχ二乗検定量に基づく独立性検定量を前記再標本数毎に算出する算出手段と、前記算出手段で算出された前記再標本数毎の独立性検定量から定まる近似曲線に基づいて、前記標本数より大きな標本数における独立性検定量を推定する推定手段と、前記推定手段で推定した独立性検定量が予め定めた値以下の場合に前記2つの項目が独立であると判定する判定手段として機能させるためのプログラムである。 Further, the independence test program according to the present invention sets a plurality of resample numbers having different sizes below the sample number of a plurality of sample data having a plurality of items each consisting of an event corresponding to a random variable. Extraction means for extracting the sample data of the number of resamples from the plurality of sample data for each number of resamples, and a plurality of items of sample data extracted by the extraction means based on the sample data extracted by the extraction means The independence of two items in or the independence to test a conditional independence test amount for testing the independence of the two items subject to one or more items other than the two items A calculation means for calculating an independence test quantity based on a G test quantity or a chi-square test quantity for measuring a value according to the degree of correlation between the two items for each resample number; Said calculating means Based on an approximate curve determined from the calculated independence test amount for each resample number, an estimation means for estimating an independence test amount in a sample number larger than the sample number, and an independence test amount estimated by the estimation means Is a program for causing the two items to function as determination means for determining that the two items are independent when the value is equal to or less than a predetermined value.
以上説明したように、請求項1記載の独立性検定装置、及び請求項6記載の独立性検定プログラムによれば、標本データの標本数が少ない場合でも、標本データの中の項目の独立性を精度よく検定することができる、という効果が得られる。
As described above, according to the independence test apparatus according to
また、請求項2から請求項4記載の独立性検定装置によれば、独立性を検定するための検定量を精度よく推定することができる、という効果が得られる。
In addition, according to the independence test apparatus described in
また、請求項5記載のデータ解析装置によれば、精度よく判定された項目間の独立性に基づいて、精度よくデータ解析を行うことができる、という効果が得られる。 Further, according to the data analysis apparatus of the fifth aspect, it is possible to obtain an effect that the data analysis can be performed with high accuracy based on the independence between items determined with high accuracy.
以下、図面を参照して本発明の実施の形態について詳細に説明する。なお、以下では、本発明の独立性検定装置を、サンプルデータを解析してベイジアンネットワークを構成することにより項目間の関連性について解析するデータ解析装置に適用した場合について説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. Hereinafter, a case will be described in which the independence test apparatus of the present invention is applied to a data analysis apparatus that analyzes the relationship between items by analyzing sample data to form a Bayesian network.
図1に示すように、本実施の形態に係るデータ解析装置10は、各種設定及び条件等を入力するための操作キー、キーボード、マウス、及びタッチパネル等の入力装置12、構成されたベイジアンネットワークを可視化して表示するためのディスプレイ等の表示装置14、及びデータ解析の処理を実行するコンピュータ16を備えている。
As shown in FIG. 1, the
コンピュータ16は、データ解析装置10全体の制御を司るCPU24、後述するデータ解析プログラム及び独立性検定プログラム等各種プログラムを記憶した記憶媒体としてのROM26、ワークエリアとしてデータを一時的に格納するRAM28、各種情報が記憶された記憶手段としてのHDD(ハードディスク)30、ネットワークと接続するためのネットワークI/F(インタフェース)部32、I/O(入出力)ポート34、及びこれらを接続するバスを含んで構成されている。I/Oポート34には、入力装置12及び表示装置14が接続されている。
The
このコンピュータ16をハードウエアとソフトウエアとに基づいて定まる機能実現手段毎に分割した機能ブロックで説明すると、図2に示すように、サンプルデータからリサンプリングを行うデータ抽出部36と、データ抽出部36で抽出されたサンプルデータに基づいて、独立性を検定するための検定量を算出する検定量算出部38と、検定量算出部38で算出された検定量に基づいて、サンプルデータのデータ数より大きなデータ数における検定量を推定する推定部40と、推定部40で推定した検定量に基づいて、サンプルデータの中の2つの項目が独立か否かを判定する判定部42と、判定部42の判定結果に基づいてサンプルデータの項目についてベイジアンネットワークを構成するネットワーク構成部44とを含んだ構成で表すことができる。
When the
ここで、本実施の形態の独立性検定の原理について、複数の項目(X,Y,Z・・・)について確率変数に対応した値(事象)を保持したn個のサンプルデータが与えられ、項目Xと項目Yとの独立性を検定する場合について説明する。 Here, regarding the principle of the independence test of the present embodiment, n sample data holding values (events) corresponding to random variables for a plurality of items (X, Y, Z...) Are given. A case where the independence between the item X and the item Y is tested will be described.
まず、n以下の自然数m1、m2、・・・mi、・・・、mimaxをリサンプリングデータ数として設定する。次に、「項目Xと項目Yとは項目Zの下で独立である。」という仮説を立て、与えられたn個のサンプルデータからm1個のサンプルデータをリサンプリングし、仮説に基づいて得られる理論値とサンプルデータから得られる実測値とに基づいて、項目Xと項目Yとの条件付相関の程度を表わす計量としての独立性検定量を算出する。同様に、n個のサンプルデータからm2・・・mi、・・・、mimax個のサンプルデータをリサンプリングして、それぞれについて検定量を算出する。 First, natural numbers m 1 , m 2 ,..., M i ,. Next, a hypothesis that “item X and item Y are independent under item Z” is made, m 1 sample data is resampled from the given n sample data, and based on the hypothesis Based on the obtained theoretical value and the actual measurement value obtained from the sample data, an independence test amount is calculated as a metric representing the degree of conditional correlation between the item X and the item Y. Similarly, m 2 ..., M i ,..., Mi max sample data are resampled from n sample data, and a test amount is calculated for each.
図3に示すように、横軸にサンプリングデータ数、縦軸に検定量をとった座標系に、算出した検定量をプロットする(・マーク)。m1、m2、・・・mi、・・・、mimaxのリサンプリングデータ数について算出された検定量から、最小二乗法等の手法を用いて近似曲線を求め、nより大きなサンプリング数Nにおける検定量(×マーク)を推定する。この推定された検定量と閾値とを比較することにより独立性を判定する。検定量は、相互情報量又は条件付相互情報量への換算が容易なG統計量やχ二乗統計量を用いることが望ましい。そしてこれらの検定統計量がχ二乗分布の有意性として通常用いられる値(5%)などを用いて算出されるχ二乗分布の閾値以下の場合には、仮説が正しい(項目Xと項目Yとは独立である)と判定し、閾値より大きい場合には、仮説が正しくない(項目Xと項目Yとは独立ではない)と判定する。 As shown in FIG. 3, the calculated test amount is plotted on the coordinate system with the number of sampling data on the horizontal axis and the test amount on the vertical axis (• mark). Approximate curve is obtained from the test amount calculated for the number of resampling data of m 1 , m 2 ,..., m i ,. Estimate the test amount at N (x mark). Independence is determined by comparing the estimated test amount with a threshold value. As the verification amount, it is desirable to use a G statistic or a chi-square statistic that can be easily converted into mutual information or conditional mutual information. And if these test statistics are below the threshold of the chi-square distribution calculated using the value (5%) normally used as the significance of the chi-square distribution, the hypothesis is correct (item X, item Y and Is determined to be independent), and if it is greater than the threshold, it is determined that the hypothesis is incorrect (item X and item Y are not independent).
次に、図4を参照して、本実施の形態におけるデータ解析プログラムの処理ルーチンについて説明する。ここでは、個人のプロファイルや嗜好性、選好性を学習し、新着電子メールを個人にとって重要かどうかを判断し、その結果を個人に知らせるシステムを構築するためのベイジアンネットワークを構成する場合について説明する。 Next, the processing routine of the data analysis program in the present embodiment will be described with reference to FIG. This section describes the case of configuring a Bayesian network to learn a person's profile, preferences, and preferences, determine whether new email is important to the individual, and build a system that informs the person of the result. .
ステップ100で、サンプルデータを取得する。サンプルデータは、入力装置12から入力されてもよいし、ネットワークを介して外部接続された記憶装置に記憶されていてもよいし、またはコンピュータ16のHDD30に予め記憶されていてもよい。ここでは、項目X、項目Y及び項目Zを有するサンプルデータが500個取得されるものとする。
In
サンプルデータは、図5に示すように、項目Xは、電子メールの文面に「会議」という文字が存在するか否かに関する項目(会議)で、事象x1=”有”、事象x2=”無”である。項目Yは、電子メールの差出人との間に過去に頻繁な電子メールのやり取りがあったか否かに関する項目(頻繁)で、事象y1=”有”、事象y2=”無”である。項目Zは、新着電子メールが重要か否かに関する項目(重要)で、事象z1=”重要”、事象z2=”重要ではない”である。なお、かっこ内は、各項目の内容を端的に表す項目名である。 In the sample data, as shown in FIG. 5, the item X is an item (conference) regarding whether or not the word “conference” exists in the text of the e-mail. Event x1 = “present”, event x2 = “none” ". Item Y is an item (frequently) regarding whether or not frequent electronic mail has been exchanged with the sender of the electronic mail in the past, and event y1 = “present” and event y2 = “none”. The item Z is an item (important) regarding whether or not the new arrival e-mail is important, and event z1 = “important” and event z2 = “not important”. The items in parentheses are item names that directly represent the contents of each item.
ここで、事象xの確率変数をP(x)とすると、項目Xの事象x1及びx2は、理論値に基づいた場合には、P(x1)=1/2、P(x2)=1/2となる。リサンプリングされたサンプルデータの実測値に基づいた場合には、P(x1)=x1の個数/リサンプリングデータ数、P(x2)=x2の個数/リサンプリングデータ数、となる。項目Y及び項目Zについても同様である。このように、サンプルデータは、確率変数に対応した事象からなる複数の項目を有している。 Here, if the random variable of the event x is P (x), the events x1 and x2 of the item X are P (x1) = 1/2 and P (x2) = 1 / 2. When based on the actually measured value of the resampled sample data, P (x1) = number of x1 / number of resampled data, P (x2) = number of x2 / number of resampled data. The same applies to item Y and item Z. Thus, the sample data has a plurality of items consisting of events corresponding to random variables.
次に、ステップ102で、サンプルデータの中の項目のうち、独立性を検定することにより項目間の相関を解析する項目を決定する。ここでは、条件付独立性を検定するため、2つの項目と条件となる1つの項目を決定する。この決定は、サンプルデータの全ての項目の組み合わせについて相関を解析するために、任意の項目を予め定めたルールに従って行ってもよいし、ユーザの選択により入力装置12から入力された選択信号に基づいて行ってもよい。
Next, in
ここでは、新着メールが重要か重要でないかを判断するに当たって、文面に「会議」の文字があるか否ということと、差出人と過去に頻繁なメールのやり取りがあったか否かということとに相関があるか否かを解析することを目的とし、独立性を検定する項目として項目Xと項目Y、及び条件となる項目として項目Zを決定する。 Here, in determining whether new mail is important or not, there is a correlation between whether or not there is a word “meeting” in the text and whether or not the sender has frequently exchanged mail in the past. For the purpose of analyzing whether or not there is, item X and item Y are determined as items for testing independence, and item Z is determined as a condition item.
次に、ステップ104で、後述する独立性検定処理を実行して、上記ステップ102で決定した項目について独立性を検定する。
Next, in
次に、ステップ106で、独立性の検定結果に基づいて、項目間のネットワークを構成する。検定結果として、条件付独立性仮説が棄却された場合には、項目間に相関があるということになるため、ベイジアンネットワークを構成するエッジがあると判断する。また、条件付独立性仮説が採択された場合には、項目間に相関がないということになるため、ベイジアンネットワークを構成するエッジがないと判断する。この判断に基づいてベイジアンネットワークを構成する。例えば、「項目Zの条件下で項目Xと項目Yとは独立」という仮説が棄却されなかった場合には、項目Zの条件下で項目Xと項目Yとは独立ということになり、XとYとの間のエッジは存在しないことになり、さらにXとZ、YとZの間には全ての条件付独立性の仮説が棄却されたとするとXとZおよびYとZの間にはエッジが存在することになる。この段階ではエッジはまだ有向辺ではない無向辺の状態だが、ベイジアンネットワークにおいて条件付独立性を考慮して有向辺の向きを定めるオリエンテーション・ルール(例えば、「C.Meek著、「Causal Inference and Causal Explanation with Background Knowledge」,Conference on Uncertainty in Artificial Intelligence,1995年」参照)に従えば、図6に示すようなベイジアンネットワークが構成される。
Next, in
次に、ステップ108で、解析を終了するか否かを判断する。予め定めたルールに従って項目を決定する場合には、全ての項目の組み合わせについて解析が終了したか否かを判断する。ユーザの選択により項目を決定する場合には、引き続き別の項目について解析を行うか否かの選択画面を表示するなどして、ユーザにより入力された選択信号により判断する。解析を終了する場合には、ステップ110へ進み、構成されたベイジアンネットワークを可視化して表示装置14に表示して処理を終了する。解析を終了しない場合には、ステップ102へ戻り、別の項目について解析の処理を繰り返す。なお、構成されたベイジアンネットワークのデータを、ネットワークを介して接続された外部装置に出力してもよい。
Next, in
次に、図7を参照して、データ解析処理(図4)のステップ104で実行される独立性検定処理の処理ルーチンについて説明する。
Next, the processing routine of the independence test process executed in
ステップ200で、サンプルデータからリサンプリングする際のデータ数を示すリサンプリングデータ数mi、及びリサンプリングデータ数mi毎に何回のリサンプリングを行うかを示すサンプリング回数jmaxを決定する。この決定は、サンプルデータの個数nに基づいて予め定めたルールで決定してもよいし、ユーザからの入力により決定してもよい。予め定めたルールで決定する場合には、例えば、m1=n×0.2、m2=n×0.4、m3=n×0.5、m4=n×0.6、m5=n×0.7、m6=n×0.8、m7=n×0.9、j=10回、のように決定することができる。ここでは、サンプルデータの個数nは500個であるので、リサンプリングデータ数miは、100/200/250/300/350/400/450個と決定される。
In
次に、ステップ202で、i及びjに「1」をセットし、次に、ステップ204で、リサンプリングデータ数miでのj回目のリサンプリングを行う。ここでは、i及びjは「1」であるので、リサンプリングデータ数m1(100個)での1回目のリサンプリングが行われる。
Next, in
次に、ステップ206で、リサンプリングされたサンプルデータに基づいて、独立性を検定するための検定量を算出する。ここでは、下記(1)式で表わされるG検定量を下記(2)式で表わされる相互情報量との換算関係(式(3))により式(4)の相互情報量を検定量として用いχ二乗分布の値も同様に2miで割った値を用いる。χ二乗検定量を用いた場合はχ二乗検定量自体がG検定量の近似であるため全く同様の式で相互情報量に換算することができる。相互情報量は確率の値から算出される相関を現わす計量であるため、データ数が十分に得られれば大数の法則(例えば、非特許文献1参照)によりある値に収束することがわかる。従って下記(4)式は十分なデータ数が得られることによりリサンプリングデータ数miが決まればある値に収束する。
Next, in
なお、Oは観測頻度でEは仮説の下での期待頻度でありここでは独立又は条件付独立と仮定した場合の頻度となる。 Note that O is the observation frequency, and E is the expected frequency under the hypothesis, which is the frequency when assumed to be independent or conditional independent.
なお、矢印付のz(「z*」とも表す)は、少なくとも1つ以上の項目(事象)の結合事象を表す。また、p(x,y,z*)は、事象x,y,z*の同時確率、p(x,y|z*)は、事象z*が生じているという条件下における事象x,yの同時確率、p(x|z*)は、事象z*が生じているという条件下における事象xの周辺確率、及びp(y|z*)は、事象z*が生じているという条件下における事象yの周辺確率である。また、項目Xと項目Yとが独立であれば、(5)式が成り立つため、相互情報量は「0」となり、項目Xと項目Yとの相関が高くなるに従って大きな値となる。 Note that z with an arrow (also expressed as “z * ”) represents a combined event of at least one item (event). Further, p (x, y, z * ) is the joint probability of the event x, y, z * , and p (x, y | z * ) is the event x, y under the condition that the event z * occurs. , P (x | z * ) is the marginal probability of event x under the condition that event z * occurs, and p (y | z * ) is the condition under which event z * occurs Is the marginal probability of event y. If the item X and the item Y are independent, the equation (5) is established, so that the mutual information amount is “0”, and the value increases as the correlation between the item X and the item Y increases.
また、χ二乗検定量χ2は、 The χ square test amount χ 2 is
で表わされる。ここでもOとEは前記のG検定量での定義と同じである。 It is represented by Here, O and E are the same as defined in the G test amount.
例えば、リサンプリング数100個のサンプルデータを集計して、図8に示すような集計結果が得られたとする。この集計結果から、事象z=z1(重要)という条件の下、事象x=x1(有)、及び事象y=y1(有)について、p(x,y,z)=0.35、p(x,y|z)=0.35、p(x|z)=0.45、及びp(y|z)=0.45となる。同様に、事象z=z1(重要)という条件の下、x=x1及びy=y2の場合、x=x2及びy=y1の場合、x=x2及びy=y2の場合、さらに同様に、事象z=z2(重要ではない)という条件の下、x=x1及びy=y1の場合、x=x1及びy=y2の場合、x=x2及びy=y1の場合、x=x2及びy=y2の場合の和を上記(1)式に代入して検定量を算出する。 For example, it is assumed that sample data with 100 resamplings is totaled and a totaling result as shown in FIG. 8 is obtained. From this total result, p (x, y, z) = 0.35, p (x) for event x = x1 (present) and event y = y1 (present) under the condition of event z = z1 (important). x, y | z) = 0.35, p (x | z) = 0.45, and p (y | z) = 0.45. Similarly, under the condition of event z = z1 (important), if x = x1 and y = y2, if x = x2 and y = y1, if x = x2 and y = y2, and so on, Under the condition z = z2 (not important), when x = x1 and y = y1, when x = x1 and y = y2, when x = x2 and y = y1, x = x2 and y = y2 Substituting the sum in the above case into the above equation (1), the test amount is calculated.
次に、ステップ208で、j=jmaxとなったか否かを判断することにより、決定したサンプリング回数分のリサンプリングが終了したか否かを判断する。ここでは、1つのリサンプリングデータ数m1について10回リサンプリングを行うように決定されており、まだ1回目であるので否定されてステップ210へ進む。
Next, in
ステップ210で、jを1インクリメントしてステップ204へ戻り、決定したサンプリング回数(10回)分のリサンプリングが終了するまで処理を繰り返す。j=jmaxとなった場合には、ステップ212へ進む。
In
ステップ212で、1つのリサンプリングデータ数miについてj回分のリサンプリングにより算出されたj個の検定量MIijからリサンプリングデータ数miについての平均検定量MIi及びその分散値を算出する。算出した平均検定量MIi及びその分散値は、一旦所定の記憶領域に記憶しておく。
In
次に、ステップ214で、i=imaxとなったか否かを判断することにより、決定したリサンプリングデータ数miの全てについてのリサンプリングを終了したか否かを判断する。ここでは、リサンプリングデータ数miは、100/200/250/300/350/400/450個の7つが決定されており、まだリサンプリングデータ100個でのリサンプリングしか行っていないので、否定されてステップ216へ進む。
Next, at
ステップ216で、iを1インクリメントしてステップ204へ戻り、決定したリサンプリングデータ数miの全てについてリサンプリングが終了するまで処理を繰り返す。i=imaxとなった場合には、ステップ218へ進む。
In
ステップ218で、図9に示すように、横軸にリサンプリングデータ数、縦軸に検定量を相互情報量換算に換算した値をとった座標系に、リサンプリングデータ数mi毎の平均検定量MIiをプロットする(四角マーク)。なお、プロットした各点に示されたエラーバーは、サンプリング回数j毎に算出した検定量MIijの分布を示している。この各点に基づいて、最小二乗法や分散による重み付最小二乗法により近似曲線50を算出する。
In
次に、ステップ220で、サンプルデータの個数nより十分大きなデータ数を外挿データ数Nとして決定する。外挿データ数Nの決定は、サンプルデータの個数n、リサンプリングデータ数mi、及びサンプリング回数jなどに基づいて適切な値を決定してもよいし、ユーザからの入力により決定してもよい。算出した近似曲線に基づいて、決定した外挿データ数Nにおける検定量を推定検定量MINとして算出する。
Next, in
次に、ステップ222で、独立性を検定する項目の自由度に基づいて有意水準95%のχ二乗分布を相互情報量へ変換した閾値分布52を算出し、決定した外挿データ数Nにおける閾値thを、この閾値分布52に基づいて算出する。外挿データ数Nを2000個とした場合には、図9に示すように、推定検定量MIN及び閾値thが算出される。
Next, in
次に、ステップ224で、推定検定量MINが閾値thより大きいか否かを判定し、推定検定量MINが閾値thより大きい場合には、ステップ226へ進んで、検定結果「棄却」(条件付独立ではない)を出力し、推定検定量MINが閾値th以下の場合には、検定結果「採択」(条件付独立である)を出力して、リターンする。
Next, in
以上説明したように、取得されたサンプルデータについて、リサンプリングデータ数を異ならせて複数回のリサンプルリングを行い、リサンプリング毎に算出した検定量に基づいて、サンプルデータの個数より十分大きなデータ数における検定量を推定するため、サンプルデータ数が少ない場合でも、精度よく独立性を検定することができ、この検定結果を用いて項目間のネットワークを構成することにより、精度の高いデータ解析を行うことができる。 As described above, the sample data obtained is resampled multiple times with different numbers of resampling data, and data sufficiently larger than the number of sample data based on the test amount calculated for each resampling. Since the test quantity in number is estimated, independence can be tested accurately even when the number of sample data is small, and by constructing a network between items using this test result, highly accurate data analysis is possible. It can be carried out.
なお、本実施の形態では、条件付独立を検定する場合について説明したが、条件となる項目を設定せず2つの項目について条件なしの独立性を検定するようにしてもよい。 In the present embodiment, the case of testing conditional independence has been described. However, it is also possible to test for independence without conditions for two items without setting a condition item.
また、本実施の形態では、データ解析として、独立性検定の結果を用いてベイジアンネットワークを構成する場合について説明したが、2変数間の相関もしくは条件付き相関に基づいてネットワークを構成するものであればよく、例えば、マルコフネットワークを構成するようにしてもよい。 In the present embodiment, the case where a Bayesian network is configured using the result of the independence test as data analysis has been described. However, if the network is configured based on correlation between two variables or conditional correlation. For example, a Markov network may be configured.
また、本実施の形態では、リサンプリング毎の平均検定量から近似曲線を算出する場合について説明したが、リサンプリング毎の検定量をそのままプロットし(例えば、図9の各点毎のエラーバーの範囲)、リサンプリングデータ数毎の検定量の分散に基づく重み付最小二乗法により近似曲線を算出するようにしてもよい。 In the present embodiment, the approximate curve is calculated from the average verification amount for each resampling. However, the verification amount for each resampling is plotted as it is (for example, the error bar for each point in FIG. 9). Range), an approximated curve may be calculated by a weighted least square method based on the variance of the test amount for each number of resampling data.
また、本実施の形態では、検定量として、G検定量を用いたが、χ二乗検定量又は相互情報量に変換できる他の統計的独立検定量を用いてもよい。 In this embodiment, the G test amount is used as the test amount. However, a χ square test amount or another statistical independent test amount that can be converted into the mutual information amount may be used.
また、本実施の形態では、推定検定量と比較するための閾値をχ二乗分布に基づいて算出する場合について説明したが、これに限定されるものではなく、外挿データ数毎に適切な閾値を設定してもよい。 Further, in the present embodiment, the case where the threshold value for comparison with the estimated test amount is calculated based on the χ square distribution is described, but the present invention is not limited to this, and an appropriate threshold value is set for each extrapolated data number. May be set.
また、本実施の形態では、サンプルデータの項目数が3つの場合について説明したが、より多くの項目を含むサンプルデータを用いてもよい。項目数が増えることにより独立性を検定する回数が指数的に増加するため、PCアルゴリズム(例えば、「C.Glymour &F.Cooper編 「Computation,Causation,&Discover」、AAAI Press/MIT Press、1999年」参照)などの効率的な条件付独立性検定に基づくベイジアンネットワーク構成アルゴリズムを用いることもできる。 Further, in the present embodiment, the case where the number of items of sample data is three has been described, but sample data including more items may be used. Since the number of independence tests increases exponentially as the number of items increases, the PC algorithm (eg, “Computation, Causation, & Discover” edited by C. Glymour & F. Cooper, AAAI Press / MIT Press, 1999) Bayesian network construction algorithms based on efficient conditional independence tests such as
10 データ解析装置
12 入力装置
14 表示装置
16 コンピュータ
36 データ抽出部
38 検定量算出部
40 推定部
42 判定部
44 ネットワーク構成部
DESCRIPTION OF
Claims (6)
前記抽出手段で抽出した標本データに基づいて、前記抽出手段で抽出した標本データの複数の項目の中の2つの項目の独立性を検定するための独立性検定量又は前記2つの項目以外の1つ以上の項目を条件として前記2つの項目の独立性を検定するための条件付の独立性検定量であって、前記2つの項目の相関の程度に応じた値を計量するためのG検定量又はχ二乗検定量に基づく独立性検定量を前記再標本数毎に算出する算出手段と、
前記算出手段で算出された前記再標本数毎の独立性検定量から定まる近似曲線に基づいて、前記標本数より大きな標本数における独立性検定量を推定する推定手段と、
前記推定手段で推定した独立性検定量が予め定めた値以下の場合に前記2つの項目が独立であると判定する判定手段と、
を含む独立性検定装置。 A plurality of resample numbers having different sizes below the sample number of a plurality of sample data having a plurality of items each corresponding to a random variable are set, and the sample data of the resample number is set for each set resample number Extraction means for extracting from a plurality of sample data;
Based on the sample data extracted by the extraction means, an independence test amount for testing the independence of two items among the plurality of items of the sample data extracted by the extraction means or 1 other than the two items A conditional independence test quantity for testing the independence of the two items on condition of two or more items, and a G test quantity for measuring a value according to the degree of correlation between the two items Or a calculation means for calculating an independence test amount based on the chi-square test amount for each resample number;
Based on an approximate curve determined from the independence test amount for each resample number calculated by the calculation unit, estimation means for estimating an independence test amount in a sample number larger than the sample number;
A determination unit that determines that the two items are independent when the independence test amount estimated by the estimation unit is equal to or less than a predetermined value;
Independence tester including.
前記算出手段は、前記再標本数毎に抽出回数分の複数の独立性検定量を算出し、前記複数の独立性検定量の平均値から前記再標本数毎の独立性検定量を算出する、
請求項1または請求項2記載の独立性検定装置。 The extraction means performs a plurality of extractions for one resample number,
The calculation means calculates a plurality of independence test amounts for the number of extractions for each resample number, and calculates an independence test amount for each resample number from an average value of the plurality of independence test amounts.
The independence test | inspection apparatus of Claim 1 or Claim 2.
前記算出手段は、前記再標本数毎に抽出回数分の複数の独立性検定量を算出し、
前記推定手段は、前記複数の独立性検定量の分散に基づく重み付き最小二乗法により定まる近似曲線に基づいて、前記標本数より大きな標本数における独立性検定量を推定する、
請求項1または請求項2記載の独立性検定装置。 The extraction means performs a plurality of extractions for one resample number,
The calculation means calculates a plurality of independence test amounts for the number of extractions for each resample number,
The estimation means estimates an independence test amount in a sample number larger than the sample number based on an approximate curve determined by a weighted least square method based on a variance of the plurality of independence test amounts.
The independence test | inspection apparatus of Claim 1 or Claim 2.
前記判定手段で独立ではないと判定された項目を関連付けて、前記標本データの複数の項目についてベイジアンネットワークまたはマルコフネットワークを構成する構成手段と、
を含むデータ解析装置。 The independence test apparatus according to any one of claims 1 to 4,
Configuration means for associating items determined to be independent by the determination means and configuring a Bayesian network or a Markov network for a plurality of items of the sample data;
Data analysis device including
各々確率変数に対応した事象からなる項目を複数有する複数の標本データの標本数以下の大きさが異なる再標本数を複数設定し、設定した再標本数毎に該再標本数の標本データを前記複数の標本データから抽出する抽出手段と、
前記抽出手段で抽出した標本データに基づいて、前記抽出手段で抽出した標本データの複数の項目の中の2つの項目の独立性を検定するための独立性検定量又は前記2つの項目以外の1つ以上の項目を条件として前記2つの項目の独立性を検定するための条件付の独立性検定量であって、前記2つの項目の相関の程度に応じた値を計量するためのG検定量又はχ二乗検定量に基づく独立性検定量を前記再標本数毎に算出する算出手段と、
前記算出手段で算出された前記再標本数毎の独立性検定量から定まる近似曲線に基づいて、前記標本数より大きな標本数における独立性検定量を推定する推定手段と、
前記推定手段で推定した独立性検定量が予め定めた値以下の場合に前記2つの項目が独立であると判定する判定手段と、
して機能させるための独立性検定プログラム。 Computer
A plurality of resample numbers having different sizes below the sample number of a plurality of sample data having a plurality of items each corresponding to a random variable are set, and the sample data of the resample number is set for each set resample number Extraction means for extracting from a plurality of sample data;
Based on the sample data extracted by the extraction means, an independence test amount for testing the independence of two items among the plurality of items of the sample data extracted by the extraction means or 1 other than the two items A conditional independence test quantity for testing the independence of the two items on condition of two or more items, and a G test quantity for measuring a value according to the degree of correlation between the two items Or a calculation means for calculating an independence test amount based on the chi-square test amount for each resample number;
Based on an approximate curve determined from the independence test amount for each resample number calculated by the calculation unit, estimation means for estimating an independence test amount in a sample number larger than the sample number;
A determination unit that determines that the two items are independent when the independence test amount estimated by the estimation unit is equal to or less than a predetermined value;
Independence test program to make it function.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008201945A JP2010039756A (en) | 2008-08-05 | 2008-08-05 | Independence test device, data analysis device, and independence test program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008201945A JP2010039756A (en) | 2008-08-05 | 2008-08-05 | Independence test device, data analysis device, and independence test program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2010039756A true JP2010039756A (en) | 2010-02-18 |
Family
ID=42012242
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008201945A Pending JP2010039756A (en) | 2008-08-05 | 2008-08-05 | Independence test device, data analysis device, and independence test program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2010039756A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013178637A (en) * | 2012-02-28 | 2013-09-09 | Nippon Telegr & Teleph Corp <Ntt> | Data verification apparatus, data verification method and program |
-
2008
- 2008-08-05 JP JP2008201945A patent/JP2010039756A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013178637A (en) * | 2012-02-28 | 2013-09-09 | Nippon Telegr & Teleph Corp <Ntt> | Data verification apparatus, data verification method and program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Zhang | Bayesian semi-supervised learning for uncertainty-calibrated prediction of molecular properties and active learning | |
Stenling et al. | Bayesian structural equation modeling in sport and exercise psychology | |
Bapst | Assessing the effect of time-scaling methods on phylogeny-based analyses in the fossil record | |
Gelman et al. | Inference from simulations and monitoring convergence | |
JP7353946B2 (en) | Annotation device and method | |
JPH10510385A (en) | Method and system for software quality architecture based analysis | |
JP2007108843A (en) | Semiconductor device design support method, semiconductor device design support system and semiconductor device design support program | |
Sahlin | Estimating convergence of Markov chain Monte Carlo simulations | |
JP7063389B2 (en) | Processing equipment, processing methods, and programs | |
Craiu et al. | Inference based on the EM algorithm for the competing risks model with masked causes of failure | |
JP2019159604A (en) | Abnormality detection device, abnormality detection method and abnormality detection program | |
Li et al. | Multiple changepoint detection using metadata | |
JP2020071624A (en) | Abnormality diagnosing apparatus, abnormality diagnosing method and program | |
Yang | Visual assessment of residual plots in multiple linear regression: A model-based simulation perspective | |
Wang | An imperfect software debugging model considering irregular fluctuation of fault introduction rate | |
JP2010039756A (en) | Independence test device, data analysis device, and independence test program | |
RU2586030C2 (en) | Testing method and system | |
RU75484U1 (en) | DEVELOPMENT OF A POINT EVALUATION OF THE PROBABILITY OF FAILURE-FREE OPERATION OF A TECHNICAL SYSTEM ON A COMPLETE SAMPLE | |
CN107832935B (en) | Method and device for determining hydrologic variable design value | |
Fan et al. | Output assessment for Monte Carlo simulations via the score statistic | |
Manna | Small Sample Estimation of Classification Metrics | |
JP2011141674A (en) | Software quality index value management system, estimation method and estimation program for estimating true value of software quality index value | |
Warner et al. | Probabilistic damage characterization using the computationally-efficient Bayesian approach | |
Chun | Bayesian analysis of the sequential inspection plan via the Gibbs sampler | |
Pigeot et al. | The uncertainty of a selected graphical model |