# Directed Clustering of Multivariate Data Based on Linear or Quadratic Latent Variable Models
## 7 Comparison with Principal Curves  
The fitted curves shown in the previous sections suggest that this methodology could be seen as another approach to estimating principal curves [22]. Both principal curves and the proposed methodology aim to approximate multivariate datasets with smooth curves parameterized by a one-dimensional latent variable. Figure 11: The ratio of flow over speed against \(z_{k}\) for the two speed-flow datasets, presented in the same order as in Figure 1.  
Figure 10: For the second speed-flow dataset, on the southbound freeway SR57-S, **left panel**: clustering of the speed-flow data using the MAP rule; **right panel**: clustered projections (dashed lines) of the speed-flow data. Figure 9: For the calspeedflow data, **left panel**: clustering of the speed-flow data using the MAP rule; **right panel**: clustered projections (dashed lines) of the the speed-flow data. It is clear that the model formulation (3), which encompasses both the linear and the quadratic case, can be seen as special cases of a generative data model  
\[x_{i}=g(z_{i})+\varepsilon_{i}, \tag{12}\]  
where \(g:\mathbb{R}\mapsto\mathbb{R}^{m}\) is a smooth curve. This model was formulated by [PERSON] and [PERSON] [22] as their base model for their approach to estimating principal curves, informally defined as'smooth curves passing through the middle of a dataset'. Their estimation approach is based on the self-consistency property, loosely meaning that each point on the curve is the mean of all data points, which project onto that point. Under this approach, \(g\) is not actually the principal curve for data generated from the model (12). An example illustrating this point is provided by [34]. However, conceptually, it is still right to think of 'principal curves' being a concept trying to estimate \(g\) in (12), and other principal curve definitions, such as by Ref. [34], do not suffer from this conceptual issue. Some principal curve estimation approaches, including local principal curves [35], do not even postulate an underlying model at all. In either case, the similarity between (3) and (12) justifies a brief comparative look at our approach in relation to principal curves. Here, we restrict to the first of the two speed-flow datasets. We choose to fit the quadratic model with \(K=4\), which leads to a minimum BIC value of 7359.93, for comparison with the principal curves. We also fit the data with a Hastie and Stuetzle principal curve, using the R package **princcurve**[36], and a local principal curve (LPC), using R package **LPCM**[23]. The results are shown in Figure 12. We observe that both the fitted HS principal curve (top left panel) and the curve arising from the quadratic latent variable model (bottom panel) fail to fully capture the curvature of the data. In contrast, the local principal curve (top right panel) manages to pull into the endpoint associated with maximum traffic density. One can still argue that the latent variable model produces a sensible result: The methodology aims to locate the mixture centers, which it has done convincingly, and other points around them are considered just noise (belonging to the respective clusters). Figure 12: **Top**: Hastie–Stuetzle (**left**, solid) and local principal curve (**right**, solid) with orthogonal projections (dashed) of the data onto the fitted curve; **bottom**: the fitted curve (solid) resulting from the quadratic latent variable model, with projections (dashed) onto the curve defined by the realization of the latent variable at the posterior random effect of the respective data point. The main difference between the approaches lies in the way the projections are carried out, as is evident in Figure 12. While under the HS and LPC frameworks, one has orthogonal projections; under the latent variable approach proposed in this paper, one does not, since the dashed lines \(x_{i}-g(z_{i}^{*},\theta)\) are driven toward the cluster centers.