**4. Computing and updating the principal components efficiently mboxcontinuous case R**<sup>3</sup>

Here, we consider the computation of the principal components of a dynamic continuous point set. We present a closed form-solutions when the point set is a convex polytope or the boundary of a convex polytope in **R**<sup>2</sup> or **R**3. When the point set is the boundary of a convex polytope, we can update the new principal components in *O*(*k*) time, for both deletion and addition, under the assumption that we know the *k* facets in which the polytope changes. Under the same assumption, when the point set is a convex polytope in **R**<sup>2</sup> or **R**3, we can update the principal components in *O*(*k*) time after adding points. But, to update the principal components after deleting points from a convex polytope in **R**<sup>2</sup> or **R**<sup>3</sup> we need *O*(*n*) time. This is due to the fact that, after a deletion the center of gravity of the old convex hull (polyhedron) could lie outside the new convex hull, and therefore, a retetrahedralization is needed (see Subsection 4.1 and Subsection 6.2 for details). Due to better readability and compactness of the chapter, we present in this section only the closed-form solutions for a convex polytope in **R**3, and leave the rest of the results for the appendix.

#### **4.1 Continuous PCA over a convex polyhedron in R**<sup>3</sup>

Let *P* be a point set in **R**3, and let *X* be its convex hull. We assume that the boundary of *X* is triangulated (if it is not, we can triangulate it in a preprocessing step). We choose an arbitrary point *o* in the interior of *X*, for example, we can choose *o* to be the center of gravity of the boundary of *X*. Each triangle from the boundary together with *o* forms a tetrahedron. Let the number of such formed tetrahedra be *n*. The *k*-th tetrahedron, with vertices *x*1,*k*,*x*2,*k*,*x*3,*k*,*x*4,*<sup>k</sup>* = *o*, can be represented in a parametric form by *Q <sup>i</sup>*(*s*, *t*, *u*) = *x*4,*<sup>i</sup>* + *s*(*x*1,*<sup>i</sup>* − *x*4,*i*) + *t*(*x*2,*<sup>i</sup>* − *x*4,*i*) + *u* (*x*3,*<sup>i</sup>* − *x*4,*i*), for 0 ≤ *s*, *t*, *u* ≤ 1, and *s* + *t* + *u* ≤ 1. For <sup>1</sup> <sup>≤</sup> *<sup>i</sup>* <sup>≤</sup> 3, we use *xi*,*j*,*<sup>k</sup>* to denote the *<sup>i</sup>*-th coordinate of the vertex *xj* of the tetrahedron *<sup>Q</sup> <sup>k</sup>*.

of Discrete and Continuous Point Sets 9

Computing and Updating Principal Components of Discrete and Continuous Point Sets 271

We would like to note that the above expressions hold also for any non-convex polyhedron that can be tetrahedralized. A star-shaped object, where *o* is the kernel of the object, is such

. Let *X*� be the convex hull of *P*�

*vk* −

*w*� *<sup>k</sup>μ<sup>k</sup>*

> *vkμ<sup>k</sup>*

> > *vkμk*.

*μ* +*μ<sup>a</sup>* −*μd*. (16)

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*ij*,32),

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*j* ) +

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

), (17)

*j* ) −

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

> *vkμ<sup>k</sup>*

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*vk*.

. (15)

*n*+*na* ∑ *k*=*n*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1 . We consider

example.

Let

*σ*� *ij* <sup>=</sup> <sup>1</sup> 20 *<sup>n</sup>* ∑ *k*=1

Let

where

**Adding points**

We add points to *P*, obtaining a new point set *P*�

*vk* +

*μ*� =

*n*+*na* ∑ *k*=*n*+1

*n* ∑ *k*=1 *w*� *<sup>k</sup>μ<sup>k</sup>* +

> *n* ∑ *k*=1

 *vμ* +

*n*+*na* ∑ *k*=*n*+1

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*ij*,11 + *σ*�

*n* ∑ *k*=1

4 ∑ *l*=1

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

<sup>=</sup> <sup>1</sup> *v*�

<sup>=</sup> <sup>1</sup> *v*�

*<sup>μ</sup><sup>a</sup>* <sup>=</sup> <sup>1</sup> *v*�

*v*� =

The center of gravity of *X*� is

Then, we can rewrite (15) as

4 ∑ *l*=1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

