I have some longitudinal measurement data of 15,000. I smoothed that data with B-spline smoothing and got the following curve.

enter image description here

I then want to quantify this curve and extract features for clustering the curve of 15,000 data.

So I will calculate the curvature to quantify the curve and add that curvature to the features. To increase the number of features for clustering, I would like to obtain features by other means of quantification. However, I do not know of any other means of quantifying curves. So, please tell me other ways to quantify the curve.

  • $\begingroup$ How about computing the curves, then performing K-means based on the L2 distance? Or the L2 distance of their second derivative if you are interested in curvatures. $\endgroup$
    – Manuel
    Commented Jan 24 at 21:25

2 Answers 2


As @user11852 you could use refund package in R. It has a function fpcs.sc() that uses B-spline basis functions for estimation of the mean function and bivariate smoothing of the covariance surface. Here is an example using cd4 dataset in refund package.


data('cd4', package = 'refund')

Fit.MM <- refund::fpca.sc(cd4, nbasis = 10, npc = 3)

## plot estimated mean function

Fit.mu <- data.frame(mu = Fit.MM$mu,
                     d = as.numeric(colnames(cd4)))
ggplot(Fit.mu, aes(x = d, y = mu)) + geom_path() +
  labs(x = 'Months since seroconversion', y = 'Total CD4 Cell Count')

One could put all the curves together and apply FPCA. As the underlying data are "dense" we can use the FPCA projection scores directly (e.g. for clustering as in the OPs request) and interpret their respective modes of variation.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.