# Empirical basis functions

Preliminary

Consider $$n$$ individuals each with observed data $$Z_i, i = 1, \ldots, n$$. For each individual $$i$$, the longitudinal predictor $$Z_i = \{Z_i(t_{i1}), \ldots, Z_i(t_{i,R_i})\}$$ is measured at some finite number of observation times $$t_i = (t_{i1}, \ldots, t_{i,R_i})$$. We can define a finite grid as $$\bigcup_{i=1}^{n} t_i$$, covering all unique observation times for the sample, with $$\tau = \max (\bigcup_{i=1}^{n} t_i)$$.

The article says:

Start with an arbitrary set of smooth basis functions $$\psi_1(t), \ldots, \psi_K(t)$$ to characterize the functional predictor, where $$K$$ denotes the total number of basis functions. The set of basis functions can be, for example, the empirical basis functions estimated by the conventional FPCA method, but can be flexibly extended to other basis functions. The functional data can then be rewritten in matrix notation as $$(Z_1(t), \ldots, Z_n(t))^T = \bf{\lambda}\bf{\psi}(t)$$, where $$\bf{\lambda} = (\lambda_1, \ldots, \lambda_n)^T$$, with $$\lambda_i = (\lambda_{i,1}, \ldots, \lambda_{i,K})^T$$, and $$\bf{\psi}(t) = (\psi_1(t), \ldots, \psi_K(t))^T$$, $$t \in [0, \tau]$$.

$$\bf{M}$$ is of dimension $$K \times K$$, with the $$(k, k')$$ entry being $$\langle \psi_k(t), \psi_{k'} (t) \rangle$$ for $$k, k' \in K$$, $$t \in [0, \tau]$$.

My question:

As you can see $$Z_{i}$$'s are irregular and sparse. So, if we were to write it in matrix notation, then we would have NAs in it. For example,

  ####
set.seed(123)
# number of observations
n <- 10
# underlying function
f <- function(t) {
sin(t)
}
# generate irregular and sparse functional data
Z <- matrix(NA, nrow = n, ncol = 11)
for (i in 1:n) {
# generate random observation times
R <- sample(3:10, size = 1)
t <- sort(sample(0:10, size =R))
# sample the function at these times
y <- f(t) + rnorm(length(t), sd = 0.1)  # add some noise

# return
Z[i, match(t, c(0:10))] <- y
}
colnames(Z) <- 0:10


So, my understanding that $$\bf{\lambda}$$ is a matrix $$n \times K$$ and $$\bf{M}$$ is $$K \times K$$. So, the the empirical basis functions estimated by the conventional FPCA method are the eigenfunction, but if so, I can not have $$K$$ eigenfunction and subsequently can not obtain coefficients matrix $$\bf{\lambda}$$ (or scores) that is $$n \times K$$