> *σ*� *ij* <sup>=</sup> <sup>1</sup> <sup>20</sup> (*σ*�

4 ∑ *h*=1 *w*�

4 ∑ *l*=1

4 ∑ *h*=1 *w*�

> 4 ∑ *l*=1

4 ∑ *l*=1 *w*�

> *σ*� *ij*,11 =

4 ∑ *h*=1 *w*�

(*i*, *j*)-th component, *σ*�

1 20  *<sup>n</sup>*+*na* ∑ *k*=*n*+1

*n* ∑ *k*=1

that *X*� is obtained from *X* by deleting *nd*, and adding *na* tetrahedra. Let

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*n*+*na* ∑ *k*=*n*+1

*vkμ<sup>k</sup>* +

*n*+*na* ∑ *k*=*n*+1

*<sup>μ</sup>*� <sup>=</sup> *<sup>v</sup> v*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*ij*,12 + *σ*�

4 ∑ *h*=1 *w*�

*w*� *<sup>k</sup>μ<sup>k</sup>* −

*n*+*na* ∑ *k*=*n*+1

*vkμ<sup>k</sup>* −

*vk<sup>μ</sup>k*, and *<sup>μ</sup><sup>d</sup>* <sup>=</sup> <sup>1</sup>

The *i*-th component of *μ<sup>a</sup>* and *μd*, 1 ≤ *i* ≤ 3, is denoted by *μi*,*<sup>a</sup>* and *μi*,*d*, respectively. The

*j* ) + *n* ∑ *k*=1

> *j* ) +

*j* ) .

*ij*,21 + *σ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*ij*, 1 ≤ *i*, *j* ≤ 3, of the covariance matrix Σ� of *X*� is

*vk* = *v* +

*vkμ<sup>k</sup>* −

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*v*�

4 ∑ *l*=1 *w*�

*n*+*na* ∑ *k*=*n*+1

*ij*,22 − *σ*�

*ij*,31 − *σ*�

*j*

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*j* ) −

4 ∑ *l*=1 *w*�

*vk* −

.

The center of gravity of the *k*-th tetrahedron is

$$
\overrightarrow{\mu}\_k = \frac{\int\_0^1 \int\_0^{1-s} \int\_0^{1-s-t} \rho(\overrightarrow{Q}\_k(s,t)) \overrightarrow{Q}\_i(s,t) \, du \, dt \, ds}{\int\_0^1 \int\_0^{1-s} \int\_0^{1-s-t} \rho(\overrightarrow{Q}\_k(s,t)) \, du \, dt \, ds} \, \overrightarrow{\mu}\_k
$$

where *ρ*(*Q <sup>k</sup>*(*s*, *t*)) is a mass density at a point *Q <sup>k</sup>*(*s*, *t*). Since we can assume *ρ*(*Q <sup>k</sup>*(*s*, *t*)) = 1, we have

$$
\overrightarrow{\mu}\_k = \frac{\int\_0^1 \int\_0^{1-s} \int\_0^{1-s-t} \vec{Q}\_k(s,t) \, du \, dt \, ds}{\int\_0^1 \int\_0^{1-s} \int\_0^{1-s-t} \, du \, dt \, ds} \\
= \frac{\vec{x}\_{1,k} + \vec{x}\_{2,k} + \vec{x}\_{3,k} + \vec{x}\_{4,k}}{4}.
$$

The contribution of each tetrahedron to the center of gravity of *X* is proportional to its volume. If *Mk* is the 3 × 3 matrix whose *l*-th row is *xl*,*<sup>k</sup>* −*x*4,*k*, for *l* = 1 . . . 3, then the volume of the *k*-th tetrahedron is

$$v\_k = \text{volume}(Q\_k) = \frac{|\det(M\_k)|}{3!}.$$

We introduce a weight to each tetrahedron that is proportional to its volume, define as

$$w\_k = \frac{v\_k}{\sum\_{k=1}^n v\_k} = \frac{v\_k}{v}.$$

where *v* is the volume of *X*. Then, the center of gravity of *X* is

$$
\vec{\mu} = \sum\_{k=1}^{n} w\_k \vec{\mu}\_k.
$$

The covariance matrix of the *k*-th tetrahedron is

$$\begin{split} \Sigma\_{k} &= \frac{\int\_{0}^{1} \int\_{0}^{1-s} \int\_{0}^{1-s-t} \left( \vec{\mathcal{Q}}\_{k}(s, t, \boldsymbol{\mu}) - \vec{\mu} \right) \left( \vec{\mathcal{Q}}\_{k}(s, t, \boldsymbol{\mu}) - \vec{\mu} \right)^{T} \boldsymbol{d} \boldsymbol{\mu} \, dt \, ds}{\int\_{0}^{1} \int\_{0}^{1-s} \int\_{0}^{1-s-t} \boldsymbol{d} \boldsymbol{u} \, dt \, ds} \\ &= \frac{1}{20} \left( \sum\_{j=1}^{4} \sum\_{h=1}^{4} (\vec{\mathcal{X}}\_{j,k} - \vec{\mu})(\vec{\mathcal{X}}\_{h,k} - \vec{\mu})^{T} + \sum\_{j=1}^{4} (\vec{\mathcal{X}}\_{j,k} - \vec{\mu})(\vec{\mathcal{X}}\_{j,k} - \vec{\mu})^{T} \right) \end{split}$$

