ensure_proper_beta: Correct slightly improper parameter vectors

View source: R/constrOptim_helpers.R

ensure_proper_betaR Documentation

Correct slightly improper parameter vectors

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

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

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

registr documentation built on Oct. 3, 2022, 1:05 a.m.