ensure_proper_beta: Correct slightly improper parameter vectors

Description Usage Arguments Value Author(s) Examples

View source: R/constrOptim_helpers.R

Description

Internal function. In the joint iterations between registration and GFPCA, the optimization with constrOptim() in the registration step sometimes leads to slightly improper solutions, which cause the optimization to throw an error in the following optimization step. This function corrects the parameter vector if one of the following slight inconsistencies occurs that can mess with the optimization of constrOptim():
- two neighboring values of the parameter vector are too similar
- the initial values of the parameter vector are smaller than t_min, the minimum of the underlying time domain
- the last values of the parameter vector are greater than t_max, the maximum of the underlying time domain
- one parameter value is slightly greater than its following value, i.e. the parameter vector is not monotone.

Usage

1
ensure_proper_beta(beta, t_min, t_max)

Arguments

beta

Parameter vector.

t_min, t_max

Minimum and maximum of the underlying time domain in the registration step.

Value

A slightly changed parameter vector that ensures a proper solution in the optimization of the registration step.

Author(s)

Alexander Bauer alexander.bauer@stat.uni-muenchen.de

Examples

1
2
beta_improper = c(0.24, 1.000047, 1.000002)
registr:::ensure_proper_beta(beta_improper, t_min = 0, t_max = 1)

julia-wrobel/registr documentation built on Jan. 16, 2022, 2:51 a.m.