The (*i*, *j*)-th element of Σ*k*, *i*, *j* ∈ {1, 2, 3}, is

$$\sigma\_{\vec{i}\vec{j},k} = \frac{1}{20} \left( \sum\_{l=1}^{4} \sum\_{h=1}^{4} (\mathbf{x}\_{\vec{i},l,k} - \mu\_{\vec{i}})(\mathbf{x}\_{\vec{j},h,k} - \mu\_{\vec{j}}) + \sum\_{l=1}^{4} (\mathbf{x}\_{\vec{i},l,k} - \mu\_{\vec{i}})(\mathbf{x}\_{\vec{j},l,k} - \mu\_{\vec{j}}) \right) \mathbf{x}\_{\vec{k}}$$

with *μ* = (*μ*1, *μ*2, *μ*3). Finally, the covariance matrix of *X* is

$$
\Sigma = \sum\_{i=1}^{n} w\_i \Sigma\_{i\prime}
$$

with (*i*, *j*)-th element

$$
\sigma\_{ij} = \frac{1}{20} \left( \sum\_{k=1}^{n} \sum\_{l=1}^{4} \sum\_{h=1}^{4} w\_i (\mathbf{x}\_{i,l,k} - \mu\_i)(\mathbf{x}\_{j,h,k} - \mu\_j) + \sum\_{k=1}^{n} \sum\_{l=1}^{4} w\_i (\mathbf{x}\_{i,l,k} - \mu\_i)(\mathbf{x}\_{j,l,k} - \mu\_j) \right).
$$

We would like to note that the above expressions hold also for any non-convex polyhedron that can be tetrahedralized. A star-shaped object, where *o* is the kernel of the object, is such example.

#### **Adding points**

8 Will-be-set-by-IN-TECH

<sup>0</sup> *<sup>ρ</sup>*(*<sup>Q</sup> <sup>k</sup>*(*s*, *<sup>t</sup>*))*<sup>Q</sup> <sup>i</sup>*(*s*, *<sup>t</sup>*) *du dt ds*

<sup>0</sup> *<sup>ρ</sup>*(*<sup>Q</sup> <sup>k</sup>*(*s*, *<sup>t</sup>*)) *du dt ds* ,

<sup>0</sup> *du dt ds* <sup>=</sup> *<sup>x</sup>*1,*<sup>k</sup>* <sup>+</sup>*<sup>x</sup>*2,*<sup>k</sup>* <sup>+</sup>*<sup>x</sup>*3,*<sup>k</sup>* <sup>+</sup>*<sup>x</sup>*4,*<sup>k</sup>*

<sup>=</sup> *vk v* ,

3! .

<sup>4</sup> .

<sup>1</sup>−*s*−*<sup>t</sup>*

<sup>0</sup> *<sup>Q</sup> <sup>k</sup>*(*s*, *<sup>t</sup>*) *du dt ds*

<sup>1</sup>−*s*−*<sup>t</sup>*

where *ρ*(*Q <sup>k</sup>*(*s*, *t*)) is a mass density at a point *Q <sup>k</sup>*(*s*, *t*). Since we can assume *ρ*(*Q <sup>k</sup>*(*s*, *t*)) = 1,

The contribution of each tetrahedron to the center of gravity of *X* is proportional to its volume. If *Mk* is the 3 × 3 matrix whose *l*-th row is *xl*,*<sup>k</sup>* −*x*4,*k*, for *l* = 1 . . . 3, then the volume of the *k*-th

*vk* <sup>=</sup> volume(*Qk*) = <sup>|</sup>*det*(*Mk*)<sup>|</sup>

*n* ∑ *k*=1

*wkμk*.

<sup>0</sup> (*<sup>Q</sup> <sup>k</sup>*(*s*, *<sup>t</sup>*, *<sup>u</sup>*) <sup>−</sup>*<sup>μ</sup>*) (*<sup>Q</sup> <sup>k</sup>*(*s*, *<sup>t</sup>*, *<sup>u</sup>*) <sup>−</sup>*<sup>μ</sup>*)*<sup>T</sup> du dt ds*

