djwtouw / CGGMR

0 stars 0 forks source link

Tuning parameter and scores #1

Closed aalfons closed 9 months ago

aalfons commented 10 months ago

In cggmCV(), it might be a good idea to have an additional argument tuning which takes a data frame with columns lambda, phi, and k. If it is missing, this data frame can be created with expand.grid(lambda = lambda, phi = phi, k = k) to have the complete 3-dimensional grid. But the advantage of suppling such a data frame is that the user can supply different combinations of values (e.g., different lambda values for different phi and k) to avoid evaluating the complete 3-dimensional grid.

This would also imply that the cross-validation scores need to be stored and returned in a different way. Rather than storing the scores in a 3-dimensional array, we can add another column scores to this data frame that contains the value of the cross-validation scores. I'm anyway not a fan of multidimensional arrays, as I find them confusing and difficult to handle. For example, if we want to create some nice plots of the cross-validation results with ggplot2, we would anyway need to reshape the array into such a data frame.