registr_oneCurve: Internal function to register one curve

Description Usage Arguments Value Author(s)

View source: R/registr.R

Description

This internal function is only to be used from within registr. It performs the main optimization step with constrOptim for the registration of one curve.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
registr_oneCurve(
  obj = NULL,
  Y = NULL,
  Kt = 8,
  Kh = 4,
  family = "gaussian",
  gradient = TRUE,
  incompleteness = NULL,
  lambda_inc = NULL,
  beta = NULL,
  t_min = NULL,
  t_max = NULL,
  periodic = FALSE,
  warping = "nonparametric",
  gamma_scales = NULL,
  global_knots = NULL,
  mean_coefs = NULL,
  ...,
  verbose = 1,
  just_return_list = FALSE
)

Arguments

obj

Current estimate of FPC object. Can be NULL only if Y argument is selected.

Y

Dataframe. Should have values id, value, index.

Kt

Number of B-spline basis functions used to estimate mean functions. Default is 8.

Kh

Number of B-spline basis functions used to estimate warping functions h. Default is 4.

family

One of c("gaussian","binomial","gamma","poisson"). Defaults to "gaussian".

gradient

If TRUE, uses analytic gradient to calculate derivative. If FALSE, calculates gradient numerically. Not available for families "gamma","poisson".

incompleteness

Optional specification of incompleteness structure. One of c("leading","trailing","full"), specifying that incompleteness is present only in the initial measurements, only in the trailing measurements, or in both, respectively. For details see the accompanying vignette. Defaults to NULL, i.e. no incompleteness structure. Can only be set when warping = "nonparametric".

lambda_inc

Penalization parameter to control the amount of overall dilation of the domain. The higher this lambda, the more the registered domains are forced to have the same length as the observed domains. Only used if incompleteness is not NULL.

beta

Current estimates for beta for each subject. Default is NULL.

t_min

Minimum value to be evaluated on the time domain. if 'NULL', taken to be minimum observed value.

t_max

Maximum value to be evaluated on the time domain. if 'NULL', taken to be maximum observed value.

periodic

If TRUE, uses periodic b-spline basis functions. Default is FALSE.

warping

If nonparametric (default), inverse warping functions are estimated nonparametrically. If piecewise_linear2 they follow a piecewise linear function with 2 knots.

gamma_scales

Only used for family = "gamma". Vector with one entry for each subject, containing the current estimate for the scale parameter of its gamma distribution. Default is NULL, which sets the starting value for the scale parameter to 1.5.

global_knots

knots for the basis/splines, passed to [pbs::pbs()] or [stats::bs()]

mean_coefs

Mean coefficients for the mean of all curves or GFPCA based. May extract from 'obj' object

...

additional arguments passed to or from other functions

verbose

Can be set to integers between 0 and 4 to control the level of detail of the printed diagnostic messages. Higher numbers lead to more detailed messages. Defaults to 1.

just_return_list

Do not use. For developers only

Value

An list containing:

hinv_innerKnots

Inner knots for setting up the spline basis for the inverse warping function.

hinv_beta

Estimated B-spline basis coefficients used to construct subject-specific inverse warping functions.

t_hat

Vector of registered time domain.

loss

Loss of the optimal solution.

Author(s)

Julia Wrobel julia.wrobel@cuanschutz.edu, Erin McDonnell eim2117@cumc.columbia.edu, Alexander Bauer alexander.bauer@stat.uni-muenchen.de


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