<sup>0</sup> *du dt ds*

4 ∑ *j*=1

4 ∑ *l*=1

*n* ∑ *k*=1

4 ∑ *l*=1

(*xj*,*<sup>k</sup>* −*μ*)(*xj*,*<sup>k</sup>* −*μ*)

(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*l*,*<sup>k</sup>* − *μj*)

*wi*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*l*,*<sup>k</sup>* − *μj*)

*T* .

> ,

> > .

*<sup>T</sup>* +

<sup>1</sup>−*s*−*<sup>t</sup>*

We introduce a weight to each tetrahedron that is proportional to its volume, define as

*wk* <sup>=</sup> *vk* ∑*n <sup>k</sup>*=<sup>1</sup> *vk*

*μ* =

 1 0 <sup>1</sup>−*<sup>s</sup>* 0

(*xj*,*<sup>k</sup>* −*μ*)(*xh*,*<sup>k</sup>* −*μ*)

(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

Σ =

*wi*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*n* ∑ *i*=1

*wi*Σ*i*,

The center of gravity of the *k*-th tetrahedron is

*μ<sup>k</sup>* =

 1 0 <sup>1</sup>−*<sup>s</sup>* 0

we have

tetrahedron is

*μ<sup>k</sup>* =

 1 0 <sup>1</sup>−*<sup>s</sup>* 0

 1 0 <sup>1</sup>−*<sup>s</sup>* 0

> 1 0 <sup>1</sup>−*<sup>s</sup>* 0

<sup>1</sup>−*s*−*<sup>t</sup>*

where *v* is the volume of *X*. Then, the center of gravity of *X* is

<sup>1</sup>−*s*−*<sup>t</sup>*

4 ∑ *h*=1

4 ∑ *h*=1

with *μ* = (*μ*1, *μ*2, *μ*3). Finally, the covariance matrix of *X* is

The covariance matrix of the *k*-th tetrahedron is

 1 0 <sup>1</sup>−*<sup>s</sup>* 0

<sup>=</sup> <sup>1</sup> 20 <sup>4</sup> ∑ *j*=1

The (*i*, *j*)-th element of Σ*k*, *i*, *j* ∈ {1, 2, 3}, is

4 ∑ *l*=1

4 ∑ *h*=1

Σ*<sup>k</sup>* =

*<sup>σ</sup>ij*,*<sup>k</sup>* <sup>=</sup> <sup>1</sup> 20 <sup>4</sup> ∑ *l*=1

with (*i*, *j*)-th element

*<sup>σ</sup>ij* <sup>=</sup> <sup>1</sup> 20 *<sup>n</sup>* ∑ *k*=1 <sup>1</sup>−*s*−*<sup>t</sup>*

We add points to *P*, obtaining a new point set *P*� . Let *X*� be the convex hull of *P*� . We consider that *X*� is obtained from *X* by deleting *nd*, and adding *na* tetrahedra. Let

$$v' = \sum\_{k=1}^{n} v\_k + \sum\_{k=n+1}^{n+n\_d} v\_k - \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} v\_k = v + \sum\_{k=n+1}^{n+n\_d} v\_k - \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} v\_k.$$

The center of gravity of *X*� is

$$\begin{split} \vec{\mu}^{\prime} &= \sum\_{k=1}^{n} w\_{k}^{\prime} \vec{\mu}\_{k} + \sum\_{k=n+1}^{n+n\_{a}} w\_{k}^{\prime} \vec{\mu}\_{k} - \sum\_{k=n+n\_{a}+1}^{n+n\_{a}+n\_{d}} w\_{k}^{\prime} \vec{\mu}\_{k} \\ &= \frac{1}{\upsilon^{\prime}} \left( \sum\_{k=1}^{n} v\_{k} \vec{\mu}\_{k} + \sum\_{k=n+1}^{n+n\_{a}} v\_{k} \vec{\mu}\_{k} - \sum\_{k=n+n\_{a}+1}^{n+n\_{a}+n\_{d}} v\_{k} \vec{\mu}\_{k} \right) \\ &= \frac{1}{\upsilon^{\prime}} \left( v \vec{\mu} + \sum\_{k=n+1}^{n+n\_{a}} v\_{k} \vec{\mu}\_{k} - \sum\_{k=n+n\_{a}+1}^{n+n\_{a}+n\_{d}} v\_{k} \vec{\mu}\_{k} \right). \end{split} \tag{15}$$

Let

$$
\overrightarrow{\mu}\_{a} = \frac{1}{v'} \sum\_{k=n+1}^{n+n\_d} v\_k \overrightarrow{\mu}\_{k'} \quad \text{and} \quad \overrightarrow{\mu}\_d = \frac{1}{v'} \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} v\_k \overrightarrow{\mu}\_k.
$$

Then, we can rewrite (15) as

$$
\vec{\mu}' = \frac{v}{v'}\vec{\mu} + \vec{\mu}\_a - \vec{\mu}\_d.\tag{16}
$$

The *i*-th component of *μ<sup>a</sup>* and *μd*, 1 ≤ *i* ≤ 3, is denoted by *μi*,*<sup>a</sup>* and *μi*,*d*, respectively. The (*i*, *j*)-th component, *σ*� *ij*, 1 ≤ *i*, *j* ≤ 3, of the covariance matrix Σ� of *X*� is

*σ*� *ij* <sup>=</sup> <sup>1</sup> 20 *<sup>n</sup>* ∑ *k*=1 4 ∑ *l*=1 4 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*� *<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*� *j* ) + *n* ∑ *k*=1 4 ∑ *l*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*� *<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*� *j* ) + 1 20 *<sup>n</sup>*+*na* ∑ *k*=*n*+1 4 ∑ *l*=1 4 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*� *<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*� *j* ) + *n*+*na* ∑ *k*=*n*+1 4 ∑ *l*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*� *<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*� *j* ) − *n*+*na*+*nd* ∑ *k*=*n*+*na*+1 4 ∑ *l*=1 4 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*� *<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*� *j* ) − *n*+*na*+*nd* ∑ *k*=*n*+*na*+1 4 ∑ *l*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*� *<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*� *j* ) .

