WorksMathematics
Interactive and Robust PCA Graphics with FSDA in MATLAB
Abstract
Principal Component Analysis (PCA) is a standard method for dimension reduction and the exploratory analysis of multivariate data, but a complete applied workflow often requires more than numerical eigenvectors and static plots. This article documents a set of routines in the FSDA toolbox for MATLAB that implements an integrated workflow for interactive and robust PCA graphics. The software contribution consists of coordinating classical SVD-based PCA, dynamic biplot scaling controlled by row and column parameters, score-distance and orthogonal-distance diagnostics, hard-trimming robust PCA through the Minimum Covariance Determinant and the Forward Search, linked brushing, geographical displays, and three-dimensional projection diagnostics. The implementation returns reproducible numerical output while also exposing graphical controls for changing biplot geometry, confidence regions, displayed labels, robust trimming levels, and linked selections. The methodology is illustrated on quality-of-life indicators for Italian provinces, where the software reveals variable groups, atypical provinces, robust and non-robust PCA structures, and geographical patterns. The emphasis is on statistical software: no new PCA estimator is proposed, but established PCA and robust-PCA methodology is combined in a documented, extensible, and script-reproducible MATLAB environment.
Introduction
Principal Component Analysis (PCA) is a powerful and versatile statistical method for the dimension reduction of two-way data tables when the rows are units and the columns are variables. Greenacre et al. [ [10] provide a wide-ranging review of PCA and related methods, including correspondence analysis and extensions to images, shapes, and functions. Their review also illustrates the broad software support for PCA, especially in R and Python. The present paper complements that perspective by documenting a MATLAB implementation in which PCA computation, robust diagnostics, interactivity, and linked graphics are handled in one statistical software workflow.
PCA is already available in many environments. The standard MATLAB Statistics and Machine Learning Toolbox provides PCA computation and basic plots [The MathWorks Inc., 2025], and specialized MATLAB tools for exploratory multivariate analysis have also been proposed [4]. In R, packages such as ade4 [6], FactoMineR [Lê et al., 2008], and factoextra [14] provide extensive multivariate analysis and graphical summaries, while Factoshiny offers a shiny interface to selected FactoMineR analyses [27]. Domain-specific interactive PCA is available, for example, in the Bioconductor package pcaExplorer for RNA-seq data [16]. Robust PCA is implemented in packages such as rrcov, which includes high-breakdown estimators and the ROBPCA approach of Hubert et al. [2005] [26]. In Python, scikit-learn provides PCA estimation, with interactivity usually supplied by separate plotting libraries or notebooks [18].
Table 1 summarizes this software context. The novelty of the implementation described in our paper is not the proposal of a new PCA estimator. Instead, it is the integration, within the Flexible Statistics and Data Analysis (FSDA) toolbox for MATLAB § 4, of dynamic biplot geometry, robust hard-trimming diagnostics, Forward Search monitoring, linked brushing, and optional geographical displays in a single MATLAB workflow.
| Software context | PCA and graphics | Robustness and interactivity | Present contribution |
| MATLAB standard tools and related toolboxes | PCA, score plots, loading plots, biplots, and exploratory routines. | Interactivity is mainly supplied by the general graphics system; robust PCA and linked diagnostics are not a single workflow. | FSDA adds dynamic biplot controls, robust hard trimming, Forward Search monitoring, and linked graphics. |
| R: ade4, FactoMineR, factoextra, Factoshiny | Extensive PCA, correspondence analysis, factorial methods, and static or shiny-based graphical summaries. | Strong visualization support; robust PCA and Forward Search monitoring are not the central design target. | FSDA complements these tools by focusing on robust interactive PCA in MATLAB. |
| R: Bioconductor pcaExplorer | Interactive PCA exploration for RNA-seq analyses. | Rich domain-specific interaction and reporting. | FSDA is general multivariate software rather than application-specific. |
| R: Robust PCA software such as rrcov | Robust covariance and robust PCA output, including ROBPCA-type diagnostics. | High-breakdown estimation is central; no interactivity nor dynamic plots. | FSDA combines robust estimation with dynamic biplots and linked views. |
| Python: scikit-learn plus plotting libraries | Efficient PCA estimation and general plotting in scripts or notebooks. | Interactive graphics typically require external libraries and user assembly. | FSDA provides a packaged PCA graphics workflow inside MATLAB. |
| FSDA PCA tools documented here | Classical PCA output, “smart” eigenvector plots, outlier maps, dynamic biplots, and three-dimensional projection plots. | MCD, Forward Search, linked brushing, scatter plot matrices, geomaps, geobubbles, and reproducible scripts. | This paper documents the methodology, implementation, and applied use of this integrated functionality. |
Table 1. Position of the FSDA contribution within existing PCA software. The table is intentionally comparative rather than exhaustive.
The paper has four specific contributions. First, it specifies the PCA methodology implemented in the new FSDA functionality: classical PCA, biplot geometry, outlier maps, robust PCA by hard trimming, and linked visual diagnostics. Secondly, it describes how the functionality is implemented, including the main functions, returned objects, graphical controls, and extensibility conventions. Thirdly, it demonstrates how the software is used in practice on real data, with code that moves from pairwise exploration to classical PCA, robust PCA, brushing, geography, and three-dimensional diagnostics. Finally, it explains how the replication material has been organized around a single commented MATLAB script, replication.m, which is the primary entry point for reproducing the computational workflow and launching the interactive displays used in the paper.
The rest of the paper is organized as follows. § 2 reviews the PCA geometry needed for the implementation. § 3 describes the methodology implemented in the software, and § 4 describes the implementation design and user-facing functionality. § 5–§ 9 present the case study and show how the tools are used in practice. § 10 summarizes the replication material. § 11 concludes with limitations and possible extensions.
Principal Component Analysis and Graphical Representations
Given quantitative variables , the goal of Principal Component Analysis (PCA) is to replace the original, possibly correlated, variables with a new set of variables, the principal components, which satisfy [13]
they are uncorrelated (orthogonal);
they are ordered by decreasing explained variance.
The first principal component is the linear combination of the variables having maximal variance. The second principal component is the linear combination with the next largest variance and is uncorrelated with the first and so on up to the -th component. If the original variables are highly correlated, then the first components capture most of the total variance, so that these components provide a reduced-dimensional approximation to the data structure. The primary purpose of this technique is to reduce a large number of variables, each representing a feature of the phenomenon, into a few latent variables. Dimensionality is reduced by retaining only the leading (by variance) new variables. Here “explained variance” is more formally the sum of the squared distances of the points from their multidimensional mean.
For the procedure to provide a useful analysis, the variables need scaling to have zero mean. Unless the variables are measurements of similar quantities, the variables should also be scaled to have unit variance. From the point of view of robustness and outlier detection these scalings will be distorted by outliers which will affect both the estimated means and variances. We explore this point in §7. Hubert et al. [ [12] provide a description of the problem and one robust solution.
PCA can be applied to (the matrix of deviations from the mean) or (the matrix of standardized deviations), both matrices of dimension . For the standardized deviations , the principal components are obtained as linear combinations of the standardized variables, with weights given by the elements of the eigenvectors of , where is the covariance matrix of (or the correlation matrix of ). The corresponding eigenvalues are proportional to the amount of variance explained by each principal component. The sum of the eigenvalues equals the total variance, which is equal to the sum of the variances (i.e., the trace) of the correlation matrix and to the sum of the squared distances of the observations from their multidimensional mean.
If, as is often the case, the first two principal components explain an appreciable part of the variance of the data, for example 70%, the data (both responses and variables) can be represented in the space spanned by these components. A “loading plot” provides a graphical representation of the correlations between the original variables and the selected principal components, through vectors (arrows) whose directions and lengths reflect their contributions. The observations themselves can be represented, customarily by circles, through their coordinates (the scores) in the same reduced principal component space. When both representations are displayed jointly, the resulting display is commonly referred to as a “biplot”, which allows the simultaneous exploration of relationships among variables, among observations, and between the two. This joint representation plays a central role in exploratory PCA and provides a natural framework for the interactive visual tools discussed in the following sections.
Methodology implemented in FSDA
This section identifies the statistical methodology implemented in the new FSDA PCA functionality. The purpose is not to introduce a new PCA estimator, but to document the methods that have been brought together in the software and exposed through reproducible output and interactive graphics.
Classical PCA output
The function pcaFS computes a classical PCA from a numeric matrix or a table. The analysis can be based on centered variables or on standardized variables, depending on the scale of the input and the options used. The main numerical objects are the correlation or covariance matrix, eigenvalues, explained variance, eigenvectors, loadings, communalities, scores, score distances, and orthogonal distances. These quantities are printed in the MATLAB Command Window and are also returned in a structured object, so that interactive exploration is accompanied by script-level reproducibility. Appendix B shows a typical output structure.
Dynamic biplot geometry
The interactive biplot is based on the singular value decomposition described in § 2. The software implements a family of biplots indexed by two parameters, and , both in . The parameter controls how the singular values are distributed between row points and variable arrows, and hence changes the emphasis between observation distances and variable interpretation. The parameter redistributes the global factor between row and column coordinates, and therefore changes the visual balance of the joint display. The function biplotFS exposes these choices through sliders, while pcaFS launches the chosen biplot as part of a complete PCA analysis.
Outlier diagnostics and robust PCA
The implemented diagnostic map follows the score-distance/orthogonal-distance decomposition of Hubert et al. [2005]. The score distance measures distance within the retained principal-component subspace, while the orthogonal distance measures lack of fit to that subspace. This separation is important because an observation can be extreme in the PCA plane, poorly represented by the plane, or both.
Robust PCA is implemented through hard trimming. In the MCD branch, PCA is computed from the subset of observations retained by the Minimum Covariance Determinant estimator for a user-specified breakdown point. In the Forward Search branch, PCA is recomputed along an increasing sequence of subset sizes. The Forward Search is therefore a monitoring device: it shows how eigenvalues, scores, distances, and the biplot change as units enter or leave the subset. The two robust branches answer complementary questions. MCD gives a fixed high-breakdown fit, while the Forward Search displays a path of fits indexed by the amount of trimming.
Linked views, brushing, and geographical information
The implemented graphical methodology treats interactivity as part of the statistical analysis rather than as a final decoration. A selected set of row indices can be propagated from the biplot to a scatter plot matrix, to robust diagnostic panels, and, when geographical information is supplied, to geomaps or geobubble plots. Conversely, the same row labels and selected units remain available for inspection in the returned output. In this way brushing becomes a reproducible device for defining subsets whose statistical and geographical properties can be examined in linked displays.
Software design, functionality, and extensibility
FSDA, which is used for all computations and graphical analyses presented in this paper, is an open-source collection of MATLAB functions for robust and exploratory data analysis, with a particular focus on diagnostic tools, interactive graphics, and reproducible workflows [19]. The toolbox includes implementations of classical and robust methods for regression, multivariate analysis, clustering, and dimension reduction. Related computational and methodological developments are described in Riani et al. [ [21], Riani et al. [ [20], Azzini et al. [ [3], and Riani et al. [ [22].
The PCA functionality described here follows a layered design. First, the input layer accepts a numerical matrix or a MATLAB table, with optional row labels, variable labels, and geographical information. Second, the numerical layer computes PCA quantities, robust subsets, distances, and monitoring output. Third, a common output structure stores the numerical results in array and table form. Fourth, the graphical layer builds figures, GUI controls, and callbacks from the stored results. This separation is important because the same analysis can be run as a script for replication or opened interactively for exploration.
The returned structure is the main interface between numerical and graphical components. For example, out.score, out.loadings, out.orthDist, and out.scoreDist can be used directly in scripts, while the associated graphical callbacks use the same quantities to update labels, colors, confidence regions, and brushed selections. This design makes it possible to reproduce the figures non-interactively and then to open the same objects for interactive exploration.
Extensibility is supported by using common data structures for centers, loadings, scores, distances, subset membership, and outlier indicators. New robust estimators can be connected to the existing graphics provided that they return these quantities in the same form. Similarly, new linked displays can use the same vector of selected row indices as the biplot, scatter plot matrix, and geographical displays.
The graphical defaults also follow a color-use policy. Qualitative differences, such as brushed and unbrushed observations, should be encoded not only by hue but also by marker type or fill. Ordered magnitudes, such as orthogonal distances, should use perceptually ordered sequential palettes. Signed quantities, such as correlations or centered scores, should use diverging palettes with a meaningful center. This policy follows the recommendations and diagnostic tools of Zeileis et al. [ [30], whose palettes are built by interpolating in the perceptually based hue–chroma–luminance (HCL) color space rather than directly in RGB. As a consequence, equal steps in the data correspond to approximately equal perceived color differences. This approach is consistent with broader recommendations on scientific color maps [29, 5]. The replication scripts accompanying this paper are intended to optionally regenerate manuscript figures with these palette choices, controlled through a single colorBlindSafe argument exposed by the relevant FSDA functions (e.g., spmplot, pcaFS). For backward compatibility, setting colorBlindSafe to false reproduces the legacy palettes used in earlier releases of FSDA.
To make the enlarged set of options easier to use, the implementation also includes a MATLAB JSON signature file specifying the admissible name-value arguments and, when appropriate, their possible values. This file is used by the MATLAB editor to provide automatic completion when the user types a call to functions such as pcaFS. Thus, after the required input argument has been entered, the editor suggests the available options; once an option has been selected, it also suggests the admissible values or value types. This improves discoverability of the interface, reduces the need to consult the help file for routine usage, and helps keep the syntax of the interactive PCA tools consistent across the FSDA functions. An example is shown in Appendix Figure A5.
Case study: Quality of Life in Italian Provinces
The case study demonstrates how the new FSDA functionality is used in practice. The data come from the annual “Quality of Life” (QoL) survey of the Italian financial newspaper “Il Sole 24 ORE”, which ranks the 107 Italian provinces using 90 indicators of personal and family well-being. The newspaper ranking rescales each indicator to the interval [1, 1000], changes signs where necessary so that larger values correspond to better quality of life, and averages the resulting scores. Such a ranking is easy to communicate, but it can hide correlation structure and can be sensitive to outlying values. PCA provides an alternative exploratory view because it summarizes common variation among indicators, while the robust and interactive tools in FSDA allow the analyst to check whether the summary is stable.
The analysis is organized as a reproducible workflow addressing five questions: (i) whether the indicators have a low-dimensional correlation structure; (ii) which variables define the dominant components; (iii) which provinces are atypical in score space or in orthogonal distance from the PCA subspace; (iv) whether the conclusions are stable under robust hard trimming; and (v) how the PCA structure is related to geography. The GitHub
| Description | Variable name |
| Bank Deposits | Deposit |
| Bankrupt Companies | Bankrup |
| Index of Urban Fragility | UrbanFra |
| Invoice Payments within 30 Days | Paym30D |
| Electoral Participation | ElecPar |
| Quality of Life of Children, Young People and the Elderly | QualLif |
| Protests per capita1 | Protest |
| Average Annual Salary | SalaryA |
| Family Spending | SpendingA |
| Employment Rate | Employm |
| Value Added per capita | AddedVa |
| Families with low ISEE2 | LowISEE |
caption: Quality of Life (QoL) variables, source: Il Sole 24 ORE.
:::
repository https://github.com/UniprJRC/PCAinteractive contains the MATLAB source files used to generate the figures in the paper (more details are in § 10).
We selected 12 of the indicators listed by the newspaper from the 2024 edition of the survey, chosen subjectively to provide a balanced subset of the original indicators. The variables are presented in Table 3.
When the names of the provinces are included, the data matrix is . The objective of the analysis is not to produce a definitive socio-economic ranking, but to demonstrate how the implemented software moves from numerical PCA output to robust and linked graphical interpretation.
Step 1: pairwise structure and variable ordering
We begin by examining pairwise relationships among variables to assess the overall correlation structure, and for this we look at the scatter plot matrix. That for the variables in the order given above is shown as Figure A1 (in Appendix A). The code to produce this Figure uses FSDA function spmplot:
Figure A1. Original standard scatter plot matrix with rows ordered as in the original data.
load citiesItaly2024.mat
spmplot(citiesItaly2024);
The cells of this plot show that many of the variables have appreciable positive or negative correlations with each other, so that a PCA analysis can be expected to be informative.
Friendly [ [8] describes many ways in which the straightforward plot of Figure A1 can be improved. One class of improvements is to remove the redundancy of giving each scatter plot twice; we replace the upper-right triangle of the matrix by the magnitude and sign of the correlation between the pairs of variables. The second improvement comes from noticing that there are orderings of the rows; some permutations of rows will yield more meaningful scatter plot matrices than others. Friendly suggests ordering the variables by the angular orders of the eigenvectors from the two largest eigenvalues, that is the two most significant principal components. The order of the variables is calculated from the order of the angles ,
where and are the eigenvectors associated with the two largest eigenvalues. This circular order is unfolded to a linear order by splitting at the largest gap between the adjacent vectors. An extension [7] is the use of the first three principal components to represent the variables on the surface of a sphere. Here we follow the procedure of Friendly [ [8]. The resulting extended scatter plot matrix, produced by the function spmplot, is shown in Figure 1. The plot is obtained by specifying a set of optional arguments through the ⟨’Name’,Value⟩ syntax3. In particular, the option ⟨’typespm’,typespm⟩ controls the type of graphical elements used to represent the correlations in the scatter plot matrix. If typespm is specified as a structure (struct)

Figure 1. Modified scatter plot matrix with reordered columns. Option ’colorBlindSafe’ is set to true.
typespm = struct; typespm.upper = ’circle’;
spmplot(citiesItaly2024,’order’,’AOE’,’typespm’,typespm,...
’colorBackground’,true,’colorBlindSafe’,true);
the user can control which part of the scatter plot matrix (upper or lower triangular) is used to display a given type of graphical symbol. In this example, circles are used in the upper triangular part to represent pairwise correlations. The option ⟨’order’,’AOE’⟩ applies the angular ordering discussed above, while ⟨’colorBackground’,true⟩ specifies that the background of each panel is coloured according to the magnitude of the corresponding correlation coefficient. Finally, ⟨’colorBlindSafe’,true⟩ switches to HCL-based diverging palette (see page 4): correlations are shown with a neutral white center at zero and colors of equal perceived lightness for positive and negative values of equal magnitude, applied consistently to both the panel background colors and the circle/square/number correlation encodings.
The upper right triangle of the matrix shows the correlations between the pairs of variables; the diameter of the filled circles is proportional to the correlation, with the colour indicating the sign of the correlation and echoing the strength of the correlation. The top line corresponds to the variable “Quality of Life of Children, Young People and the Elderly”. This excellent, informative plot shows that there are three groups of variables. The largest is the set of mutually positively correlated variables, which all contribute to positive effect on the quality of life. The two variables “Protests per capita” and “Bankrupt Companies” have little effect on the quality of life, whereas high values for the last two variables, “the number of families with low ISEE” and “Urban Fragility”, strongly indicate a poor quality of life. Note that we do not have an overall variable “quality of life”, i.e. this is not a regression analysis.
Step 2: classical PCA output
The presence of three broad groups of variables suggested by the scatter plot matrix provides a useful reference for interpreting the subsequent results of the PCA, which we now apply to summarize these relationships and reduce dimensionality. The call to function pcaFS
out = pcaFS(citiesItaly2024);
automatically enables us to obtain the plot of the total variation of the data explained by the principal components Figure 2, the correlation of the 12 variables with the first two fitted principal components Figure A2, the outlier map Figure 5 and the interactive biplot Figure 6. For backward compatibility, the default FSDA graphics retain the legacy colour scheme when ’colorBlindSafe’ is set to false. In the revised figures used for interpretation in this paper, the option ’colorBlindSafe’ is set to true whenever grouped, signed, or ordered quantities are displayed. A detailed numerical output is also produced in the Command Window (Appendix § 13). The output of the call to pcaFS is a struct (in this case named out) which contains as fields (in table and array format) all the information given in the Command Window and the principal component scores.

Figure 2. Variance explained by the Principal Components.
Figure 5. Outlier map. The dashed contour is the inferential threshold for the combined score and orthogonal distances, computed using a Bonferronized 99% confidence level. Units outside the contour are marked by red circles, while marginal univariate outliers in score or orthogonal distance are shown by crosses in the boxplots.

Figure 6. Interactive biplot, showing row points and variables with labels using and .
Figure A2. Traditional representation of the correlations with PC1 and PC2. Option ’colorBlindSafe’ is not used and it is therefore set by default to false.
We now consider how much of the total variation in the data is explained by the principal components. Figure 2 shows that the first principal component explains almost 67% of the total. With two principal components this rises to near 77% and to 84% with three. We can expect that the first two principal components will give a good representation of the majority of the data.
If pcaFS is called with option pair <smartEVchart,true> the plots with a “smart” representation of the elements of the first two eigenvectors are shown (Figure 3 and Figure 4). In these figures, also option colorBlindSafe is set to true and the bars, stems, and variable labels are colored using the two extreme colors of the same HCL-based diverging palette used elsewhere in the paper: a blue hue for variables with a negative loading and a red hue for variables with a positive loading, replacing the fully saturated, non-colorblind-safe red/blue pair used by default by the function. The sign of each loading therefore remains immediately readable from color alone, while the ordering and magnitude of the loadings are conveyed, as before, by the horizontal position of the bars and by the font size of the variable names in the lower stem plot.

Figure 3. “Smart” representation of the ordered elements of the first eigenvector. The font size in the lower panel is proportional to the magnitude of the element. colorBlindSafe is set to true.

Figure 4. Smart representation of the elements of the second eigenvector. ’colorBlindSafe’ is set to true.
The upper panel of Figure 3 gives, in the title, the equation of PC1 (using the order of the elements of the first eigenvector) with the ordered elements of the first eigenvector in the lower panel. The three groups already identified in Figure 1 are clearly recovered in this representation, in which the variables are ordered by the magnitude of their correlations with PC1, with names in a font size proportional to the absolute values. The three groups remain clear, with “Protest” and “Bankruptcy” being less extreme in location and with a low coefficient. Figure 4 shows the plots of the elements of PC2 with the corresponding equation. Unlike PC1, which reflects the dominant socio-economic gradient, PC2 highlights contrasts within this structure, particularly separating variables such as “Protest” and “Bankruptcy”. In fact, both are remote from the centroid of the projections of the other variables and have appreciable weightings.
The interpretation of these plots is easy and provides insights into the structure of the data. Figure A2 shows the plots of the correlations between the variables and PC1 and PC2 in the order of the original data. It is possible, but not straightforward, to find some of the structure that is apparent in Figure 3 and Figure 4.
We now turn to the examination of the properties of the individual regions relative to the dominant structure, as revealed by the first two PCs. The first plot we consider is an extended version of the “outlier map”, introduced by Hubert et al. [ [12], which is shown in Figure 5.
The plot summarizes aspects of the projection of the row points onto the two-dimensional plane formed by the PCs. The “score distance” is the Mahalanobis distance of the projected point from the centroid of the projections. The axis of the plot is the orthogonal distance of the point from the PCA subspace. Good leverage points have large score distances and small orthogonal distances. The inferential contour in the plane of score and orthogonal distances is based on the combined value of the two distances and uses a Bonferronized 99% confidence level. Units outside the contour are therefore observations that are jointly extreme with respect to their projection on the PCA subspace and their residual distance from it.
More specifically, let denote the standardized, row vector associated with unit , let be the matrix containing the first loading vectors and let be the diagonal matrix of the corresponding eigenvalues. The score vector of unit is . The score distance and the orthogonal distance used in the outlier map are
The contour in Figure 5 is obtained by applying a bivariate rule to the vector of distances
If denotes the covariance matrix of these two distances, computed from the units used to estimate the PCA subspace, the combined distance is
The plotted contour is the level set
where is the number of units screened. Thus the nominal 99% level is Bonferronized over the units. Units satisfying are highlighted in red.
Figure 5 shows that Milan is the most evident bad leverage point, with both a large score distance and a large orthogonal distance. Bolzano and Syracuse are mainly orthogonal outliers, whereas Rome, Frosinone and Naples have comparatively large score distances. The marginal boxplots remain useful for detecting units that are extreme in either distance separately, but the contour gives the bivariate outlier rule used to identify the units highlighted in red. The three groups indicated in the preceding three figures are not evident in this plot.
This section has illustrated how interactive graphical tools can be used to explore the structure of multivariate data through PCA. Starting from a simple scatter plot matrix, we progressively introduced ordering, correlation summaries, and dimension reduction to reveal dominant patterns and groupings among variables. The analysis shows that a small number of principal components capture most of the variability in the data and that their interpretation is facilitated by interactive visualizations that link scores, loadings, and correlation structures. These representations provide insight into both global trends and local deviations, and they motivate the use of biplots and related tools for a more detailed investigation of the relationships among individual observations and variables, which is the focus of the next section.
Dynamic biplots and properties of individual regions
This section gives Step 3 of the workflow: using the dynamic biplot to connect variable interpretation, observation scores, confidence regions, and distance diagnostics. The controls shown in the screenshots are part of the implemented biplotFS interface and are also launched from pcaFS.
The biplot [9] overlays a score plot with a loading plot. Although the biplot allows information on both samples and variables of a data matrix to be displayed in the same graphic, there is a problem in relating the scales of the two plots to obtain visual impact. We build the biplot from the singular value decomposition (SVD) of the standardized deviation matrix (or, equivalently, the mean-centred matrix ). In what follows we work with of size . If instead one starts from , replace references to the correlation matrix by the covariance matrix . The SVD of is
If the first two principal components capture most of the total variance, we approximate by its best rank–2 approximation:
where is , is the matrix containing the first two eigenvectors of , and is the diagonal matrix of the top two singular values of – the square roots of the leading eigenvalues of . Writing instead
we obtain
where .
A dynamic representation of row points and column points (arrows) of which the two previous representations are special cases is obtained by introducing two new parameters and defined on . The singular value decomposition is then written as
In this case the row points can be represented by the matrix
and the column points by the matrix
A quite cryptic introduction to the biplot is given by Venables and Ripley [1999]. Brief comments on scaling are on p. 336. Two cases are of particular interest.
Case 1: and $\alpha = 0
In this case, row points represent standardized principal components . Arrows represent correlations between variables and principal components (the loadings). The length of the arrows is the communality of the variable (that is the proportion of the variance of a particular variable which is explained by the first two PCs).
Case 2: and $\alpha = 1
Now row points represent principal components and arrows represent the eigenvectors . In both cases it is customary to add a unit circle.
Case 1. The arrows close to the unit circle indicate the variables with communality close to 1.
Case 2. The arrows close to the unit circle indicate variables which play the most relevant part in the definition of the PC.
When interpoint distances in the biplot approximate Euclidean distances between observations in the original standardized space. Conversely, when , interpoint distances approximate Mahalanobis distances, with respect to the correlation (or covariance) matrix, again up to truncation error. In the latter case the Euclidean distance between two generic rows of matrix can be re-expressed. We use the notation of elementary vectors , (where is a vector of length with all elements equal to 0 except the -th which is equal to 1), when
because is the best rank 2 approximation of the correlation matrix . In short, controls whether emphasis is placed on interpreting relationships among variables (), or distances among observations (). The parameter , with , determines how the factor is distributed between rows and column points. When (default choice) the scaling is entirely assigned to the row points. On the other hand when the scaling factor is assigned entirely to the column points, column vectors are emphasized, and row points are correspondingly shrunk. Note that the parameter only redistributes the global factor between row and column points and it does not change the geometric interpretation within rows or within columns – only their relative size in the joint display.
The geometric interpretation of the biplot depends critically on the choice of and . These parameters shift emphasis between inter-point distances, relationships among variables and the relative scaling of row and column representations. We therefore provide an interactive GUI to explore these trade-offs in a dynamic and intuitive way. The two sliders at the top of Figure 6 specify the values of and . The figure shows that there are also options to show or hide score points and arrow labels, to control the percentage of displayed text labels, and to change the sign of the components. When hovering on the control with the pointer an automatic datatip comes out which informs the user about the meaning of the associated control.
In the biplot of Figure 6 we have taken and , values which we use in all the biplots in this paper as they lead, in this and many other examples, to a clear visual balance between the representations of variables and data points. The figure clearly shows the three groups of variables. Negative values of the first principal component are highly negatively correlated with variables indicating a good quality of life. The two variables positively correlated with PC1 indicate a poor quality of life. These variables are almost orthogonal to the two remaining variables, which have a small effect on the quality of life.
The outlier map plotted in Figure 5 shows the scores of the units, that is their Mahalanobis distances from the centroid of the variables in the plane of PC1 and PC2. It also shows the orthogonal distances of the units from the fitted plane. We extend the information from this plot, using the biplot to show both the location of the units in the space of PCs and their orthogonal distance from this plane.
In Figure 7 we have added a confidence ellipse to the biplot of Figure 6. The ellipse is calculated under the assumption of normality with the semi-axes equal to the square root of the requested quantile of the multiplied by the square root of the variances of the scores. depending on and . The confidence level is specified in the edit field control located next to conf. ell. which automatically appears when the conf. ell. checkbox is selected.

Figure 7. Biplot with confidence ellipse.
Note that when and the scores which are shown are standardized (their variance is equal to 1) therefore the ellipse becomes a circle. The names of the provinces are given only for those that lie outside the ellipse when check box showRowNames is selected. In this representation the three large cities Milan, Rome and Naples, with large negative values of PC2 stand out, together with the smaller province of Frosinone, which lies physically between Rome and Naples.
To provide the information on the orthogonal distance from the plane the biplot of Figure 6 must be augmented with the option color prop to orthogonal distance. Figure 8 illustrates the effect of the new colorBlindSafe option for a biplot in which row points are coloured according to their orthogonal distance from the PCA subspace. The comparison shows that the statistical information displayed in the plot is unchanged, whereas the revised palette provides a more accessible representation of the distance scale.

Figure 8. Biplot with row points coloured according to the orthogonal distance to the PCA subspace. The left panel shows the legacy palette ('colorBlindSafe' set to false); the right panel shows the revised colour-blind-safe palette ('colorBlindSafe' set to true). The PCA geometry is unchanged in the two panels.
The predominance of colors at the lower end of the sequential scale indicates that the properties of nearly all provinces are well explained by the first two PCs. The three provinces at the high end of the scale are, in decreasing order of distance, Milan, Bolzano and Syracuse. Figure A3, shows the biplot with colour for the orthogonal distances and a percentage of names around 45% as specified by the knob controller Text density percentage. Of course a percentage equal to 100 leads to a very congested plot while a percentage close to zero shows very few labels.

Figure A3. Biplot with colour proportional to the orthogonal distance; text density label around 45%. Option ’colorBlindSafe’ is not used and it is therefore set by default to false
The scatter plot matrix of Figure 1, and the ensuing plots and the biplots, all indicate that there are three groups of variables with high correlations within groups. We now consider the effect of the replacement of the twelve variables with just three, one representative of each group. The variables we keep are Employment (Employm), representing all those positively correlated with QoL (see Table 3), Urban Fragility (UrbanFra), representing negatively correlated variables and Protests per capita (Protest) to represent those with no correlation with quality of life.
The resulting biplot obtained with the code4
Xsel=citiesItaly2024(:,{'Employm' 'Protest' 'UrbanFra'});
out=pcaFS(Xsel);
is shown in Figure 9. The reduction from 12 variables to 3 removes the visual clutter of too many arrows. It also sharpens the visualization of units on the biplot. Compared with Figure 8, Figure 9 indicates that the data contain a tight cluster of about 60 units with small negative values of PC1, with the others virtually all having more dispersed positive values of PC1.

Figure 9. Biplot based on just 3 variables.
Robustness in PCA
This section gives Step 4 of the workflow and demonstrates the robust-PCA branch of the implementation. The purpose is to show not only which observations are flagged by a robust fit, but also how the low-dimensional PCA structure changes as the trimming level is varied.
We have already mentioned that the variables in PCA are scaled, often to have zero mean and unit variance. Any outliers in the original data will affect the scaling, perhaps appreciably. This suggests that robust methods for PCA should use hard trimming. That is, that some observations are given weight zero, while others are given weight 1. This is distinct from soft-trimming, or downweighting, such as S-estimation [17], in which outlying observations are given weights appreciably less than one. One such hard trimming method is the ROBPCA algorithm of Hubert et al. [2005] which uses the minimum covariance determinant (MCD) estimator with a specified breakdown point (bdp) to find a central ellipsoid of outlier free data, to which PCA is applied.
In our biplot GUI once the check box “Robust analysis” is selected a panel with two tabs named “Forward Search” and “MCD” automatically appears on the top of the GUI. Figure 10 shows the biplot for the very robust choice of 0.5 for the bdp of the MCD algorithm.

Figure 10. MCD. Biplot based on just 3 variables using the units not declared as outliers with bdp = 0.5 and a simultaneous confidence level of 99%. Note that in this case the sign of the first two PCs has been changed (see Change sign panel) in order to have the same layout as the other plots.
The filled circles in the plot are outliers from the MCD fit at the 99% simultaneous level. This plot clearly shows the compact group of units seen in Figure 9 and establishes that about 35% of the units do not belong to this group. In the MCD literature it is common to show the index plot of robust Mahalanobis distances and to compare robust and non-robust distances. These two plots can be obtained simply by selecting the associated check boxes MD index plot and rob vs non rob MD (see top right part of Figure 10).
While ROBPCA provides a well-established and computationally efficient approach to robust PCA, its output corresponds to a single choice of trimming level and yields a fixed robust fit. In contrast, the FSDA framework allows robustness to be explored dynamically, by examining how the fitted structure evolves as the effective subset size changes. This perspective emphasizes robustness not as a single estimate, but as a continuum of solutions indexed by the degree of trimming. Hard trimming using the Forward Search (FS) estimates the parameters of the model from subsets of increasing size from the data. A crucial point is that, for each value of , the model is refitted, the subset of size being chosen as the units with the smallest Mahalanobis distances. In this way observations can enter or leave the subset as increases. This sequential inclusion mechanism provides a natural way to study the stability of the principal components and to assess the influence of individual observations. In particular, it allows the analyst to distinguish between structural features of the data and effects driven by a small number of influential units, something that is difficult to assess from a single robust fit alone. Figure 11 shows the biplot for the FS when , which is close to the size of the outlier free subset identified by the MCD (if we select we obtain exactly the same plot as Figure 10). This biplot has very similar principal component directions to that of Figure 10. This stability suggests that the dominant structure is not driven by a small subset of observations. At the same time, the FS provides additional information by showing how and when individual units enter the model, offering a richer diagnostic perspective than a single robust fit. Atkinson et al. [ [2] describe numerous robust methods, with a focus on the use of the FS in regression. Chapter 5 of Atkinson et al. [ [1] describes and exemplifies the FS for PCA, but without the advantages of the modern interactive graphics that are the subject of this paper. In

Figure 11. Forward Search. Biplot based on just 3 variables. The highlighted units (filled circles) are those not belonging to the subset when .
the FS literature it is common to show forward plot minimum Mahalanobis distances and to monitor the MD as the subset size increases. This last plot is an extension of the plots which compare the robust and non robust Mahalanobis distances. These two plots can be obtained simply by selecting the associated check boxes minimum MD outside subset and monitoring MD (see top right part of Figure 11).
The structure revealed by our robust analyses is of a compact group of units, with many outliers. If the breakdown point of the robust fit is reduced, outliers are included in the observations used to estimate the parameters and, consequently, the group may not be evident. Figure A4 shows the biplot when the bdp of ROBPCA is appreciably reduced from 0.5 to 0.25. The principal components do not change much, so that the scatter of the points is similar to that of Figure 10 and Figure 11. However, only 4 outliers are identified. An automatic method for the detection of groups in the data with such a low bdp would fail.

Figure A4. MCD. Biplot based on just 3 variables using the units not declared as outliers with bdp = 0.25 and a simultaneous confidence level of 99%. The fourth unit declared as an outlier at the top of the plot is the town of Caltanissetta (Sicily).
Note that the proportion of variance explained by the MCD estimator varies with the choice of the bdp and, in general, so will the principal components and the biplot. This follows because these quantities are computed using only those observations that are not identified as outliers. Similarly, in the FS approach, the explained variance depends on the specific subset of units included at each step of the procedure.
The combination of interactive graphics and forward monitoring therefore provides insight that goes beyond standard robust PCA implementations, supporting a more informed and transparent exploration of multivariate structure. Within FSDA, robustness is thus treated as an exploratory dimension rather than a fixed modelling choice: hard trimming methods and interactive graphical tools allow users to examine how principal components and data structure evolve as the degree of robustness changes.
Linked brushing and geography
This section gives Step 5 of the workflow. Brushing is used to define subsets in the PCA display, and the selected indices are propagated to scatter plot matrices and maps. In the interactive session the analyst can draw these selections with the mouse. The replication scripts launch the same linked displays used in the paper and document the commands required to reproduce the computational workflow. The final appearance of the brushed figures depends on the manual selections described in Section 10.
We continue with the analysis including only the three variables and now tie our results to the geography of Italy. Function pcaFS also allows the user to supply the vector of latitudes and longitudes of the statistical units of the sample or the corresponding geographical shapes. When the instruction load citiesItaly2024.mat is invoked the table citiesItaly2024 which is loaded into memory contains inside Properties.Userdata
citiesItaly2024.Properties.UserData
a cell array with two elements.
ans =
1 x 2 cell array
{107 x 13 table} {107 x 2 double}
The first is a geographic table (called a geotable in MATLAB) that is a table with the field named Shape containing the shapes of the provinces and the second is a matrix with two columns containing respectively the latitude and longitude coordinates. The call
ShapeFile=citiesItaly2024.Properties.UserData{1};
out=pcaFS(Xsel,’ShapeFile’,ShapeFile);
unlike the plots that we have seen so far, produces an interactive geomap (see Figure 12). As a default the colouring is based on the first PC but it can be changed to the second PC. Similarly it is possible in an interactive way to hide or show labels, specify the type of map, the coordinates (satellite or not) the map type and reverse the colour.

Figure 12. Interactive geomap with colour based on the values of the first PC. Type of map is “streets-light”. The map for the second PC is exhibited by clicking on the Color based on Drop Down control.
In order to have additional information of the geographical position of the units which occupy particular areas in the biplot we use brushing and linked plots.
Our initial example of brushing is illustrated in Figure 13, which we treat in some detail. We start from the non-robust biplot of Figure 9, that is with three variables and all provinces. We use the mouse to select the group of provinces that form the compact group. The centre panel of the figure shows scatter plots of the brushed units as filled highlighted circles. They indeed have a much smaller scatter in all panels of the scatter plot matrix than the non-brushed units. Notice that the legends are clickable, in the sense that clicking on the item in the legend, it is possible to hide or show the corresponding units in the scatter plot matrix. The other plot, which automatically appears after brushing, is the one given in the right-hand panel, which shows the position of the brushed provinces on the map of Italy. With the exception of Milan, all the provinces are located in the north-central part of Italy.

Figure 13. Brushing the most compact group which corresponds (with the exception of Milan) to all the provinces located in the north-central part of Italy.
The geographical outcome of this analysis could not be clearer. We continue by brushing the units with the largest value of protest. Figure 14 shows that these lie in the lower right-hand quadrant of the biplot. The scatter plot matrix in the centre panel of Figure 14 shows that high values of protest are not related to employment or urban fragility. The map of these provinces shows that they all lie along the coast on either side of Naples. Note, however, that Naples is very close to the provinces selected for brushing in the left part of Figure 14.

Figure 14. Brushing the units with the largest values of protest (in the lower right part of the biplot).
As a final analysis of the data using three variables, we brush on the units with the largest values of urban fragility, which lie in the top-right hand quadrant of the biplot. The right-hand panel of Figure 15 shows that all these provinces lie in the south of Italy. The provinces of Sicily tend to have colors closer to the high end of the map scale than those of the provinces of Sardinia, in general indicating a lower quality of life.

Figure 15. Brushing the units with the largest values of urban fragility (in the upper right part of the biplot).
In conclusion, we used three similar brushes on the biplot coming from the analysis including all 12 variables. This led to the identification of all except two of the provinces shown in the PCA with just three variables. This provides a confirmation that the analysis based on the three variables is representative of the analysis based on all 12 variables.
As a further analysis we now show what can be obtained if the latitude and longitude are included in the call to pcaFS. The code below
LatLong=citiesItaly2024.Properties.UserData{2};
Latitude=LatLong(:,1);
Longitude=LatLong(:,2);
out=pcaFS(citiesItaly2024,'Latitude',Latitude,'Longitude',Longitude);
automatically adds, to the previous plots, a geobubble plot, where the size of the bubble depends on the value of the first PC and the colour on the value of the second PC (see left panel of Figure 16). When latitude and longitude are supplied, once a brushing is performed, the geobubble showing the selected units (in addition to the scatter plot matrix) is automatically shown on the screen. For example, Figure 16 shows that once the provinces with the most negative values of the first PC are selected (with the exception of Milan at the bottom of the biplot, see Figure 7), the corresponding geobubble of the selected units reveals that these units all belong to the northern central part of Italy. Specifically, the coastal towns of Liguria, including Genoa, are not in the group with the smallest values of PC1.

Figure 16. Brushing in the space of first two PCs using all the 12 variables reveals the location of the units with the most negative values of the first PC.
Three-dimensional projection diagnostics
In this section we describe our routine pcaProjection which enables plotting of both the points in the original space and their respective projections in the low dimensional space together with a confidence ellipsoid in the two spaces. The code below
pcaProjection(Xsel)
produces Figure 17 and Figure 18. All these plots allow rotation. Therefore, a static printed view does not capture all the different angles of view. Figure 17 illustrates different projections of the data: the top-left panel shows the projection onto PC1 alone, the top-right panel displays the projection onto the plane spanned by the first two PCs, and the third plot represents the data in the three-dimensional space of the first three PCs. This comparison highlights that Aosta is not well represented in the space of the first two principal components, since its structure becomes apparent only when the third component is taken into account.

Figure 17. Top left: projection in the plane of PC1, top right projection in the plane of the first two PCs. Lower panel, plot in the space of the 3 PCs. Note that Aosta is not well represented in the space of the first two PCs.

Figure 18. Left panel: ellipsoid in the space of the 3 PCs. Right panel: original 3D ellipsoid; Milan, Rome and Frosinone are outside the confidence ellipsoid. Note that these three towns showed up in Figure A4.
Figure 18 compares the ellipsoid in the original and transformed space. The left panel displays the confidence ellipsoid in the three-dimensional space spanned by the first three principal components, providing a geometric summary of the joint variability of the observations. The right panel shows the original 99% confidence ellipsoid in the same space, superimposed with the observed data points. It is evident that Milan, Rome and Frosinone lie outside the ellipsoid, indicating atypical behaviour relative to the main data structure captured by the first three PCs.
Replication material
The replication material for this paper is distributed with the submission and is also available from the public GitHub repository https://github.com/UniprJRC/PCAinteractive. In response to the JSS replication requirements, the material has been reorganized around a single commented MATLAB script, replication.m, located in the root directory of the repository. This file is the primary entry point for reproducing the analyses in the paper.
The script replication.m is divided into labelled sections following the order of the manuscript. It first checks that the required FSDA functionality is available and loads the data set citiesItaly2024.mat. It then reproduces the scatter plot matrix, the classical PCA output, the dynamic biplot examples, the robust PCA analyses, the linked brushing and geographical displays, the three-dimensional projection diagnostics, and the appendix figures. Thus the computational workflow is documented and launched from a single script, in a single file rather than being split across several figure-specific scripts.
The interactive operations described in the paper, such as brushing, linking, dynamic updating of biplots, map interaction, and manual rotation of three-dimensional figures, require either a MATLAB Desktop session or MATLAB Online. The replication script launches the same interactive displays used in the paper and contains comments indicating the manual actions needed to reproduce the corresponding screenshots. Thus the computational workflow is reproducible from a single script, while the final visual appearance of some interactive figures depends on the user interaction described in the relevant sections of the manuscript.
The data used in the paper are the 2024 quality-of-life indicators for the 107 Italian provinces. In the MATLAB script the data are loaded from citiesItaly2024.mat, which is distributed with the required version of FSDA. To facilitate use outside MATLAB, the repository also contains the file data/citiesItaly2024.geojson. This file includes the 12 variables used in the PCA analysis, the geographical contours of the 107 provinces, and the latitude and longitude information used by the linked map displays. The auxiliary file data/readInteractivePCA.R reads the GeoJSON file in R and creates three data frames: Xeco, containing the 12 quality-of-life variables; XLatLong, containing latitude and longitude; and Xgeo, containing the geographical variables.
The graphical commands in replication.m use the colour-blind-safe option of the new FSDA graphics whenever grouped, signed, or ordered quantities are displayed. For example, the scatter plot matrix is generated by spmplot with option ’colorBlindSafe’ set to true, and the PCA examples call pcaFS with the same option. Commented alternative commands using the legacy palette are retained only to document the difference between the previous and revised graphical defaults.
For convenience, the repository also contains an extra/ directory. This directory collects the earlier figure-specific scripts and the corresponding .ipynb notebooks, which are retained only as optional inspection and teaching material. They are not required for reproducing the paper: the reference replication file is the single commented script replication.m in the root directory.
Summary, limitations, and extensions
This paper documents new FSDA functionality for interactive and robust PCA graphics in MATLAB. The contribution is software integration. The implemented workflow combines classical PCA output, dynamic biplot scaling, score and orthogonal-distance diagnostics, robust hard trimming through MCD and the Forward Search, linked brushing, geographical displays, and three-dimensional projection diagnostics. The Italian provinces case study illustrates how these components are used together: pairwise plots identify variable groups, classical PCA summarizes the dominant socio-economic gradient, robust analyses reveal the stability of this structure under trimming, and linked brushing connects PCA subsets to geography.
There are also limitations. The principal methodology remains linear PCA, so nonlinear structures may require methods outside the scope of the current implementation. The interactive layer relies on MATLAB graphics handles, UI components, and callbacks, which limits full compatibility with GNU Octave; the computational core is more portable than the interactive interface. Finally, color and interaction choices must be documented carefully because screenshots alone cannot fully convey an interactive analysis. The replication scripts therefore document the commands used to launch the same interactive displays and provide reproducible code for the non-interactive parts of the analysis, while the final appearance of some brushed or rotated figures depends on the user interaction described in § 10.
Natural extensions include nonlinear dimension reduction methods such as Isomap [24] and Locally Linear Embedding [23], and autoencoder-based nonlinear PCA [11]. Such extensions would require new diagnostics because the biplot geometry used here is linear. Nevertheless, the same design principles – common output structures, linked selections, robust diagnostics, and script-level reproducibility – could be reused.
Further Figures
In this appendix we present extra figures that complement, or contrast with, those in the main body of the paper.
Figure A1 is the scatter plot matrix of the data in the order of presentation in § 5. The grouping of the variables which was so evident in Figure 1 is not indicated by this plot. It is also not strongly indicated if the data in the original order are plotted using the modified scatter plot matrix. For these data, the ordering is crucial in suggesting the grouping structure.
We now turn to the structure of the PCs. Figure 3 and Figure 4 show a “smart” representation of the elements of the first two eigenvectors. The elements are ordered by their contributions to the two PCs (so the order is different in the two plots). The conventional plot is shown in Figure A2 in which the correlations of the variables with the two PCs is plotted in the order of the variables in Table 3. As we remark in § 5, it is possible, but not easy, to see some of the structure of the data in this plot. In particular, there are two variables with strong positive correlations with PC1 and two other variables with strong negative correlations with PC2. However, the lower panels of Figure 3 and Figure 4 contribute much more information.
Figure 8 introduced the use of colour in the biplot in order to express the distance of the units from the PC1-PC2 plane. Figure A3 adds the names of the units to this plot. The percentage of names is around 45% as specified by the knob controller Text density percentage which automatically appears once showRowNames checkbox is selected.
Note that Figure A3 retains the legacy palette (’colorBlindSafe’ set by default to false) and thus illustrates the previous graphical default rather than the revised palette policy. Under that policy, shown in the right-hand panel of Figure 8, ordered magnitudes such as orthogonal distances use a perceptually ordered sequential HCL-based scale, and grouped or brushed observations combine color with marker shape or fill so that interpretation does not depend on hue alone, following Zeileis et al. [ [30] and Crameri et al. [ [5].
Figure 10 showed the robust biplot based on just 3 variables using the MCD with bdp =
0.5. Figure A4 shows the results of the calculation when the bdp = 0.25. There are just four units declared as outliers from this less robust choice of the trimming parameter. The level of the simultaneous confidence ellipse is again 99%. Note that the MCD has found outliers in the three-dimensional space of the variables, not in the space of the first two PCs.
Output in the Command Window
In this appendix we present the output which appears in the Command Window (or inside the .mlx file) once the routine pcaFS is called. For example, the call to pcaFS and the corresponding output are shown below:
Xsel=citiesItaly2024(:,{'Employm' 'Protest' 'UrbanFra'});
out=pcaFS(Xsel)
Initial correlation matrix
Employm Protest UrbanFra
------- ------- --------
Employm 1.00 -0.31 -0.90
Protest -0.31 1.00 0.23

Figure A5. Automatic completion of function options in the MATLAB editor. The JSON signature file distributed with the FSDA implementation allows the editor to suggest the available name-value arguments after the first required input argument has been supplied (top panel). Once a particular option has been selected, the editor suggests the admissible values or value types (bottom panel). For example, the option ’plots’ can be specified either as a logical value or as a string vector identifying the plots to be shown. This makes the insertion of options easier and reduces the need to consult the help file.
UrbanFra -0.90 0.23 1.00
Explained variance by PCs
Eigenvalues Explained_Variance Explained_Variance_cum
----------- ------------------ ----------------------
PC1 2.04 67.98 67.98
PC2 0.86 28.75 96.73
PC3 0.10 3.27 100.00
Loadings = correlations between variables and PCs
PC1 PC2
----- -----
Employm -0.96 -0.18
Protest 0.49 -0.87
UrbanFra 0.94 0.28
Communalities
PC1 PC2 PC1-PC2
---- ---- -------
Employm 0.92 0.03 0.95
Protest 0.24 0.75 1.00
UrbanFra 0.88 0.08 0.95
Combined OD-SD confidence level: 99.9907%
Squared combined OD-SD threshold: 18.556
Units outside the combined OD-SD confidence contour
Combined OD-SD
--------------
Milano 40.6
Frosinone 29.018
Aosta 28.593
Roma 26.156
Barletta-Andria-Trani 21.787
Taranto 19.354
out = struct with fields:
Rtable: [3x3 table]
explained: [3x3 double]
explainedT: [3x3 table]
coeff: [3x2 double]
coeffT: [3x2 table]
loadings: [3x2 double]
loadingsT: [3x2 table]
communalities: [3x3 double]
communalitiesT: [3x3 table]
score: [107x2 double]
scoreT: [107x2 table]
orthDist: [107x1 double]
scoreDist: [107x1 double]
class: "pcaFS"
Overview of functionalities
Table C.1 complements Table 2 by giving documentation links for the FSDA functions and interactive tools discussed in the paper. The main text describes the implementation design; this appendix is a compact reference for users who want to locate the corresponding help pages.
| Function or capability | Role in the workflow | Main returned or displayed information | Interactive or extensible features |
| spmplot | Pairwise exploration before PCA. | Scatter plot matrix, correlations, variable ordering, and optional superimposition of ellipses or contours, backgrounds depending on correlation. | Alternative upper/lower-panel displays, AOE ordering (§ 5.1), linked highlighting. |
| pcaFS | Main PCA entry point. | Explained variance, eigenvectors, loadings, communalities, scores, distances, outlier map, and biplot. | Launches “smart” eigenvector plots, dynamic biplot, robust panels, maps, and brushing. |
| biplotFS | Standalone biplot engine. | Row coordinates, arrow coordinates, labels, confidence ellipse, and figure handles. | Sliders for and , sign changes, label density, coloring by diagnostics, brushing. |
| MCD panel in pcaFS | Fixed robust PCA fit. | Robust subset, robust distances, outlier flags, and robust biplot. | Breakdown-point and confidence-level controls; robust/non-robust distance comparison. |
| Forward Search panel in pcaFS | Monitoring robust PCA along subset sizes. | Evolution of distances and PCA structure as increases. | Subset-size slider, automatic mode, and monitoring plots linked to the biplot. |
| Geographical options | Spatial interpretation of PCA results. | Geomap or geobubble displays based on scores, selected units, and shapes or coordinates. | Linked brushing between PCA plots, scatter plot matrices, and maps. |
| pcaProjection | Three-dimensional projection diagnostics. | Original and projected points, fitted subspaces, and confidence ellipsoids. | Rotatable three-dimensional displays and assessment beyond two PCs. |
Table 2. Main FSDA functions and capabilities used in the paper. The table identifies the role of each component in the implemented workflow.
Compatibility with Octave
The underlying computational routines for PCA in our work exhibit a significant degree of compatibility with GNU Octave. Notably, the function pcaProjection, responsible for executing the numerical projection and transformation steps, can function well within Octave when it is called using a 2D array, producing all informative plots. This allows users to employ the essential computational aspects of our developed tools even if they are using Octave. However, there are limitations concerning the interactive components of our software.
The core contribution of the present work involves the creation of integrated and dynamic graphical tools that feature capabilities such as brushing, linking across multiple graphical views (biplots, scatter plot matrices, and geographical maps), real-time GUI controls, and event-driven callbacks. These features depend heavily on MATLAB-specific graphics handles, UI components, and interaction mechanisms, which currently do not have equivalent functionality in GNU Octave. As such, full compatibility with Octave for these interactive elements is, at this point, technically infeasible. We recognize these limitations but remain optimistic that future developments in GNU Octave may provide solutions that will allow for enhanced compatibility, overcoming some of the current obstacles in mirroring MATLAB’s interactive graphical features.
| FSDA function / capability | Purpose | Illustrative use in paper |
| spmplot | Extended scatter plot matrix with variable ordering, correlation summaries, background colouring, and interactive options. | Exploratory analysis of pairwise relationships and correlation structure (Section 5, Appendix A). |
| http://rosa.unipr.it/FSDA/spmplot.html | ||
| pcaFS | Core routine for classical PCA with integrated numerical output, graphical displays, interactivity, robustness options, and linked brushing. | Principal component analysis, scree plots, smart eigenvector displays, outlier maps, biplots, robustness diagnostics, and geographical visualizations (Sections 5, 6, 7, 8). |
| Robust PCA via MCD (within pcaFS) | Hard-trimming robust PCA based on the Minimum Covariance Determinant with user-specified breakdown point. | Identification of outliers and comparison of robust and non-robust PCA fits (Section 7). |
| Forward Search PCA (within pcaFS) | Hard-trimming approach that monitors the evolution of PCA structure as the size of the subset used for the fit increases. | Assessment of stability of principal components and influence of individual observations (Section 7). |
| Robustness diagnostics (integrated panels of pcaFS) | Monitoring plots of Mahalanobis distances, robust vs non-robust distances, and forward plots linked to PCA representations. | Exploration of outlyingness and robustness as an exploratory dimension (Section 7). |
| Geographical and brushing tools (’ShapeFile’ option of pcaFS) | Linked brushing between PCA plots, scatter plot matrices, geomaps, and geobubble representations. | Spatial interpretation of PCA scores and robust structures (Section 8). |
| http://rosa.unipr.it/FSDA/pcaFS.html | ||
| biplotFS | Standalone interactive biplot with configurable scaling parameters, sign changes, confidence regions, and colouring options. | Focused exploration of biplot representations, including reduced-variable analyses (Section 6). |
| http://rosa.unipr.it/FSDA/biplotFS.html | ||
| pcaProjection | Three-dimensional visualization of observations, projections, and confidence ellipsoids in original and PCA spaces. | Assessment of representation quality beyond two principal components (Section 9). |
| http://rosa.unipr.it/FSDA/pcaProjection.html |
Table C.1. Overview of FSDA functions discussed in the paper, with links to documentation
References
- [1]A. C. Atkinson, M. Riani, and A. Cerolioli. Exploring Multivariate Data with the Forward Search. Springer–Verlag, New York, 2004.DOI
- [2]Anthony C. Atkinson, Marco Riani, Aldo Corbellini, Domenico Perrotta, and Valentin Todorov. Robust Statistics through the Monitoring Approach: Applications in Regression. Springer-Verlag, Heidelberg, 2025.DOI
- [3]I. Azzini, D. Perrotta, and F. Torti. A practically efficient fixed-pivot selection algorithm and its extensible matlab suite, 2023. arXiv, stat.ME, DOI: 10.48550/arXiv.2302.05705.DOI
- [4]Davide Ballabio. A matlab toolbox for principal component analysis and unsupervised exploration of data structure. Chemometrics and Intelligent Laboratory Systems, 149: 1–9, 2015. ISSN 0169-7439.DOI
- [5]Fabio Crameri, Grace E. Shephard, and Philip J. Heron. The misuse of colour in science communication. Nature Communications, 11:5444, 2020.DOI
- [6]S. Dray and AB. Dufour. The ade4 package: Implementing the duality diagram for ecologists. Journal of Statistical Software, 22(4):1–20, 2007.
- [7]Bruno Falissard. A spherical representation of a correlation matrix. Journal of Classification, 13:267–280, 1996. doi: 10.1007/BF01246102.DOI
- [8]Michael Friendly. Corrgrams: Exploratory displays for correlation matrices. The American Statistician, 56(4):316–324, November 2002.
- [9]K. R. Gabriel. The biplot graphic display of matrices with application to principal component analysis. Biometrika, 58(3):453–467, 1971. doi: 10.1093/biomet/58.3.453.DOI
- [10]Michael Greenacre, Patrick J. F. Groenen, Trevor Hastie, Alfonso Iodice D’Enza, Angelos Markos, and Elena Tuzhilina. Principal component analysis. Nature Reviews Methods Primers, 2:1–22, 2022. doi: 10.1038/s43586-022-00184-w.DOI
- [11]Geoffrey E. Hinton and Ruslan R. Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313(5786):504–507, 2006. doi: 10.1126/science.1127647.DOI
- [12]M. Hubert, P. J. Rousseeuw, and K. Vanden Branden. ROBPCA: A new approach to robust principal component analysis. Technometrics, 47:64–79, 2005.
- [13]I. T. Jolliffe. Principal Component Analysis, 2nd Edition. Springer-Verlag, New York, 2002.
- [14]Alboukadel Kassambara and Fabian Mundt. factoextra: Extract and Visualize the Results of Multivariate Data Analyses, 2020. URL https://CRAN.R-project.org/package=factoextra. R package version 1.0.7.
- [16]F. Marini and H. Binder. pcaexplorer: An r / bioconductor package for interacting with pca results. BMC Bioinformatics, 20(1):331, 2019. doi: 10.1186/s12859-019-2879-1.
- [17]R. A. Maronna, R. D. Martin, V. J. Yohai, and M. Salibian-Barrera. Robust Statistics: Theory and Methods (with R), 2nd edn. Wiley, Chichester, 2019.
- [18]F. Pedregosa, G. Varoquaux, A. Gramfort, et al. Scikit-learn: Machine learning in python. Journal of Machine Learning Research, 12(85):2825–2830, 2011.arxiv.org/abs/1201.0490
- [19]M. Riani, D. Perrotta, and F. Torti. FSDA: a MATLAB toolbox for robust analysis and interactive data exploration. Chemometrics and Intelligent Laboratory Systems, 116:17–32, 2012. doi:10.1016/j.chemolab.2012.03.017.DOI
- [20]M. Riani, A. Cerioli, D. Perrotta, and F. Torti. Simulating mixtures of multivariate data with fixed cluster overlap in fsda library. Adv Data Anal Classif, 9:461–481, 2015a. doi: 10.1007/s11634-015-0223-9.DOI
- [21]M. Riani, D. Perrotta, and A. Cerioli. The forward search for very large datasets. Journal of Statistical Software, 67(1):1–20, 2015b.
- [22]M. Riani, Aldo Cerbellini, Anthony C. Atkinson, Luigi Grossi, Fabrizio Laurini, Gianluca Morelli, Domenico Perrotta, and Francesca Torti. Data Science with MATLAB. Giappichelli, 2025. ISBN 9791221164923. Digital edition.
- [23]Sam T. Roweis and Lawrence K. Saul. Nonlinear dimensionality reduction by locally linear embedding. Science, 290(5500):2323–2326, 2000. doi: 10.1126/science.290.5500.2323.DOI
- [24]Joshua B. Tenenbaum, Vin de Silva, and John C. Langford. A global geometric framework for nonlinear dimensionality reduction. Science, 290(5500):2319–2323, 2000. doi: 10.1126/science.290.5500.2319.DOI
- [26]Valentin Todorov and Peter Filzmoser. rrcov: Scalable Robust Estimators with High Breakdown Point, 2024. URL https://CRAN.R-project.org/package=rrcov. R package.
- [27]Pierre Vaissie, Alexandra Monge, and Francois Husson. Factoshiny: Perform Factorial Analysis from FactoMineR with a Shiny Application, 2024. URL https://CRAN.R-project.org/package=Factoshiny. R package.
- [29]Achim Zeileis, Kurt Hornik, and Paul Murrell. Escaping rgbland: Selecting colors for statistical graphics. Journal of Statistical Software, 31(1):1–27, 2009. doi: 10.18637/jss.v031.i01.
- [30]Achim Zeileis, Jason C. Fisher, Kurt Hornik, Ross Ihaka, Claire D. McWhite, Paul Murrell, Reto Stauffer, and Claus O. Wilke. colorspace: A toolbox for manipulating and assessing colors and palettes. Journal of Statistical Software, 96(1):1–49, 2020. doi: 10.18637/jss.v096.i01.DOI


