Closed bauer-alex closed 4 years ago
Additional notes:
registr
. The CRAN version 1.0.0 converges after the 12th iteration and does not throw an error.gradient = TRUE
.I will take a deeper look into this (and the penalize_beta branch, as recommended by @julia-wrobel) after the summer, probably in October.
I could resolve all issues regarding optimization problems like the above one. These problems arose since in the joint iteration the parameter vector passed to constrOptim
was sometimes slightly outside the allowed range, or slightly improper / nonmonotone as of numerical problems of constrOptim
.
In branch issue_11
I now included a new function ensure_proper_beta
that simply slightly alters the parameter vector to resolve these issues before the optimization call. Since the alterations are really minimal this doesn't change the results.
The branch is based on the gfpca_twoStep
branch. So we should first integrate the PR for the latter branch, and then create a PR for this one.
Thanks Alex- gfpca_twStep
has been merged with the master branch. Is the issue_11
branch ready to be merged? If so I'll run some local checks and pull it into master.
Yes, this branch is ready to be merged.
Thanks Alex- it's been merged with the master branch.
When applying the joint registration and Gaussian FPCA scheme (
register_fpca
) to the derivation curves of the Berkeley child growth data, theconstrOptim()
optimization sometimes runs into the error"Initial value in 'vmmin' is not finite"
. Here a code snippet to reproduce the error, and below some more insight into the problem:The error occurred in the joint iteration 13 for curve 12, i.e. id
boy12
. The curve of this id looks like this:What I found out so far:
beta_i
has two nearly identical neighboring values. For curve 12 in iteration 13beta_i
equalsc(7.752823, 7.752823)
, withbeta_i[2] - beta_i[1] = 8.881784e-16
.c(1.224627, 1.507873)
beta_i
values. E.g., in iteration 13, curve 9 has the starting valuesc(6.089687, 6.089687)
withbeta_i[2] - beta_i[1] = 4.179768e-11
, causing no error in the registration step.method = "BFGS"
inconstrOptim()
. In case it helps, here are the source codes for and (even if these source code versions already date some years back).constrOptim(method = "CG")
. However, a similarnot finite
error then occurs for other curves when optimizing with CG.