Let

$$
\sigma'\_{ij} = \frac{1}{20} (\sigma'\_{ij,11} + \sigma'\_{ij,12} + \sigma'\_{ij,21} + \sigma'\_{ij,22} - \sigma'\_{ij,31} - \sigma'\_{ij,32}) / \sigma
$$

where

$$\sigma\_{ij,11}^{\prime} = \sum\_{k=1}^{n} \sum\_{l=1}^{4} \sum\_{h=1}^{4} w\_k^{\prime} (\mathbf{x}\_{i,l,k} - \mu\_i^{\prime}) (\mathbf{x}\_{j,h,k} - \mu\_j^{\prime}),\tag{17}$$

of Discrete and Continuous Point Sets 11

Computing and Updating Principal Components of Discrete and Continuous Point Sets 273

*<sup>v</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>v</sup>*

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) ·

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) +

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) +

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*ij*,22 + *σ*�

*ij*,31 + *σij*,32) +

*ij*,31 and *σ*�

*ij*,31 + *σ*�

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>v</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (25)

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (26)

*ij*,32. Thus, *<sup>μ</sup>*� and

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) (28)

*ij*,21 and *σ*�

*ij*,32)

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (27)

*ij*,22 can be computed

*<sup>j</sup>* in (18), we obtain:

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 3, we have

*vk*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*vk*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*vk*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>v</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*ij*,12 + *σ*�

*ij*,21 + *σ*�

*ij*,21 + *σ*�

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*ij*,22 + *σ*�

*ij*,1 can be computed in *O*(1) time. The components *σ*�

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>i</sup>* and *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>v</sup>*

Plugging-in the values of *μ*�

*n* ∑ *k*=1

= *n* ∑ *k*=1

= *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> > 1 *v*�

<sup>=</sup> <sup>1</sup> *v*�

From (25) and (26), we obtain

*ij*,11 + *σ*�

*σ*� *ij* <sup>=</sup> <sup>1</sup> <sup>20</sup> (*σ*�

can be computed in *O*(*na* + *nd*) time.

<sup>=</sup> <sup>1</sup>

*v*

4 *v*

4 ∑ *l*=1 *w*�

4 ∑ *l*=1 *w*�

4 ∑ *l*=1 *w*�

4 ∑ *l*=1 *w*�

4 ∑ *l*=1 *w*�

4 ∑ *l*=1 *w*�

*n* ∑ *k*=1

*n* ∑ *k*=1

*n* ∑ *k*=1

4 ∑ *l*=1

4 ∑ *l*=1

4 ∑ *l*=1

*<sup>v</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*ij*,12 <sup>=</sup> *<sup>σ</sup>ij* <sup>+</sup> <sup>20</sup> *<sup>v</sup>*

in *O*(*na*) time, while *O*(*nd*) time is needed to compute *σ*�

<sup>20</sup> (*σij* <sup>+</sup> *<sup>σ</sup>*�

*<sup>v</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*ij*,11 + *σ*�

*σ*� *ij*,12 =

Since ∑*<sup>n</sup>*

*σ*� *ij*,1 = *σ*�

Note that *σ*�

*<sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>4</sup>

*σ*� *ij*,12 <sup>=</sup> <sup>1</sup> *v*�

*<sup>l</sup>*=<sup>1</sup> *w*�

$$
\sigma\_{ij,12}' = \sum\_{k=1}^{n} \sum\_{l=1}^{4} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,l,k} - \mu\_j'), \tag{18}
$$

$$
\sigma\_{ij,21}' = \sum\_{k=n+1}^{n+n\_d} \sum\_{l=1}^{4} \sum\_{h=1}^{4} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,h,k} - \mu\_j'),
\tag{19}
$$

