djwtouw / CGGMR

0 stars 0 forks source link

Keep track of raw solution when using refit = TRUE #15

Open aalfons opened 5 months ago

aalfons commented 5 months ago

When calling cggm_cv(refit = TRUE), we should also keep track of the raw solution without the reweighting step. The relevant information could be stored in components such as raw.Theta. We should also keep track of the cross-validation scores for both solutions so that we can easily obtain the optimal lambda value for both.

The advantage is that for comparing the raw and refitted solution, one no longer has to run the function twice. Since the raw solution anyway needs to be computed when using refit = TRUE, this can save quite a bit of computation time.

Also the accessor function get_Theta() could have an argument whether the raw or reweighted solution should be returned.