Engineering Skills

製品開発エンジニアがデータ解析のノウハウを垂れ流します

実験計画法(5)-ラテン方格

実験計画法のうち、一元配置/二元配置からもう少し発展したラテン方格について述べます。

ラテン方格法

ラテン方格とはn行xn列の表にn個の異なる記号が各行各列に1度だけ現れる表です。ラテン方陣とも呼びます。このラテン方格の各記号に実験水準を割り当てる実験計画法をラテン方格法と呼びます。

f:id:OceanOne:20200911002928p:plain:w300

ラテン方格の名は数学者オイラーによっていて、表中の記号としてローマ字(ラテン文字)を用いたことに由来するそうです。

また2次元のラテン方格をn次元に拡張した物をラテン超方格(Latin hypercube)呼び、これに基づく実験計画法をラテン超方格法(Latin Hypercube Sampling; LHS)と呼びます。


ラテン方格は行、列、表中の記号の3要因の実験と考えることが出来ます。各要因の水準を固定してみた場合(例えば縦の列だけ見た場合)、他の要因は同数回ずつしか現れないので水準和をとると影響がキャンセルされます。

ラテン方格の作り方

簡単な作り方としては、まず1行目の横1列に記号を並べます。

f:id:OceanOne:20200912014843p:plain:h100

2行目には、1行目の1列からn-1列までを一列ずらして2列目以降に割り当てます。そして残った1列目には、1行目の第n列を割り当てます。

f:id:OceanOne:20200912015236p:plain:h100

これをn行目まで繰り返します。

f:id:OceanOne:20200912015328p:plain:h100

このようにしてラテン方格を得ることが出来ます。

f:id:OceanOne:20200912015512p:plain:h100

ひとたびラテン方格が得られれば、任意の列同士の交換、行同士の交換でもラテン方格の特性は保存されます。例えば列同士の交換をすると下記の通り。

f:id:OceanOne:20200912020054p:plain:h104

行の場合にはこんな感じです。このようにすれば、自由にランダマイズすることが出来ます。

f:id:OceanOne:20200912020231p:plain:h100

ちなみに行と列のラベルは入れ替えませんでしたが、上図のように行ラベル、列ラベルが自然な順序(数字なら昇順、文字ならアルファベット順など)になっているものを標準ラテン方格と呼びます。

ラテン方格法の分散分析

ラテン方格でも、二元配置実験の場合と同じように、分散分析を行うことが出来ます。

総データ数を[math] N [/math]、水準数を[math] n [/math]、総和を[math] T [/math]、A条件[math] i [/math]水準の総和を[math] \displaystyle T_{ i \cdot \cdot } [/math]、B条件[math] j [/math]水準の総和を[math] \displaystyle T_{ \cdot j \cdot } [/math]、C条件[math] k [/math]水準の総和を[math] \displaystyle T_{ \cdot \cdot k } [/math]とすると各平方和は下記の通り。

修正項 [math] \displaystyle CT = \frac{T^2}{N} [/math]
総平方和 [math] \displaystyle S_T = \sum_{i=1}^{N}{x_i}^2 - CT [/math]
A要因平方和 [math] \displaystyle S_A = \sum_{i=1}^{n} \frac{ {T_{ i \cdot \cdot }}^2}{ n^2 } - CT [/math]
B要因平方和 [math] \displaystyle S_B = \sum_{j=1}^{n} \frac{ {T_{ \cdot j \cdot }}^2}{ n^2 } - CT [/math]
C要因平方和 [math] \displaystyle S_C = \sum_{k=1}^{n} \frac{ {T_{ \cdot \cdot k}}^2}{ n^2 } - CT [/math]
誤差平方和 [math] \displaystyle S_E = S_T - S_A - S_B - S_C [/math]

各自由度は下記のようになり、

総自由度 [math] \displaystyle \phi_T = N - 1 [/math]
A要因自由度 [math] \displaystyle \phi_A = n - 1 [/math]
B要因自由度 [math] \displaystyle \phi_B = n - 1 [/math]
C要因自由度 [math] \displaystyle \phi_C = n - 1 [/math]
誤差自由度 [math] \displaystyle \phi_E = \phi_T - \phi_A - \phi_B - \phi_C = N - 3n + 2 = (n-2)(n-1) [/math]

一元配置実験と同様に下記のような分散分析表を作成できます。

また、n=1,2の場合は誤差自由度が0になってしまうので検定を行うことは出来ません。

要因 平方和 自由度 平均平方 [math] \displaystyle F_0 [/math] [math] \displaystyle P [/math]
A [math] \displaystyle S_A [/math] [math] \displaystyle \phi_A = n - 1 [/math] [math] \displaystyle V_A [/math] [math] \displaystyle {V_A}/{V_E} [/math] [math] \displaystyle P_A [/math]
B [math] \displaystyle S_B [/math] [math] \displaystyle \phi_B = n - 1 [/math] [math] \displaystyle V_B [/math] [math] \displaystyle {V_B}/{V_E} [/math] [math] \displaystyle P_B [/math]
C [math] \displaystyle S_C [/math] [math] \displaystyle \phi_C = n - 1 [/math] [math] \displaystyle V_C [/math] [math] \displaystyle {V_C}/{V_E} [/math] [math] \displaystyle P_C [/math]
E [math] \displaystyle S_E [/math] [math] \displaystyle \phi_E = N - 3n + 2 [/math] [math] \displaystyle V_E [/math]
T [math] \displaystyle S_T [/math] [math] \displaystyle \phi_T = N - 1 [/math]

まとめ

2元配置実験の次は直交表に移って、なんとなくスキップされがちなラテン方格法について述べました。数学的なパズルの魔法陣が実用に生かされていて自分は好きです。4次元以上に拡張できる点も、素敵だと思います。