$$\sigma\_{ij,22}' = \sum\_{k=n+1}^{n+n\_d} \sum\_{l=1}^{4} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,l,k} - \mu\_j'),\tag{20}$$

$$
\sigma'\_{ij,31} = \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} \sum\_{l=1}^4 \sum\_{h=1}^4 w'\_k(\mathbf{x}\_{i,l,k} - \mu'\_i)(\mathbf{x}\_{j,h,k} - \mu'\_j),
\tag{21}
$$

$$
\sigma'\_{\rm ij,22} = \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} \sum\_{l=1}^4 w'\_k(\mathbf{x}\_{i,l,k} - \mu'\_i)(\mathbf{x}\_{j,l,k} - \mu'\_j). \tag{22}
$$

Plugging-in the values of *μ*� *<sup>i</sup>* and *μ*� *<sup>j</sup>* in (17), we obtain:

*σ*� *ij*,11 = *n* ∑ *k*=1 4 ∑ *l*=1 4 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) = *n* ∑ *k*=1 4 ∑ *l*=1 4 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) · (*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) = *n* ∑ *k*=1 4 ∑ *l*=1 4 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) + *n* ∑ *k*=1 4 ∑ *l*=1 4 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) + *n* ∑ *k*=1 4 ∑ *l*=1 4 ∑ *h*=1 *w*� *<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) + *n* ∑ *k*=1 4 ∑ *l*=1 4 ∑ *h*=1 *w*� *<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (23)

Since ∑*<sup>n</sup> <sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>4</sup> *<sup>l</sup>*=<sup>1</sup> *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 3, we have

$$\begin{split} \sigma\_{ij,11}' &= \frac{1}{\upsilon^{\prime}} \sum\_{k=1}^{n} \sum\_{l=1}^{4} \sum\_{h=1}^{4} \upsilon\_{k} (\mathbf{x}\_{iJ,k} - \mu\_{i})(\mathbf{x}\_{jh,k} - \mu\_{j}) + \\ & \frac{1}{\upsilon^{\prime}} \sum\_{k=1}^{n} \sum\_{l=1}^{4} \sum\_{h=1}^{4} \upsilon\_{k} (\mu\_{i}(1 - \frac{\upsilon}{\upsilon^{\prime}}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_{j}(1 - \frac{\upsilon}{\upsilon^{\prime}}) - \mu\_{j,a} + \mu\_{j,d}) \\ & = \frac{1}{\upsilon^{\prime}} \sum\_{k=1}^{n} \sum\_{l=1}^{4} \sum\_{h=1}^{4} \upsilon\_{k} (\mathbf{x}\_{iJ,k} - \mu\_{i})(\mathbf{x}\_{jh,k} - \mu\_{j}) + \\ & 16 \frac{\upsilon}{\upsilon^{\prime}} (\mu\_{i}(1 - \frac{\upsilon}{\upsilon^{\prime}}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_{j}(1 - \frac{\upsilon}{\upsilon^{\prime}}) - \mu\_{j,a} + \mu\_{j,d}). \end{split} \tag{24}$$

Plugging-in the values of *μ*� *<sup>i</sup>* and *μ*� *<sup>j</sup>* in (18), we obtain:

10 Will-be-set-by-IN-TECH

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>v</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>v</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*j*

*j*

*j*

*j*

*j*

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) ·

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) +

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) +

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

), (18)

), (19)

), (20)

), (21)

). (22)

*<sup>v</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (23)

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (24)

*σ*� *ij*,12 =

*σ*� *ij*,21 =

*σ*� *ij*,31 =

Plugging-in the values of *μ*�

*n* ∑ *k*=1

= *n* ∑ *k*=1

= *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> > 1 *v*�

<sup>=</sup> <sup>1</sup> *v*�

<sup>16</sup> *<sup>v</sup>*

