JP5925043B2 - Different number counting method, apparatus, and program - Google Patents

Different number counting method, apparatus, and program Download PDF

Info

Publication number
JP5925043B2
JP5925043B2 JP2012104395A JP2012104395A JP5925043B2 JP 5925043 B2 JP5925043 B2 JP 5925043B2 JP 2012104395 A JP2012104395 A JP 2012104395A JP 2012104395 A JP2012104395 A JP 2012104395A JP 5925043 B2 JP5925043 B2 JP 5925043B2
Authority
JP
Japan
Prior art keywords
matrix
population
different
frequency
vector
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.)
Active
Application number
JP2012104395A
Other languages
Japanese (ja)
Other versions
JP2013232139A (en
Inventor
浩司 藤本
浩司 藤本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TENSOR CONSULTING CO. LTD.
Original Assignee
TENSOR CONSULTING CO. LTD.
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by TENSOR CONSULTING CO. LTD. filed Critical TENSOR CONSULTING CO. LTD.
Priority to JP2012104395A priority Critical patent/JP5925043B2/en
Publication of JP2013232139A publication Critical patent/JP2013232139A/en
Application granted granted Critical
Publication of JP5925043B2 publication Critical patent/JP5925043B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、膨大な数の要素を有するデータ群の異なり数を推定する技術に関する。   The present invention relates to a technique for estimating the number of different data groups having an enormous number of elements.

情報処理においては膨大な個数の要素を有するデータ群を効率良く、短時間で処理することが求められる。多くの場合、情報処理に供されるデータ群には同じ種類の要素が複数含まれている。そして、データ群に同じ種類の要素が含まれていることを利用してデータ群の処理を効率化する技術がある。つまり、データ群に含まれている要素の種類の個数すなわち異なり数が情報処理に用いられることがある。データ、あるいは有限なデータセットのデータ項目に対し、そのとる相異なる値の種類の数をデータあるいはデータ項目の異なり数と言っている。   In information processing, it is required to process a data group having an enormous number of elements efficiently and in a short time. In many cases, a data group used for information processing includes a plurality of elements of the same type. There is a technique for improving the efficiency of data group processing by utilizing the fact that the same type of elements are included in the data group. That is, the number of types of elements included in the data group, that is, the number of different types may be used for information processing. The number of different types of data or data items of a finite data set is called the number of different data or data items.

例えば、膨大なデータが蓄積されたデータベースにおけるデータのソーティングでは、データベースに含まれる要素の異なり数を抽出し、その異なり数を用いることにより、ソーティング処理を高速化できることが知られている。また、データベースにデータを蓄積する際に、全てのデータを個々の領域に格納するのではなく、要素の種類と度数とを記録することで全体のデータ量を圧縮することができる。その場合にも要素の種類の個数を予め計数しておくことが求められる。なお、有限なデータセットのデータ項目のとる値に対し、その出現頻度をその値の度数といっている。   For example, in data sorting in a database in which an enormous amount of data is accumulated, it is known that the number of different elements included in the database is extracted and the sorting process can be accelerated by using the different numbers. Further, when storing data in the database, the entire data amount can be compressed by recording the type and frequency of the elements instead of storing all the data in individual areas. Even in that case, it is required to count the number of types of elements in advance. For the values of data items in a finite data set, the appearance frequency is called the frequency of the values.

また、サイトへの膨大なアクセスの履歴を蓄積したアクセスログから、あるサイトにアクセスしたユーザ数を抽出できれば、アクセス解析に利用することができる。その場合、アクセスログに含まれているアクセス元アドレスの異なり数がユーザ数を示すことになる。大規模なインターネットサイトにおいては、様々な外部からの攻撃や、許容範囲を超えたアクセス負荷からサーバーを守るため、常に外部からのアクセス状況の監視を行わなければならない。大量のアクセスログの中から、ユニークなアクセスホスト数を計測するのもその一環である。これはすなわち、アクセスログデータからIPアドレスなどのホスト識別情報の異なり数を数え上げることである。大きいサイトにおいては、一日のアクセス数が10億件を超えており、常時全件の統計量を掌握するには、多大な計算機資源が必要となる。   Further, if the number of users who have accessed a certain site can be extracted from an access log in which a huge access history to the site is accumulated, it can be used for access analysis. In that case, the number of different access source addresses included in the access log indicates the number of users. In a large-scale Internet site, in order to protect the server from various external attacks and access loads exceeding the allowable range, it is necessary to constantly monitor the access status from the outside. Measuring the number of unique access hosts from a large number of access logs is part of that. That is, the number of different host identification information such as IP addresses is counted from the access log data. In a large site, the number of accesses per day exceeds one billion, and a large amount of computer resources are required to grasp the statistics of all cases at all times.

また、翻訳ソフトウェアや辞書データベースの作成においては、膨大なコーパスから単語数を抽出し、データベースの構築に利用する。その場合、膨大なコーパスの異なり数が単語数を示すことになる。   In creating translation software and dictionary databases, the number of words is extracted from a huge corpus and used to construct the database. In that case, the number of different corpora is the number of words.

また、住所管理においては、蓄積された住民の情報から住民の名字数を抽出し、住民データの管理に利用することができる。その場合、住民情報における名字の異なり数が名字数を示すことになる。   In addition, in address management, the number of surnames of residents can be extracted from the accumulated information of residents and used for management of residents data. In that case, the number of different surnames in the resident information indicates the number of surnames.

上述のように、データあるいはデータ項目の異なり数を計数することはデータ処理において非常に有用である。しかしながら、データ群が膨大であれば異なり数の計数にも膨大な処理量や記憶容量が必要となる。そのため、膨大なデータ群の異なり数を効率良く計数する技術が求められている。   As described above, counting the number of different data or data items is very useful in data processing. However, if the data group is enormous, it is different and enormous amount of processing and storage capacity are required for counting. Therefore, a technique for efficiently counting the number of different data groups is required.

そのような要求に対して、特許文献1には、様々なデータ群の異なり数を高い精度で推定する技術が開示されている。特許文献1の技術は、小さい異なり数の計数に適した計数法と、大きい異なり数の計数に適した計数法とを併用することにより、高い精度で異なり数を推定しようとするものである。   In response to such a requirement, Patent Document 1 discloses a technique for estimating the number of different data groups with high accuracy. The technique disclosed in Patent Document 1 attempts to estimate the number of differences with high accuracy by using a counting method suitable for counting small different numbers and a counting method suitable for counting large different numbers.

特開2008−59293号公報JP 2008-59293 A

特許文献1の技術は、単一の異なり数計数方法では、様々なデータ群の異なり数を高い精度で計数できないことを前提とし、同じデータ群の異なり数を2つの計数法で推定している。しかし、そのために冗長な処理を行うことになり、処理効率が良くなかった。   The technique of Patent Document 1 assumes that different numbers of various data groups cannot be counted with high accuracy by a single different number counting method, and estimates the different numbers of the same data group by two counting methods. . However, redundant processing is performed for that purpose, and processing efficiency is not good.

本発明の目的は、データ群の異なり数を効率良く推定する技術を提供することである。   An object of the present invention is to provide a technique for efficiently estimating the number of different data groups.

本発明の一態様による異なり数計数方法は、データ群からなる母集団の異なり数を計数するための異なり数計数方法であって、行列生成手段が、前記母集団のサイズと、前記母集団から標本を抽出する抽出率とに基づき、前記母集団の度数毎の異なり数を示した度数異なり数ベクトルと、前記母集団から前記抽出率で抽出された標本の度数毎の異なり数を示した度数異なり数ベクトルとの関係を規定する行列を生成するステップと、異なり数算出手段が、前記行列生成手段で生成された前記行列と、前記母集団から前記抽出率で抽出された標本とに基づいて、前記母集団の異なり数の推定値を算出するステップと、を有している。   A different number counting method according to an aspect of the present invention is a different number counting method for counting a different number of populations composed of data groups, wherein the matrix generation means includes a size of the population, and the population. Based on the sampling rate at which the sample is extracted, a frequency vector indicating the number of differences for each frequency of the population, and a frequency indicating the number of differences for each frequency of samples extracted from the population at the extraction rate A step of generating a matrix defining a relationship with a different number vector, and a different number calculating means based on the matrix generated by the matrix generating means and the sample extracted from the population at the extraction rate And calculating an estimated value of the number of different populations.

本発明によれば、予め算出した行列と母集団から抽出した標本とを使って母集団の異なり数を推定することができるので、全ての要素を分析することなく効率的に異なり数を推定することができる。   According to the present invention, since the number of different populations can be estimated using a matrix calculated in advance and a sample extracted from the population, the number can be efficiently estimated without analyzing all the elements. be able to.

本実施形態による異なり数計数装置のブロック図である。It is a block diagram of a different number counting device by this embodiment. 本実施形態の異なり数計数装置の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the number counting apparatus which differs in this embodiment. 本実施形態の異なり数計数装置10を組み込んだデータ分析装置20の一例を示すブロック図である。It is a block diagram which shows an example of the data analysis apparatus 20 incorporating the number counting apparatus 10 different from this embodiment. アクセスログの一例を模式的に示した図である。It is the figure which showed an example of the access log typically. アクセス解析結果データの一例を模式的に示した図である。It is the figure which showed an example of the access analysis result data typically. 母集団から標本を抽出する様子を示す図である。It is a figure which shows a mode that a sample is extracted from a population. f−度数異なり数Uについて説明するための図である。It is a diagram for explaining f- frequency different number U f. 二項確率行列による近似の原理をトイモデルで示した図である。It is the figure which showed the principle of the approximation by a binomial probability matrix with the toy model. 二項確率行列を圧縮する様子を示す図である。It is a figure which shows a mode that a binomial probability matrix is compressed. 二項確率行列における要素の分布の様子を示す図である。It is a figure which shows the mode of the distribution of the element in a binomial probability matrix. 度数異なり数ベクトルを圧縮する様子を示す図である。It is a figure which shows a mode that a frequency vector differs in frequency. 対数圧縮二項確率行列による近似の原理を示した図である。It is the figure which showed the principle of the approximation by a logarithm compression binomial probability matrix. 推定実験1において抽出率を変えて推定精度を比較した結果を示す図である。It is a figure which shows the result of having changed the extraction rate in the estimation experiment 1, and comparing the estimation precision. 推定実験1において変数と抽出率を変えて推定精度を比較した結果を示す図である。It is a figure which shows the result of having changed the variable and the extraction rate in the estimation experiment 1, and comparing the estimation precision. 図14の結果における対真値をグラフ化した図である。FIG. 15 is a graph showing the true value in the result of FIG. 14. 推定実験2における推定実験結果を示す図である。It is a figure which shows the estimation experiment result in the estimation experiment 2. FIG.

本発明の基本的な実施形態について図面を参照して説明する。   A basic embodiment of the present invention will be described with reference to the drawings.

図1は、本実施形態による異なり数計数装置のブロック図である。本実施形態の異なり数計数装置10は、膨大なデータ群からなる母集団の異なり数を計数する装置である。   FIG. 1 is a block diagram of a different number counting device according to this embodiment. The different number counting device 10 of this embodiment is a device that counts the number of different populations composed of a huge data group.

母集団は、例えば、データベースに蓄積された膨大なデータ、あるいはそのデータが複数の項目で構成されている場合には各項目の値を元とする集合である。データベースに蓄積されたデータ数が母集団のサイズである。母集団には同じ値を持ったデータが含まれている可能性があるため、母集団の異なり数は母集団のサイズと等しいかあるいはそれよりも小さい値である。   The population is, for example, an enormous amount of data stored in a database or a set based on the value of each item when the data is composed of a plurality of items. The number of data stored in the database is the size of the population. Since the population may contain data having the same value, the number of different populations is equal to or smaller than the size of the population.

本実施形態の異なり数計数装置10は異なり数の計数に近似を用いる。近似の方法は母集団から所定の抽出率で抽出した標本群から母集団の異なり数を推定するものである。抽出率は予め与えられるものとする。   The different number counting apparatus 10 of the present embodiment uses an approximation for counting different numbers. The approximation method estimates the number of different populations from a sample group extracted from the population at a predetermined extraction rate. The extraction rate is given in advance.

ここで、母集団や母集団から抽出された標本群のようなデータ群について、度数異なり数ベクトルというものを定義する。度数異なり数ベクトルは、度数毎の異なり数を示したベクトルである。度数は、同じ値のデータが幾つあるかを示すものである。よって、度数異なり数ベクトルは、同じ値のものが何個あるデータが何種類あるかを示していると言える。   Here, a data vector such as a population and a sample group extracted from the population is defined as a frequency vector with different frequencies. The frequency difference number vector is a vector indicating the number of differences for each frequency. The frequency indicates how many pieces of data have the same value. Therefore, it can be said that the number vector different in frequency indicates how many types of data have the same value.

ここでは母集団の度数異なり数ベクトルは未知であるが、標本の度数異なり数ベクトルは既知である。   Here, the frequency vector of the population is unknown, but the frequency vector of the sample is unknown.

図1を参照すると、異なり数計数装置10は行列生成部11および異なり数算出部12を有している。   Referring to FIG. 1, the different number counting apparatus 10 includes a matrix generation unit 11 and a different number calculation unit 12.

行列生成部11は、母集団のサイズと、母集団から標本を抽出する抽出率とに基づき、母集団の度数毎の異なり数を示した度数異なり数ベクトルと、母集団からその抽出率で抽出された標本の度数毎の異なり数を示した度数異なり数ベクトルとの関係を二項確率によって規定する行列を生成する。この行列については後述において段階的に詳しく説明する。   Based on the size of the population and the extraction rate for extracting a sample from the population, the matrix generation unit 11 extracts the frequency difference number vector indicating the number of differences for each frequency of the population and the extraction rate from the population. A matrix is generated that defines the relationship with the frequency-variable number vector indicating the number of different samples for each frequency by binomial probabilities. This matrix will be described in detail later in stages.

異なり数算出部12は、行列生成部11で生成された行列と、母集団から抽出率で抽出された標本とに基づいて、母集団の異なり数の推定値を算出する。   The different number calculation unit 12 calculates an estimated value of the number of different populations based on the matrix generated by the matrix generation unit 11 and the sample extracted from the population at the extraction rate.

本実施形態によれば、予め算出した行列と母集団から抽出した標本とを使って母集団の異なり数を推定することができるので、全ての要素を分析することなく効率的に異なり数を推定することができる。   According to this embodiment, since the number of different populations can be estimated using a matrix calculated in advance and a sample extracted from the population, the number can be efficiently estimated without analyzing all the elements. can do.

以下、各部における、より具体的な動作について説明する。   Hereinafter, more specific operations in each unit will be described.

上述の行列を、二項確率行列を対数的に圧縮したという意味で対数圧縮二項確率行列と呼ぶことにする。二項確率行列は、母集団の度数異なり数ベクトルとの積が標本の度数異なり数ベクトルとなるように、要素として確率を配置した行列のことをいう。対数圧縮二項確率行列は、その二項確率行列を行方向および列方向に圧縮した圧縮行列である。   The above matrix will be referred to as a logarithmic compression binomial probability matrix in the sense that the binomial probability matrix is logarithmically compressed. The binomial probability matrix refers to a matrix in which probabilities are arranged as elements so that the product of the population frequency vector and the number vector differs from the sample frequency vector. The logarithmic compression binomial probability matrix is a compression matrix obtained by compressing the binomial probability matrix in the row direction and the column direction.

そして、異なり数算出部12は、母集団から抽出された標本の度数異なり数ベクトルを圧縮して、それを対数圧縮度数異なり数ベクトルを求め、その標本の対数圧縮度数異なり数ベクトルと、対数圧縮二項確率行列の逆行列との積により、母集団の推定された対数圧縮度数異なり数ベクトルを算出する。更に、異なり数算出部12は、その母集団の推定された対数圧縮度数異なり数ベクトルの要素の総和を、母集団の異なり数の推定値とする。対数圧縮度数異なり数ベクトルは、度数異なり数ベクトルを対数圧縮二項確率行列に合うように圧縮したベクトルである。   Then, the different number calculation unit 12 compresses the frequency vector of the sample extracted from the population, obtains a logarithm compression frequency difference number vector, obtains the logarithm compression frequency difference number vector of the sample, and the logarithm compression A number vector different from the estimated logarithmic compression degree of the population is calculated by the product of the binomial probability matrix and the inverse matrix. Furthermore, the different number calculation unit 12 sets the sum of the elements of the logarithmic compression degree different number vector estimated for the population as an estimated value of the number of different populations. The logarithmically compressed frequency difference number vector is a vector obtained by compressing the frequency difference number vector so as to fit the logarithm compression binary probability matrix.

このように、母集団の度数異なり数ベクトルと標本群の度数異なり数ベクトルとの関係を示す二項確率行列を行方向および列方向に圧縮した対数圧縮二項確率行列を用いて母集団の異なり数を算出するので、少ない処理量で効率良く異なり数を算出することができる。   In this way, using a logarithm-compressed binary probability matrix that compresses the binomial probability matrix indicating the relationship between the frequency vector of the population and the frequency vector of the sample group in the row and column directions, Since the number is calculated, the number can be calculated efficiently with a small amount of processing.

その際、行列生成部11は、対数圧縮二項確率行列の1つの要素にまとめる二項確率行列における行数は、行番号が大きくなると共に増加し、同じく対数圧縮二項確率行列の1つの要素にまとめる二項確率行列における列数は、列番号が大きくなると共に増加するように圧縮を行う。行番号や列番号が大きくなるにつれて変化が緩やかになる二項確率行列を、行番号や列番号が大きくなるにつれて大きな単位で1つの要素にまとめるので、精度の劣化を抑えつつ処理量を大きく低減することが可能である。   At that time, the matrix generation unit 11 increases the number of rows in the binomial probability matrix to be combined into one element of the logarithm compression binomial probability matrix as the row number increases, and similarly, one element of the logarithm compression binomial probability matrix The number of columns in the binomial probability matrix summarized in (1) is compressed so as to increase as the column number increases. The binomial probability matrix, which changes slowly as the row number and column number increase, is combined into one element in large units as the row number and column number increase, greatly reducing the amount of processing while suppressing deterioration in accuracy. Is possible.

より好ましくは、行列生成部11は、対数圧縮二項確率行列の1つの要素にまとめる二項確率行列における行数は、行番号が大きくなると共に指数関数的に増加し、対数圧縮二項確率行列の1つの要素にまとめる二項確率行列における列数は、列番号が大きくなると共に指数関数的に増加するように圧縮を行うとよい。例えば、2のべき乗個目を切れ目として要素を区切って圧縮を行うとよい。行番号や列番号が大きくなるにつれて対数的に変化が緩やかになる二項確率行列を、行番号や列番号が大きくなるにつれて指数関数的に大きな単位で1つの要素にまとめるので、精度の劣化を抑えつつ処理量を大きく低減することが可能である。   More preferably, the matrix generation unit 11 increases the number of rows in the binomial probability matrix combined into one element of the logarithmic compression binomial probability matrix exponentially as the row number increases, and the logarithm compression binomial probability matrix It is preferable to compress the number of columns in the binomial probability matrix to be integrated into a single element so as to increase exponentially as the column number increases. For example, the compression may be performed by dividing the element with a power of 2 as a break. Since the binomial probability matrix whose logarithmic change gradually increases as the row number or column number increases, it is combined into one element in an exponentially large unit as the row number or column number increases. It is possible to greatly reduce the processing amount while suppressing.

本実施形態の異なり数計数装置の基本的な動作の流れをフローチャートを用いて説明する。   A basic operation flow of the number counting apparatus according to this embodiment will be described with reference to a flowchart.

図2は、本実施形態の異なり数計数装置の動作を示すフローチャートである。図2を参照すると、異なり数計数装置10は、まず、行列生成部11によって、上述のような二項確率による行列を生成する(ステップ101)。続いて、異なり数計数装置10は、その行列と標本とに基づいて、母集団の異なり数を算出する。   FIG. 2 is a flowchart showing the operation of the number counting device, which is different from the present embodiment. Referring to FIG. 2, the different number counting apparatus 10 first generates a matrix based on the binomial probability as described above by the matrix generation unit 11 (step 101). Subsequently, the different number counting device 10 calculates the number of different populations based on the matrix and the sample.

次に、本実施形態の異なり数計数装置による具体的な演算処理について説明する。   Next, a specific calculation process performed by the number counting device according to the present embodiment will be described.

サイズがNの母集団の度数異なり数ベクトルUを式(1)で表し、M個の標本からなる集団の度数異なり数ベクトルVを式(2)で表わす。   A frequency vector U of a population of size N is expressed by equation (1), and a frequency vector V of a population composed of M samples is expressed by equation (2).

Figure 0005925043
Figure 0005925043

Figure 0005925043
Figure 0005925043

母集団から所定の抽出率rで元を抽出したときに、母集団の中に同じものがn個ある元が標本としてk個抽出される確率を要素とするN次行列Pが二項確率行列である。この二項確率行列は、母集団の度数毎に、標本の度数毎の発生確率を表した行列である。二項確率行列は式(3)で表すことができる。i<jならばPij=0である。 When a source is extracted from a population at a predetermined extraction rate r, an Nth-order matrix P whose element is the probability that k elements having the same n in the population are extracted as samples is a binomial probability matrix It is. This binomial probability matrix is a matrix that represents the occurrence probability for each frequency of the sample for each frequency of the population. The binomial probability matrix can be expressed by equation (3). If i <j, then P ij = 0.

Figure 0005925043
Figure 0005925043

これらU、V、Pは式(4)の関係にあり、Vが与えられると、式(5)によりUを推定することができる。   These U, V, and P are in the relationship of Expression (4). When V is given, U can be estimated by Expression (5).

Figure 0005925043
Figure 0005925043

Figure 0005925043
Figure 0005925043

このままでは母集団のサイズNが膨大なときには、二項確率行列Pの巨大なものとなり、逆行列P−1を求めることが難しい。そこで二項確率行列Pを対数化によって圧縮した対数圧縮二項確率行列LPを導入する。対数圧縮二項確率行列LPは、二項確率行列Pに対し、列方向に(2のべき乗)列を区切りとして確率値を合算し、行方向に(2のべき乗÷抽出率)行を区切りとして確率値を平均した行列である。二項確率行列を対数圧縮二項確率行列に圧縮する演算は、行方向に加重平均を求めると共に列方向にの合計値を求める演算としてもよい。各要素の重みは適宜設定すればよい。あるいは、全ての要素に均一の重みを与えても良い。 If the population size N is enormous as it is, the binomial probability matrix P becomes enormous and it is difficult to obtain the inverse matrix P- 1 . Therefore, a logarithmically compressed binomial probability matrix LP obtained by compressing the binomial probability matrix P by logarithmization is introduced. The logarithm-compressed binomial probability matrix LP adds the probability values to the binomial probability matrix P by dividing the columns in the column direction (power of 2) and delimiting the rows in the row direction (power of 2 ÷ extraction rate). It is a matrix that averages the probability values. The operation for compressing the binomial probability matrix into a logarithmic compression binomial probability matrix may be an operation for obtaining a weighted average in the row direction and obtaining a total value in the column direction. What is necessary is just to set the weight of each element suitably. Or you may give a uniform weight to all the elements.

この二項確率行列におけるグループ化して1つにまとめる要素は、行方向および列方向に2のべき乗番目までを切れ目とするグループでまとめられ、グループは行方向および列方向に進むにつれて要素の個数が増大する。   The elements that are grouped together in the binomial probability matrix are grouped into groups that have a break up to the power of 2 in the row direction and the column direction, and the number of elements increases in the row direction and the column direction. Increase.

対数圧縮二項確率行列LPは式(6)で表わすことができる。   The logarithmic compression binomial probability matrix LP can be expressed by Equation (6).

Figure 0005925043
Figure 0005925043

また、度数異なり数ベクトルVも、対数圧縮二項確率行列LPと同様に対数化による圧縮を行う。圧縮化された度数異なり数ベクトル(対数圧縮度数異なり数ベクトル)LVは式(7)で表わすことができる。標本の度数異なり数ベクトルを(2のべき乗)個目を区切りとして、値を合算したものを標本の対数圧縮度数異なり数ベクトルという。抽出率rの標本をもつ母集団の度数異なり数ベクトルを(2のべき乗÷抽出率)個目を区切りとして、値を合算したものを母集団の対数圧縮度数異なり数ベクトルという。   Further, the number vector V different in frequency is also compressed by logarithmization in the same manner as the logarithmic compression binary probability matrix LP. The compressed frequency difference number vector (logarithm compression frequency difference number vector) LV can be expressed by equation (7). A sample obtained by dividing the number vector of the sample with different frequency vectors (power of 2) and summing the values is called a number vector with different logarithmic compression frequency of the sample. A frequency vector of a population having a sample with an extraction rate r is referred to as a power vector of the logarithm compression frequency difference of the population, and the sum of values obtained by dividing the number vector (power of 2 ÷ extraction rate).

Figure 0005925043
Figure 0005925043

そして、Uの推定値は、LPの逆行列LP−1を用いて、式(8)により求めることができる。 Then, the estimated value of U can be obtained by Expression (8) using the inverse matrix LP −1 of LP.

Figure 0005925043
Figure 0005925043

以上のような演算処理により、行列生成部11が式(6)に示される対数圧縮二項確率行列LPの逆行列LP−1を生成し、異なり数算出部12が式(8)により、母集団の度数異なり数ベクトルUの推定値を算出する。 Through the arithmetic processing as described above, the matrix generation unit 11 generates the inverse matrix LP −1 of the logarithmic compression binomial probability matrix LP shown in the equation (6), and the different number calculation unit 12 uses the equation (8) to calculate the mother matrix. The estimated value of the number vector U with different frequency of the group is calculated.

なお、ここでは、演算およびその考え方の理解を容易にするために、二項確率行列Pを求め、それを圧縮することにより対数圧縮二項確率行列LPを生成するような説明をしている。しかし実際には、行列生成部11は、一旦、二項確率行列Pを求めるということをせず、直接、対数圧縮二項確率行列LPを生成する。   Here, in order to facilitate understanding of the calculation and its concept, a description is given of obtaining the binomial probability matrix P and compressing it to generate the logarithmically compressed binomial probability matrix LP. However, actually, the matrix generation unit 11 does not obtain the binomial probability matrix P once, but directly generates the logarithm compression binomial probability matrix LP.

図3は、本実施形態の異なり数計数装置10を組み込んだデータ分析装置20の一例を示すブロック図である。図3を参照すると、データ分析装置20は、図1と同じ行列生成部11および異なり数算出部12に加えて、記憶部21、サイズ算出部22、標本抽出部23、およびデータ分析部24を有している。   FIG. 3 is a block diagram illustrating an example of the data analysis apparatus 20 in which the number counting apparatus 10 according to the present embodiment is incorporated. Referring to FIG. 3, the data analysis apparatus 20 includes a storage unit 21, a size calculation unit 22, a sample extraction unit 23, and a data analysis unit 24 in addition to the same matrix generation unit 11 and different number calculation unit 12 as those in FIG. 1. Have.

記憶部21は、母集団のデータ群を蓄積している。一例として、あるサーバへのアクセスデータを蓄積したアクセスログのデータ群を母集団とする。図4は、アクセスログの一例を模式的に示した図である。このアクセスログは、あるサーバへのアクセスデータを時系列に蓄積したものである。アクセスログには、個々のアクセスについて、アクセス番号(No.)、発IPアドレス、およびユーザIDを含む各種項目が蓄積されている。アクセス番号は、サーバへのアクセスが発生した順に各アクセスに付与されるシリアル番号である。発IPアドレスは、アクセス元のIPアドレスであり、アクセス元のユーザの識別に用いられる。利用時間は、そのアクセスによるサイト閲覧等の利用が継続した時間である。   The storage unit 21 stores a population data group. As an example, a data group of access logs in which access data for a certain server is accumulated is defined as a population. FIG. 4 is a diagram schematically illustrating an example of an access log. This access log stores access data to a certain server in time series. In the access log, various items including an access number (No.), an originating IP address, and a user ID are stored for each access. The access number is a serial number assigned to each access in the order in which access to the server occurs. The source IP address is the IP address of the access source, and is used for identifying the user of the access source. The usage time is the time during which the use of browsing the site by the access has been continued.

サイズ算出部22は、記憶部21に蓄積されている母集団のデータ群のサイズすなわち元の個数を算出し、行列生成部11および標本抽出部23に通知する。例えば、サイズ算出部22は、ログカウンタを有し、記憶部21に1件のアクセスの情報が格納されるたびに、ログカウンタをカウントアップすることにより、データ群のサイズを計数することにしてもよい。あるいは、サイズ算出部22は、母集団のデータ群のサイズの情報が必要になったときに、記憶部21におけるアクセスログの有効領域の大きさからアクセスログのサイズを算出することにしてもよい。   The size calculation unit 22 calculates the size of the population data group accumulated in the storage unit 21, that is, the original number, and notifies the matrix generation unit 11 and the sample extraction unit 23. For example, the size calculation unit 22 has a log counter, and counts the size of the data group by counting up the log counter each time information on one access is stored in the storage unit 21. Also good. Alternatively, the size calculation unit 22 may calculate the size of the access log from the size of the effective area of the access log in the storage unit 21 when information on the size of the population data group is needed. .

標本抽出部23は、サイズ算出部22から通知された母集団のサイズと、与えられた抽出率とに基づて、母集団から抽出すべき標本の個数を算出し、その個数の標本を記憶部21の母集団のデータ群から抽出する。例えば、母集団のサイズに抽出率を乗算すれば、母集団から抽出すべき標本の個数が得られる。抽出された標本は、異なり数算出部12に通知される。   The sample extraction unit 23 calculates the number of samples to be extracted from the population based on the size of the population notified from the size calculation unit 22 and the given extraction rate, and stores the number of samples. Extracted from the data group of the population of the section 21. For example, if the size of the population is multiplied by the extraction rate, the number of samples to be extracted from the population can be obtained. The extracted sample is notified to the number calculation unit 12 differently.

行列生成部11は、与えられた抽出率と、サイズ算出部22から通知されたサイズとに基づいて、対数圧縮二項確率行列LPの逆行列LP−1を生成し、異なり数算出部12に通知する。具体的には、通知されたサイズによって二項確率行列Pの行数および列数が定まる。例えば、通知されたサイズ以上であり、対数圧縮における圧縮の単位が完成する最小限の行数および列数を用いることにしてもよい。式(3)によって、抽出率から二項確率行列Pの各要素が定まる。更に、式(6)によって、二項確率行列Pの各要素から対数圧縮二項確率行列LPが定まる。 The matrix generation unit 11 generates an inverse matrix LP −1 of the logarithmic compression binomial probability matrix LP based on the given extraction rate and the size notified from the size calculation unit 22, and the difference calculation unit 12 Notice. Specifically, the number of rows and the number of columns of the binomial probability matrix P are determined by the notified size. For example, the minimum number of rows and the number of columns that are not less than the notified size and that complete the compression unit in logarithmic compression may be used. By Equation (3), each element of the binomial probability matrix P is determined from the extraction rate. Furthermore, the logarithm compression binomial probability matrix LP is determined from each element of the binomial probability matrix P by Expression (6).

異なり数算出部12は、行列生成部11から通知された逆行列LP−1と、標本抽出部23で抽出された標本群とに基づいて、母集団の異なり数Uの推定値を算出する。標本群を分析することにより、その度数異なり数ベクトルVを算出することができる。式(7)によって、その度数異なり数ベクトルVを対数圧縮し、対数圧縮度数異なり数ベクトルLVを得ることができる。そして、式(8)によって、この対数圧縮二項確率行列LPと、対数圧縮二項確率行列LVの逆行列LP−1とから、母集団の異なり数Uの推定値を算出することができる。算出された母集団の異なり数Uの推定値はデータ分析部24に通知される。例えば、異なり数算出部12は、算出した母集団の異なり数Uの推定値を記憶部21に記録し、データ分析部24は、記憶部21からその異なり数Uの推定値を読み出す。 The difference number calculation unit 12 calculates an estimated value of the difference number U of the population based on the inverse matrix LP -1 notified from the matrix generation unit 11 and the sample group extracted by the sample extraction unit 23. By analyzing the sample group, the number vector V can be calculated differently. According to Expression (7), the number vector V different in frequency can be logarithmically compressed to obtain a number vector LV different in logarithmic compression frequency. Then, the estimated value of the number U of different populations can be calculated from the logarithm-compressed binomial probability matrix LP and the inverse matrix LP −1 of the logarithmic-compressed binomial probability matrix LV by Expression (8). The calculated estimated value of the number U of different populations is notified to the data analysis unit 24. For example, the different number calculation unit 12 records the estimated value of the calculated different number U of the population in the storage unit 21, and the data analysis unit 24 reads the estimated value of the different number U from the storage unit 21.

データ分析部24は、異なり数算出部12で算出された異なり数の推定値を利用して、記憶部21に蓄積されてるデータ群の分析を行う。例えば、データ群のソーティングにおいて異なり数を利用することでソーティング処理を高速化することができる。例えば、データ分析部24は、例えば、図4に示したアクセスログから、アクセス解析結果データを生成してもよい。図5は、アクセス解析結果データの一例を模式的に示した図である。アクセス解析結果データには、各ユーザについてのユーザID、アクセス回数、および平均利用時間等の項目のデータが含まれている。ユーザの異なり数がユーザ数を示し、そのユーザ数分の記憶領域を確保することが必要となる。データ分析部24は、例えば、ユーザ数分の記憶領域を予め確保し、各ユーザについての各項目のデータを算出し、記録することにしてもよい。   The data analysis unit 24 analyzes the data group accumulated in the storage unit 21 using the estimated value of the different number calculated by the different number calculation unit 12. For example, the sorting process can be speeded up by using different numbers in sorting of data groups. For example, the data analysis unit 24 may generate access analysis result data from, for example, the access log illustrated in FIG. FIG. 5 is a diagram schematically illustrating an example of access analysis result data. The access analysis result data includes data of items such as the user ID, the number of accesses, and the average usage time for each user. The number of different users indicates the number of users, and it is necessary to secure storage areas for the number of users. For example, the data analysis unit 24 may secure storage areas for the number of users in advance and calculate and record data for each item for each user.

続いて、上述した実施形態における更に具体的な実施例について説明する。   Next, more specific examples in the above-described embodiment will be described.

本実施例の異なり数計数装置の基本的な構成は図1に示したものと同じであり、基本的な動作は図2に示したものと同じである。以下、本実施例における各詳細処理について説明する。   Unlike the present embodiment, the basic configuration of the number counting apparatus is the same as that shown in FIG. 1, and the basic operation is the same as that shown in FIG. Hereinafter, each detailed process in a present Example is demonstrated.

図6は、母集団から標本を抽出する様子を示す図である。ここでは標本の抽出率を50%としている。図中で大きな文字で書かれた要素が標本として抽出される要素である。   FIG. 6 is a diagram illustrating how a sample is extracted from a population. Here, the sample extraction rate is 50%. Elements written in large letters in the figure are extracted as samples.

度数が大きいければ、母集団における異なり数と標本における異なり数はほとんど変わらない。図6(a)では、母集団の異なり数と標本の異なり数がともに4であり、変わっていない。一方、度数が小さいと、標本における異なり数は母集団における異なり数から減少する。図6(b)では、母集団の異なり数が4であり、標本の異なり数が2である。   If the frequency is large, the number of differences in the population and the number of differences in the sample are almost the same. In FIG. 6A, the number of different populations and the number of different samples are both 4, which are not changed. On the other hand, when the frequency is small, the number of differences in the sample decreases from the number of differences in the population. In FIG. 6B, the number of different populations is 4, and the number of different samples is 2.

度数nの要素からk個の要素が抽出される確率は、式(9)の二項確率で示すことができる。   The probability that k elements are extracted from the element of frequency n can be represented by the binomial probability of Expression (9).

Figure 0005925043
Figure 0005925043

ここで、要素の度数がfである異なり数をf−度数異なり数Uと呼ぶことにする。 Here, the different number in which the frequency of the element is f will be referred to as f−frequency different number U f .

図7は、f−度数異なり数Uについて説明するための図である。図7を参照すると、Aの度数だけが10なので、10−度数異なり数U10=1である。また、BとCの度数が3なので、3−度数異なり数U=2である。DとEとFの度数が2なので、2−度数異なり数U=3である。GとHとIとJとKの度数が1なので、5−度数異なり数U=5である。また、全体の異なり数は全てのf−度数異なり数の合計なので11である。 FIG. 7 is a diagram for explaining the number U f different from f−frequency. Referring to FIG. 7, since only the frequency of A is 10, the number U 10 = 1 differs from 10−frequency. Further, since the frequency of B and C is 3, the number U 3 = 2 is different from the 3-frequency. Since the frequencies of D, E, and F are 2, the number U 2 = 3, which is different from the 2-frequency. Since the frequencies of G, H, I, J, and K are 1, 5 is different and the number U 1 = 5. The total number of differences is 11 because it is the sum of all f-frequency differences.

式(1)や式(2)などで上述した度数異なり数ベクトルは、f−度数異なり数を度数毎の要素とするベクトルである。   The frequency difference number vector described above in Expression (1), Expression (2), and the like is a vector having f-frequency difference numbers as elements for each frequency.

標本のk−度数異なり数の期待値V^は、母集団のn−度数異なり数Uと、式(9)の二項確率とを用いて、式(10)のように示すことができる。 The expected value V k ^ of the k-frequency difference number of the sample can be expressed as in Expression (10) using the n-frequency difference number U n of the population and the binomial probability of Expression (9). it can.

Figure 0005925043
Figure 0005925043

サイズがNの母集団の度数異なり数ベクトルU=(U,・・・,U)と、標本の度数異なり数ベクトルV=(V,・・・,V)は、上述のように、それぞれ式(1)と式(2)に示される。 The frequency difference number vector U = (U 1 ,..., U N ) of the population of size N and the sample frequency difference number vector V = (V 1 ,..., V N ) are as described above. Are shown in equations (1) and (2), respectively.

ここで、式(3)として上述した、二項確率を要素とするN次行列である二項確率行列Pを利用すると、式(4)が成り立つ。よって、式(5)によって、標本の異なり数Uの推定値U^は、式(5)によって得られる。   Here, when the binomial probability matrix P, which is an Nth-order matrix having binomial probabilities as elements, is used as the expression (3), the expression (4) is established. Therefore, the estimated value U ^ of the number U of different samples is obtained by the equation (5).

Figure 0005925043
Figure 0005925043

Figure 0005925043
Figure 0005925043

Figure 0005925043
Figure 0005925043

図8は、二項確率行列による近似の原理をトイモデルで示した図である。   FIG. 8 is a diagram showing the principle of approximation by a binomial probability matrix using a toy model.

上述のように、本発明の実施形態および実施例では、二項確率行列を用いて、標本の度数異なり数ベクトルから、母集団の度数異なり数ベクトルを近似的に算出するものである。この二項確率行列はは圧縮を行っていないものである。   As described above, according to the embodiments and examples of the present invention, the frequency difference vector of the population is approximately calculated from the frequency vector of the sample using the binomial probability matrix. This binomial probability matrix is not compressed.

図8参照すると、サイズ222の母集団から抽出率50%で標本を抽出している。   Referring to FIG. 8, a sample is extracted from a population of size 222 at an extraction rate of 50%.

母集団の度数異なり数ベクトルを見ると、1−度数異なり数=121であり、2−度数異なり数=27であり、3−度数異なり数=10であり、4−度数異なり数=3であり、5−度数異なり数=1である。母集団全体の異なり数は162である。ただし、実際には母集団の各異なり数は未知である。   Looking at the frequency vector of the population, 1-frequency difference number = 121, 2-frequency difference number = 27, 3-frequency difference number = 10, 4-frequency difference number = 3. , 5-difference number = 1. The total number of differences in the entire population is 162. In practice, however, the number of different populations is unknown.

実際に抽出された標本の度数異なり数ベクトルを見ると、1−度数異なり数=87であり、2−度数異なり数=10であり、3−度数異なり数=3であり、4−度数異なり数=0であり、5−度数異なり数=0である。母集団全体の異なり数は100である。この標本の各異なり数は既知である。   Looking at the frequency difference number vector of the actually extracted sample, 1-frequency difference number = 87, 2-frequency difference number = 10, 3-frequency difference number = 3, 4-frequency difference number = 0, and the number is different from 5−number = 0. The total number of differences in the whole population is 100. Each different number of this specimen is known.

この標本の度数異なり数ベクトルと、二項確率行列(圧縮していないもの)の逆行列との積として算出される、母集団の度数異なり数ベクトルの推定値は、1−度数異なり数=152であり、2−度数異なり数=4であり、3−度数異なり数=24であり、4−度数異なり数=0であり、5−度数異なり数=0である。母集団全体の異なり数の推定値は180となり、ある程度の誤差内で異なり数の推定ができていることが分かる。   The estimated value of the frequency difference vector of the population calculated as the product of the frequency vector of this sample and the inverse matrix of the binomial probability matrix (uncompressed) is 1−frequency difference number = 152 And 2-frequency difference number = 4, 3-frequency difference number = 24, 4-frequency difference number = 0, and 5-frequency difference number = 0. The estimated value of the number of differences in the entire population is 180, and it can be seen that the number of differences can be estimated within a certain amount of error.

図9は、二項確率行列を圧縮する様子を示す図である。   FIG. 9 is a diagram illustrating how the binomial probability matrix is compressed.

図9の右側には、圧縮されていない二項確率行列の一部が示され、左側には、その二項確率行列を圧縮した対数圧縮二項確率行列が示されている。   The right side of FIG. 9 shows a part of the uncompressed binomial probability matrix, and the left side shows a logarithmically compressed binary probability matrix obtained by compressing the binomial probability matrix.

右側の二項確率行列は、母集団の度数異なり数ベクトルとの積が標本の度数異なり数ベクトルとなるように要素として二項確率を配置した行列である。この二項確率行列を行方向および列方向に圧縮したものが、左側の対数圧縮二項確率行列である。   The binomial probability matrix on the right is a matrix in which binomial probabilities are arranged as elements so that the product of the population frequency vector and the number vector differs from the sample frequency vector. A logarithm-compressed binary probability matrix on the left side is obtained by compressing the binomial probability matrix in the row direction and the column direction.

二項確率行列の複数の要素が対数圧縮二項確率行例では1つの要素にまとめられている。二項確率行列の複数の要素が対数圧縮二項確率行列の1つの要素にまとめられる様子が図9では破線矢印で示されている。   A plurality of elements of the binomial probability matrix are combined into one element in the logarithm-compressed binomial probability example. A state in which a plurality of elements of the binomial probability matrix are combined into one element of the logarithmic compression binomial probability matrix is indicated by a broken line arrow in FIG.

対数圧縮二項確率行列の1つの要素にまとめる二項確率行列における行数は、行番号が大きくなると共に指数関数的に増加し、対数圧縮二項確率行列の1つの要素にまとめる二項確率行列における列数は、列番号が大きくなると共に指数関数的に増加するように圧縮を行っている。まとめる要素の個数が増えれば処理量削減の効果が増大する。   The number of rows in the binomial probability matrix combined into one element of the logarithmic compression binomial probability matrix increases exponentially as the row number increases, and is combined into one element of the logarithmic compression binomial probability matrix. The number of columns in is compressed so as to increase exponentially as the column number increases. As the number of elements to be collected increases, the effect of reducing the amount of processing increases.

図10は、二項確率行列における要素の分布の様子を示す図である。図10において、二項確率で示される要素の値の変化が山型の曲線によって示されている。これを見ると、二項確率行列では、行番号や列番号が大きくなるにつれて対数的に変化が緩やかになっていることが分かる。このように行番号や列番号が大きくなるにつれて対数的に変化が緩やかになる二項確率行列を、本実施例では、行番号や列番号が大きくなるにつれて指数関数的に大きな単位で1つの要素にまとめるので、精度の劣化を抑えつつ処理量を大きく低減することが可能となっている。   FIG. 10 is a diagram illustrating the distribution of elements in the binomial probability matrix. In FIG. 10, the change in the value of the element indicated by the binomial probability is indicated by a mountain-shaped curve. From this, it can be seen that, in the binomial probability matrix, the logarithmic change gradually decreases as the row number or column number increases. As described above, a binomial probability matrix whose logarithmically changes gradually as the row number or the column number increases, in this embodiment, one element in an exponentially large unit as the row number or the column number increases. Therefore, it is possible to greatly reduce the processing amount while suppressing deterioration in accuracy.

図11は、度数異なり数ベクトルを圧縮する様子を示す図である。   FIG. 11 is a diagram showing a state in which a number vector is compressed differently.

図11を参照すると、母集団の度数異なり数ベクトルにおける度数3〜4の2つの要素が、母集団の対数圧縮度数異なり数ベクトルにおける1つの要素に圧縮されている。ここでの圧縮は、3−度数異なり数と4−度数異なり数を合計して1つの要素にする演算である。   Referring to FIG. 11, two elements of frequencies 3 to 4 in the population frequency difference number vector are compressed into one element in the population logarithm compression frequency difference number vector. The compression here is an operation of adding the number different from 3-frequency and the number different from 4-frequency into one element.

同じように、標本の度数異なり数ベクトルにおける度数5〜8の4つの要素が、母集団の対数圧縮度数異なり数ベクトルにおける1つの要素に圧縮されている。圧縮は、53−度数異なり数〜8−度数異なり数を合計して1つの要素にする演算である。   Similarly, four elements of frequencies 5 to 8 in the number vector different in frequency of the sample are compressed into one element in the number vector in the logarithm compression frequency difference of the population. Compression is an operation in which the number of 53-frequency differences and the number of 8-frequency differences are summed into one element.

図12は、対数圧縮二項確率行列による近似の原理を示した図である。   FIG. 12 is a diagram showing the principle of approximation using a logarithmic compression binomial probability matrix.

本実施例では、圧縮二項確率行列を用いて、標本の度数異なり数ベクトルから、母集団の度数異なり数ベクトルを近似的に算出するものである。この例では、抽出率が1/256である。また、図8とは異なり、この例では行列および度数異なり数ベクトルの圧縮を行ってる。   In the present embodiment, the frequency vector of the population frequency difference is approximately calculated from the frequency vector of the sample frequency using the compressed binomial probability matrix. In this example, the extraction rate is 1/256. Further, unlike FIG. 8, in this example, the compression of the number vector differs from the matrix and the frequency.

図12を参照すると、サイズ=7524682の母集団から抽出率1/256で標本を抽出している。   Referring to FIG. 12, a sample is extracted from a population of size = 7524682 at an extraction rate of 1/256.

母集団の対数圧縮度数異なり数ベクトルを見ると、256−度数異なり数=1708であり、512−度数異なり数=454であり、1024−度数異なり数=64であり、2048−度数異なり数=21である。母集団全体の異なり数は2248である。ただし、実際には母集団の各異なり数は未知である。   Looking at the logarithm compression frequency difference number vector of the population, 256-frequency difference number = 1708, 512-frequency difference number = 454, 1024-frequency difference number = 64, 2048-frequency difference number = 21. It is. The total number of differences in the entire population is 2248. In practice, however, the number of different populations is unknown.

実際に抽出された標本の対数圧縮度数異なり数ベクトルを見ると、1−度数異なり数=480であり、2−度数異なり数=213であり、4−度数異なり数=134であり、8−度数異なり数=34である。母集団全体の異なり数は100である。この標本の各異なり数は既知である。   Looking at the logarithm compression frequency difference number vector of the actually extracted sample, 1-frequency difference number = 480, 2-frequency difference number = 213, 4-frequency difference number = 134, 8-frequency The difference number = 34. The total number of differences in the whole population is 100. Each different number of this specimen is known.

この標本の度数異なり数ベクトルと、二項確率行列(圧縮していないもの)の逆行列との積として算出される、母集団の度数異なり数ベクトルの推定値は、1−度数異なり数=152であり、2−度数異なり数=4であり、3−度数異なり数=24であり、4−度数異なり数=0である。母集団全体の異なり数の推定値は1790となり、ある程度の誤差内で異なり数の推定ができていることが分かる。   The estimated value of the frequency difference vector of the population calculated as the product of the frequency vector of this sample and the inverse matrix of the binomial probability matrix (uncompressed) is 1−frequency difference number = 152 The 2-frequency difference number = 4, the 3-frequency difference number = 24, and the 4-frequency difference number = 0. The estimated value of the number of differences in the entire population is 1790, and it can be seen that the number of differences can be estimated within a certain amount of error.

以下、データを用いて異なり数計数において異なり数の推定精度がどの程度かを実験結果によって示す。
(推定実験1)
Hereinafter, it will be shown by experimental results how the estimation accuracy of different numbers is different in the number counting using data.
(Estimation experiment 1)

商品購入の取引で記録される購買取引データにおける異なり数の推定精度の実験結果について説明する。   An experimental result of the estimation accuracy of the number of differences in the purchase transaction data recorded in the product purchase transaction will be described.

母集団として、10種類のデータ項目をもつ1000万件の購買履歴データを用いた。すなわち、この購買取引データには、取引日、取引店、取引額など様々な変数があるが、ここではその中から10個の変数(データ項目)を選んだ。また、抽出率として、1/4、1/16、1/64、1/256、1/1024について計算を行った。   As a population, 10 million purchase history data having 10 kinds of data items were used. That is, the purchase transaction data includes various variables such as a transaction date, a transaction store, and a transaction amount. Here, ten variables (data items) are selected. Moreover, calculation was performed about 1/4, 1/16, 1/64, 1/256, and 1/1024 as extraction rates.

図13は、推定実験1において抽出率を変えて推定精度を比較した結果を示す図である。変数は、ある一つの変数v5を固定的に用いている。対真値は、真の値に対する推定値を示している。   FIG. 13 is a diagram illustrating a result of comparing the estimation accuracy by changing the extraction rate in the estimation experiment 1. As a variable, one variable v5 is fixedly used. The true value indicates an estimated value for the true value.

図13を見て分かるように、抽出率が下がると推定精度の低下するが、1/64程度の抽出率であれば推定精度65%が得られている。   As can be seen from FIG. 13, when the extraction rate decreases, the estimation accuracy decreases. However, if the extraction rate is about 1/64, an estimation accuracy of 65% is obtained.

図14は、推定実験1において変数と抽出率を変えて推定精度を比較した結果を示す図である。図15は、図14の結果における対真値をグラフ化した図である。図15において、推定誤差が35%に収まってるプロットが破線で囲まれている。これを見て分かるように、実験に用いた10個の変数のうち8個の変数において、抽出率1/65以上では、推定誤差が35%以内に収まっていることが分かる。
(推定実験2)
FIG. 14 is a diagram illustrating a result of comparing estimation accuracy by changing a variable and an extraction rate in the estimation experiment 1. FIG. 15 is a graph showing the true value in the result of FIG. In FIG. 15, a plot in which the estimation error is within 35% is surrounded by a broken line. As can be seen from this, it can be seen that the estimation error is within 35% at the extraction rate of 1/65 or more in 8 of the 10 variables used in the experiment.
(Estimation experiment 2)

全国の世帯数を母集団とし、抽出率1/16の世帯の苗字データから、全国世帯の苗字数を推定した実験結果について説明する。   The experimental results of estimating the number of surnames of households nationwide from the surname data of households with a sampling rate of 1/16 will be described.

全国の世帯数は、国勢調査により、約5000万世帯であることが分かっている。抽出率1/16の標本として、3123979世帯の苗字データを用いた。ただし、無作為抽出は行っていない。   According to the national census, the number of households nationwide is about 50 million. Last name data of 3123979 households was used as a sample with an extraction rate of 1/16. However, random sampling is not performed.

図16は、推定実験2における推定実験結果を示す図である。異なり数が70506の標本から算出した母集団の異なり数は131265である。   FIG. 16 is a diagram illustrating an estimation experiment result in the estimation experiment 2. The number of different populations calculated from samples with 70506 different numbers is 131265.

苗字の個数には、十数万から30万と諸説がある。この幅の広さには新字と旧字の扱いによる差異が大きく影響している。したがって、旧字を用いた苗字と新字を用いた苗字を合算すると、その幅の中の小さい方の値になることが考えられる。   There are various theories of surnames from dozens of thousands to 300,000. The breadth of this width is greatly affected by the difference between the new and old characters. Therefore, when the last name using the old letter and the last letter using the new letter are added together, it may be the smaller value in the width.

本推定実験では、旧字を用いた苗字を新字を用いた苗字に寄せるように合算している。したがって、131265という推定値は、十数万という苗字数とよく合っていると言える。   In this estimation experiment, the surnames using the old letters are added to the surnames using the new letters. Therefore, it can be said that the estimated value of 131265 matches well with the number of surnames of several ten thousand.

以上、上述した本発明の実施形態および実施例は、本発明の説明のための例示であり、本発明の範囲をそれらの実施形態あるいは実施例のみに限定する趣旨ではない。当業者は、本発明の要旨を逸脱することなしに、他の様々な態様で本発明を実施することができる。   The embodiments and examples of the present invention described above are examples for explaining the present invention, and are not intended to limit the scope of the present invention to only those embodiments or examples. Those skilled in the art can implement the present invention in various other modes without departing from the gist of the present invention.

また、上述した実施形態および実施例の装置は、装置を構成する各部の処理手順を規定したソフトウェアプログラムをコンピュータに実行させることにより実現することができるものである。その場合、各部の間におけるデータの通知はメモリやレジスタ等のデータ格納領域を介して行われることにしてもよい。送り側の処理において、通知しようとするデータをデータ格納領域に格納し、受け側の処理において、そのデータ格納領域からデータを読み出せばよい。   In addition, the devices of the above-described embodiments and examples can be realized by causing a computer to execute a software program that defines the processing procedure of each unit constituting the device. In that case, notification of data between the respective units may be performed via a data storage area such as a memory or a register. The data to be notified may be stored in the data storage area in the sending process, and the data may be read from the data storage area in the receiving process.

10…異なり数計数装置、11…行列生成部、12…異なり数算出部、20…データ分析装置、21…記憶部、22…サイズ算出部、23…標本抽出部、24…データ分析部
DESCRIPTION OF SYMBOLS 10 ... Different number counting apparatus, 11 ... Matrix generation part, 12 ... Different number calculation part, 20 ... Data analysis apparatus, 21 ... Memory | storage part, 22 ... Size calculation part, 23 ... Sample extraction part, 24 ... Data analysis part

Claims (8)

データ群からなる母集団の異なり数を計数するための異なり数計数方法であって、
行列生成手段が、前記母集団のサイズと、前記母集団から標本を抽出する抽出率とに基づき、前記母集団の度数毎の異なり数を示した度数異なり数ベクトルと、前記母集団から前記抽出率で抽出された標本の度数毎の異なり数を示した度数異なり数ベクトルとの関係を規定する行列を生成するステップと、
異なり数算出手段が、前記行列生成手段で生成された前記行列と、前記母集団から前記抽出率で抽出された標本とに基づいて、前記母集団の異なり数の推定値を算出するステップと、を有する異なり数計数方法。
A different number counting method for counting the number of different populations of data groups,
Matrix generating means, based on the size of the population and the extraction rate for extracting a sample from the population, a frequency difference number vector indicating the number of differences for each frequency of the population, and the extraction from the population Generating a matrix that defines a relationship with a frequency vector that indicates the number of different samples for each frequency sampled at a rate;
A different number calculating means, based on the matrix generated by the matrix generating means and a sample extracted from the population at the extraction rate, calculating an estimated value of the different number of the population; Having different number counting method.
前記行列は、前記母集団の度数異なり数ベクトルとの積が前記標本の度数異なり数ベクトルとなるように要素として確率を配置した二項確率行列を行方向および列方向に圧縮した圧縮行列の逆行列であり、
前記異なり数算出手段は、前記母集団から抽出された前記標本の度数異なり数ベクトルを圧縮した圧縮度数異なり数ベクトルと前記逆行列との積により、前記母集団の推定された圧縮度数異なり数ベクトルを算出し、該母集団の推定された圧縮度数異なり数ベクトルの要素の総和を、前記母集団の異なり数の推定値とする、
請求項1に記載の異なり数計数方法。
The matrix is the inverse of a compressed matrix obtained by compressing the binomial probability matrix in which probabilities are arranged as elements so that the product of the population frequency vector and the number vector differs from the sample frequency vector. Matrix
The different number calculation means includes a compression frequency difference number vector obtained by compressing the frequency difference number vector of the sample extracted from the population and a product of the estimated compression frequency difference number vector of the population by a product of the inverse matrix and the inverse matrix. And the sum of the elements of the number vector of the number of different compression degrees estimated for the population is an estimated value of the number of differences of the population,
The different number counting method according to claim 1.
前記二項確率行列における行方向に所定行目までを切れ目とし、列方向に所定列目までを切れ目とするグループによって要素をグループ化し、グループ毎に要素をまとめた行列である圧縮行列において、前記グループの行数は行番号が大きくなると共に増加し、前記グループの列数は列番号が大きくなると共に増加する、
請求項2に記載の異なり数計数方法。
In the compression matrix, which is a matrix in which elements are grouped by a group in which up to a predetermined line in the row direction in the binomial probability matrix is cut and a predetermined line is cut in the column direction, and the elements are grouped for each group, The number of rows in the group increases as the row number increases, and the number of columns in the group increases as the column number increases.
The different number counting method according to claim 2.
前記圧縮行列は、前記二項確率行列における行方向に2のべき乗番目の要素までを切れ目とし、列方向に2のべき乗番目の要素までを切れ目とするグループによって要素をグループ化し、グループ毎に要素をまとめた行列である、
請求項3に記載の異なり数計数方法。
In the binary matrix, the compression matrix groups elements by a group in which up to a power-of-two element in the row direction and a power of up to a power-of-two element in the column direction. Is a matrix that summarizes
The method for counting different numbers according to claim 3.
前記圧縮行列を求める演算は、前記二項確率行列の行方向に要素の加重平均を求めると共に列方向に要素の合計値を求める演算である、請求項2から4のいずれか一項に記載の異なり数計数装置。   The calculation for obtaining the compression matrix is an operation for obtaining a weighted average of elements in a row direction of the binomial probability matrix and obtaining a total value of elements in a column direction. Different number counting device. 前記行列生成手段は、式(1)により前記抽出率rから求まる二項確率行列Pの各要素を用いて、式(2)により対数圧縮二項確率行列LPを求め、前記圧縮行列として用いる、請求項2から5のいずれか一項に記載の異なり数計数方法。
Figure 0005925043
The matrix generation means uses the elements of binomial probability matrix P obtained from the extraction ratio r according to equation (1), determine the I Ri logarithmic compression binomial probability matrix LP in equation (2), said compression matrix The different number counting method according to any one of claims 2 to 5, which is used as :
Figure 0005925043
データ群からなる母集団の異なり数を計数する異なり数計数装置であって、
前記母集団のサイズと、前記母集団から標本を抽出する抽出率とに基づき、前記母集団の度数毎の異なり数を示した度数異なり数ベクトルと、前記母集団から前記抽出率で抽出された標本の度数毎の異なり数を示した度数異なり数ベクトルとの関係を規定する行列を生成する行列生成手段と、
前記行列生成手段で生成された前記行列と、前記母集団から前記抽出率で抽出された標本とに基づいて、前記母集団の異なり数の推定値を算出する異なり数算出手段と、を有する異なり数計数装置。
A different number counting device for counting different numbers of populations of data groups,
Based on the size of the population and the extraction rate for extracting a sample from the population, the frequency difference vector indicating the number of differences for each frequency of the population and the extraction rate extracted from the population Matrix generating means for generating a matrix that defines a relationship with a frequency difference number vector indicating a difference number for each frequency of a sample;
A different number calculating means for calculating an estimated value of a different number of the population based on the matrix generated by the matrix generating means and a sample extracted from the population at the extraction rate. Number counting device.
ータ群からなる母集団の異なり数を計数させるための異なり数計数プログラムであって、
コンピュータを、
前記母集団のサイズと、前記母集団から標本を抽出する抽出率とに基づき、前記母集団の度数毎の異なり数を示した度数異なり数ベクトルと、前記母集団から前記抽出率で抽出された標本の度数毎の異なり数を示した度数異なり数ベクトルとの関係を規定する行列を生成する行列生成手段と、
前記行列生成手段で生成された前記行列と、前記母集団から前記抽出率で抽出された標本とに基づいて、前記母集団の異なり数の推定値を算出する異なり数算出手段、として機能させるための異なり数計数プログラム。
A different number counting program for counting the number of different population consisting of data groups,
Computer
Based on the size of the population and the extraction rate for extracting a sample from the population, the frequency difference vector indicating the number of differences for each frequency of the population, and the extraction rate extracted from the population Matrix generating means for generating a matrix that defines a relationship with a frequency difference number vector indicating a difference number for each frequency of a sample;
In order to function as a different number calculation unit that calculates an estimated value of a different number of the population based on the matrix generated by the matrix generation unit and a sample extracted from the population at the extraction rate. Different number counting program.
JP2012104395A 2012-05-01 2012-05-01 Different number counting method, apparatus, and program Active JP5925043B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012104395A JP5925043B2 (en) 2012-05-01 2012-05-01 Different number counting method, apparatus, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012104395A JP5925043B2 (en) 2012-05-01 2012-05-01 Different number counting method, apparatus, and program

Publications (2)

Publication Number Publication Date
JP2013232139A JP2013232139A (en) 2013-11-14
JP5925043B2 true JP5925043B2 (en) 2016-05-25

Family

ID=49678505

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012104395A Active JP5925043B2 (en) 2012-05-01 2012-05-01 Different number counting method, apparatus, and program

Country Status (1)

Country Link
JP (1) JP5925043B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4266379B2 (en) * 2006-02-20 2009-05-20 日本電信電話株式会社 Traffic information aggregation system and method
JP4339342B2 (en) * 2006-08-31 2009-10-07 日本電信電話株式会社 Different number counting method, different number counting device, and different number counting system
US20080086444A1 (en) * 2006-10-09 2008-04-10 International Business Machines Corporation System and method for improving cardinality estimation in a relational database management system

Also Published As

Publication number Publication date
JP2013232139A (en) 2013-11-14

Similar Documents

Publication Publication Date Title
CN110058977B (en) Monitoring index abnormity detection method, device and equipment based on stream processing
CN107122669B (en) Method and device for evaluating data leakage risk
CN106599686A (en) Malware clustering method based on TLSH character representation
US20140201133A1 (en) Pattern extraction apparatus and control method therefor
US11443065B2 (en) Systems and methods for obscuring data from a data source
CN112434208A (en) Training of isolated forest and identification method and related device of web crawler of isolated forest
Yao et al. A study of the performance of general compressors on log files
JP2008525897A (en) System and method for adaptive query identification and acceleration
CN113342564A (en) Log auditing method and device, electronic equipment and medium
Harnik et al. Sketching volume capacities in deduplicated storage
CN106168968A (en) A kind of Website classification method and device
CN110851317A (en) Method, device, equipment and storage medium for predicting IOPS performance data of storage equipment
JP5925043B2 (en) Different number counting method, apparatus, and program
JP5925044B2 (en) Different number counting method, apparatus, and program
JP2017188004A (en) Computing for analyzing time series variation of submission of specific theme in social media in tracing manner
EP2219121A1 (en) Efficient computation of ontology affinity matrices
US20160078032A1 (en) Method of on-line media scoring
US20220300609A1 (en) Risk-based alerting for computer security
El Sibai et al. Information technology infrastructure for data streams native filtering
JP2011123652A (en) Data analysis system and method thereof
Cormode et al. Time‐decayed correlated aggregates over data streams
JP3767516B2 (en) Typical sentence analysis method, apparatus, and recording medium
RU2759087C1 (en) Method and system for static analysis of executable files based on predictive models
CN113919514B (en) Sample data acquisition method and device based on threat intelligence
CN109871215B (en) Method and device for software release

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150319

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150408

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20151118

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20151208

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160129

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20160405

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160419

R150 Certificate of patent or registration of utility model

Ref document number: 5925043

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250