Computation of the covariance matrix can be done
in O(d
2
n) time, while computation of the eigenval-
ues, when d is not very large, can be done in O(d
3
)
time, for example with the Jacobi or the QR method
(Press et al., 1995). Thus, the time complexity of
computing principal components of n points in R
d
is
O(d
2
n + d
3
). The multiplicative factor of O(d
2
) and
the additive factor of O(d
3
) throughout the paper will
be omitted, since we will assume that d is fixed. For
very large d, the problem of computing eigenvalues
is non-trivial. In practice, the above mentioned meth-
ods for computing eigenvalues converge rapidly. In
theory, it is unclear how to bound the running time
combinatorially and how to compute the eigenvalues
in decreasing order. In (Cheng and Y. Wang, 2008)
a modification of the Power method (Parlett, 1998) is
presented, which can give a guaranteed approxima-
tion of the eigenvalues with high probability.
Examples of applications of PCA include data
compression, exploratory data analysis, visualization,
image processing, pattern and image recognition,
time series prediction, detecting perfect and reflec-
tive symmetry, and dimension detection. The thor-
ough overview of PCA’s applications can be found
for example in the textbooks (Duda et al., 2001) and
(Jolliffe, 2002). Most of the applications of PCA are
non-geometric in their nature. However, there are
also few purely geometric applications that are quite
widespread in computer graphics. Example are the
estimation of the undirected normals of the point sets
or computing PCA bounding boxes (bounding boxes
determined by the principal components of the point
set).
Contributions and Organization of the Paper. Dy-
namic versions of the above applications, i.e., when
the point set (population) changes, are of big impor-
tance and interest. Efficient solutions of those prob-
lems depend heavily on an efficient dynamic compu-
tation of the principal components (eigenvectors of
the covarince matrix). Dynamic updates of variances
in different settings have been studied since the six-
ties (Chan et al., 1979), (Knuth, 1998), (P
´
ebay, 2008),
(Welford, 1962), (West, 1979). Recently, in a techni-
cal report (P
´
ebay, 2008) also investigated the dynamic
maintenance of covariance matrices. Our contribution
extends these results in the following directions:
1. We also take into account the operation of point
deletions.
2. We study the dynamic computation of principal
components in the continuous version.
3. We combine the dynamic PCA versions with ef-
ficient methods for computing PCA bounding
boxes.
We consider the computation of the dynamic PCA
bounding boxes, since it has very important appli-
cations in many fields including computer graphics,
where the PCA boxes are used, for example, for ray
tracing, fast rendering, video compression algorithms,
or collision detection. Two distinguished hierarchi-
cal data structures from computer graphics used for
representation of 3D surfaces and for rapid interfer-
ence detection, based on PCA bounding boxes, are
the Boxtree (Barequet et al., 1996) and the OBBTree
(Gottschalk et al., 1996). We would like to stress, that
PCA bounding boxes are also of interest in applica-
tions where the guaranty of the approximation qual-
ity is required, since some version of PCA bounding
boxes have guaranties on their size (Dimitrov et al.,
2009b). Based on the theoretical results in this paper,
we have implemented several algorithms for comput-
ing PCA bounding boxes dynamically.
The organization and the main results of the paper
are as follows: In Section 2 we consider the prob-
lem of updating the principal components of a set of
n points, when m points are added or deleted from
the point set. For both operations performed on a dis-
crete point set in R
d
, we can compute the new prin-
cipal components in O(m) time for fixed d. This is a
significant improvement over the commonly used ap-
proach of recomputing the principal components from
scratch, which takes O(n + m) time. We also consider
the computation of the principal components of a dy-
namic continuous point set. We give closed form so-
lutions when the point set is a convex polytope R
3
.
Due to the space limitation, the cases when the point
set is the boundary of a convex polytope in R
2
or R
3
,
or a convex polygon in R
2
, are left for an extended
version of this paper. In Section 3 we present and
verify the correctness of some theoretical results pre-
sented in the Section 2. We have implemented several
dynamic PCA bounding box algorithms and evaluated
their performances. Conclusion and open problems
are presented in Section 4.
2 UPDATING THE PRINCIPAL
COMPONENTS EFFICIENTLY
2.1 Discrete Case in R
d
Here, we consider the problem of updating the
covariance matrix Σ of a discrete point set P =
{~p
1
,~p
2
,...,~p
n
} in R
d
, when m points are added or
deleted from P. The recent result of (P
´
ebay, 2008)
implies the same solution that we have obtained for
additions. Since the derivation of the closed form so-
GRAPP 2011 - International Conference on Computer Graphics Theory and Applications
86