4 ∑ *l*=1

4 ∑ *l*=1

4 ∑ *l*=1

4 ∑ *l*=1

4 ∑ *l*=1

4 ∑ *l*=1

*n* ∑ *k*=1

*n* ∑ *k*=1

*n* ∑ *k*=1

4 ∑ *l*=1

4 ∑ *l*=1

4 ∑ *l*=1

*<sup>v</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

4 ∑ *h*=1

4 ∑ *h*=1

4 ∑ *h*=1

4 ∑ *h*=1 *w*�

4 ∑ *h*=1 *w*�

4 ∑ *h*=1 *w*�

4 ∑ *h*=1 *w*�

4 ∑ *h*=1 *w*�

4 ∑ *h*=1 *w*�

*σ*� *ij*,11 =

Since ∑*<sup>n</sup>*

*<sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>4</sup>

*σ*� *ij*,11 <sup>=</sup> <sup>1</sup> *v*�

*<sup>l</sup>*=<sup>1</sup> *w*�

*σ*� *ij*,32 =

*σ*� *ij*,22 =

*n* ∑ *k*=1

*n*+*na* ∑ *k*=*n*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>v</sup>*

*n*+*na* ∑ *k*=*n*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*<sup>i</sup>* and *μ*�

4 ∑ *l*=1 *w*�

4 ∑ *l*=1

4 ∑ *h*=1 *w*�

4 ∑ *l*=1 *w*�

4 ∑ *l*=1

4 ∑ *h*=1 *w*�

4 ∑ *l*=1 *w*�

*<sup>j</sup>* in (17), we obtain:

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*vk*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*vk*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 3, we have

*vk*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup>*

*σ*� *ij*,12 = *n* ∑ *k*=1 4 ∑ *l*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) = *n* ∑ *k*=1 4 ∑ *l*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) · (*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) = *n* ∑ *k*=1 4 ∑ *l*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) + *n* ∑ *k*=1 4 ∑ *l*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) + *n* ∑ *k*=1 4 ∑ *l*=1 *w*� *<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) + *n* ∑ *k*=1 4 ∑ *l*=1 *w*� *<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>v</sup> <sup>v</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (25)

Since ∑*<sup>n</sup> <sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>4</sup> *<sup>l</sup>*=<sup>1</sup> *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 3, we have

