"In eigchk(Cmat) : Near singularity in coefficient matrix." with fregress function

18 views Asked by At

I'm attempting to make predictions with functional data in R using the fRegress function from the fda package. When predicting with a single variable, I encounter no issues. However, when using multiple variables, I receive the following error message:

Log10 Eigenvalues range from
 -9.34267170317535  to  10.6408734772387 
Error in solve.default(Cmat) : 
  le système est numériquement singulier : conditionnement de la réciproque = 7.05993e-21
De plus : Warning message:
In eigchk(Cmat) : Near singularity in coefficient matrix.

My code is structured as follows:

fRegressList = fRegress(resp, Xlist, betalist)

Where betalist is a list of 5 bases (one constant and four Fourier bases), and Xlist is a list of size 5 constructed as follows:

Xlist = vector("list", length(df_transposed_list))
  Xlist[[1]] = rep(1, length(df_transposed_list[[1]]))
  for (i in seq_along(df_transposed_list)) {
  XSmooth = smooth.basis(t, as.matrix(df_transposed_list[[i]]), fdPar)
  Xfd = XSmooth$fd
  Xlist[[i+1]] = Xfd
  }

I found similar error messages on the forum, suggesting issues with non-invertible matrices, but I couldn't find specific information about this function and how to resolve the problem.

Thank you in advance for your help.

0

There are 0 answers