$$\begin{split} \sigma\_{ij,12}' &= \frac{1}{\upsilon'} \sum\_{k=1}^{n} \sum\_{l=1}^{4} v\_k (\mathbf{x}\_{i,l,k} - \mu\_i)(\mathbf{x}\_{j,h,k} - \mu\_j) + \\ & \quad \frac{1}{\upsilon'} \sum\_{k=1}^{n} \sum\_{l=1}^{4} v\_k (\mu\_i(1 - \frac{\upsilon}{\upsilon'}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{\upsilon}{\upsilon'}) - \mu\_{j,a} + \mu\_{j,d}) \\ &= \frac{1}{\upsilon'} \sum\_{k=1}^{n} \sum\_{l=1}^{4} v\_k (\mathbf{x}\_{i,l,k} - \mu\_i)(\mathbf{x}\_{j,h,k} - \mu\_j) + \\ & \quad 4\frac{\upsilon}{\upsilon'} (\mu\_i(1 - \frac{\upsilon}{\upsilon'}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{\upsilon}{\upsilon'}) - \mu\_{j,a} + \mu\_{j,d}). \end{split} \tag{26}$$

From (25) and (26), we obtain

$$
\sigma\_{ij,1}^{\prime} = \sigma\_{ij,11}^{\prime} + \sigma\_{ij,12}^{\prime} = \sigma\_{ij} + 20\frac{v}{v^{\prime}}(\mu\_i(1 - \frac{v}{v^{\prime}}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{v}{v^{\prime}}) - \mu\_{j,a} + \mu\_{j,d}). \tag{27}
$$

Note that *σ*� *ij*,1 can be computed in *O*(1) time. The components *σ*� *ij*,21 and *σ*� *ij*,22 can be computed in *O*(*na*) time, while *O*(*nd*) time is needed to compute *σ*� *ij*,31 and *σ*� *ij*,32. Thus, *<sup>μ</sup>*� and

$$\begin{split} \sigma'\_{ij} &= \frac{1}{20} (\sigma'\_{ij,11} + \sigma'\_{ij,12} + \sigma'\_{ij,21} + \sigma'\_{ij,22} + \sigma'\_{ij,31} + \sigma'\_{ij,32}) \\ &= \frac{1}{20} (\sigma\_{ij} + \sigma'\_{ij,21} + \sigma'\_{ij,22} + \sigma'\_{ij,31} + \sigma\_{ij,32}) + \\ &\frac{\upsilon}{\upsilon'} (\mu\_i (1 - \frac{\upsilon}{\upsilon'}) - \mu\_{i,d} + \mu\_{i,d}) (\mu\_j (1 - \frac{\upsilon}{\upsilon'}) - \mu\_{j,d} + \mu\_{j,d}) \end{split} \tag{28}$$

can be computed in *O*(*na* + *nd*) time.

of Discrete and Continuous Point Sets 13

Computing and Updating Principal Components of Discrete and Continuous Point Sets 275

*t*(*x*3,*<sup>k</sup>* − *x*1,*k*), for 0 ≤ *s*, *t* ≤ 1, and *s* + *t* ≤ 1. For 1 ≤ *i* ≤ 3, we denote by *xi*,*j*,*<sup>k</sup>* the *i*-th

The contribution of each triangle to the center of gravity of the triangulated surface is

*ak* <sup>=</sup> area(*Tk*) = <sup>|</sup>(*<sup>x</sup>*2,*<sup>k</sup>* <sup>−</sup>*<sup>x</sup>*1,*k*)|×|(*<sup>x</sup>*3,*<sup>k</sup>* <sup>−</sup>*<sup>x</sup>*1,*k*)<sup>|</sup>

We introduce a weight to each triangle that is proportional to its area, define as

where *a* is the area of *X*. Then, the center of gravity of the boundary of *X* is

*Tk*(*s*, *<sup>t</sup>*) <sup>−</sup>*<sup>μ</sup>*) (

 1 0 <sup>1</sup>−*<sup>s</sup>* <sup>0</sup> *dt ds*

3 ∑ *h*=1

3 ∑ *h*=1 *wk* <sup>=</sup> *ak* ∑*n <sup>i</sup>*=<sup>1</sup> *ak*

*μ* =

(*xj*,*<sup>k</sup>* −*μ*)(*xh*,*<sup>k</sup>* −*μ*)

(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

Σ =

deleting *nd*, and adding *na* tetrahedra. Then the sum of the areas of all triangles is

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*n* ∑ *k*=1

We add points to *X*. Let *X*� be the new convex hull. We assume that *X*� is obtained from *X* by

*wk*Σ*k*.

*ak* = *a* +

*n*+*na* ∑ *k*=*n*+1

*ak* −

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*ak*.

with *μ* = (*μ*1, *μ*2, *μ*3). Finally, the covariance matrix of the boundary of *X* is

*n* ∑ *k*=1

*wkμk*.

*Tk*(*s*, *<sup>t</sup>*) <sup>−</sup>*<sup>μ</sup>*)*<sup>T</sup> dt ds*

*<sup>T</sup>* +

3 ∑ *j*=1

> 3 ∑ *l*=1

(*xj*,*<sup>k</sup>* −*μ*)(*xj*,*<sup>k</sup>* −*μ*)

(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*l*,*<sup>k</sup>* − *μj*)

*T* .

> ,

<sup>0</sup> *dt ds* <sup>=</sup> *<sup>x</sup>*1,*<sup>k</sup>* <sup>+</sup>*<sup>x</sup>*2,*<sup>k</sup>* <sup>+</sup>*<sup>x</sup>*3,*<sup>k</sup>*

<sup>=</sup> *ak a* ,

*Ti*(*s*, *t*) *dt ds*

*Tk*. The center of gravity of the *k*-th triangle is

<sup>3</sup> .

<sup>2</sup> .

coordinate of the vertex *xj* of the triangle

The covariance matrix of the *k*-th triangle is

 1 0 <sup>1</sup>−*<sup>s</sup>* <sup>0</sup> (

<sup>=</sup> <sup>1</sup> 12 <sup>3</sup> ∑ *j*=1

The (*i*, *j*)-th element of Σ*k*, *i*, *j* ∈ {1, 2, 3}, is

Σ*<sup>k</sup>* =

*<sup>σ</sup>ij*,*<sup>k</sup>* <sup>=</sup> <sup>1</sup> 12 <sup>3</sup> ∑ *l*=1

*a*� =

*n* ∑ *k*=1

*ak* +

*n*+*na* ∑ *k*=*n*+1

*ak* −

**Adding points**

*μ<sup>k</sup>* =

proportional to its area. The area of the *k*-th triangle is

 1 0 <sup>1</sup>−*<sup>s</sup>* <sup>0</sup>

> 1 0 <sup>1</sup>−*<sup>s</sup>*
