check_df: Checks if non-empty groups have enough data for spline fit...

View source: R/trajectories.R

check_dfR Documentation

Checks if non-empty groups have enough data for spline fit degrees of freedom.

Description

Checks if non-empty groups have enough data for spline fit degrees of freedom.

Usage

check_df(group, loss, data, maxdf)

Arguments

group

An integer vector of group membership for each id.

loss

A matrix with rows of computed loss values of each id across all models as columns.

data

A data.table with data. See trajectories.

maxdf

Fitting parameters. See trajectories.

Details

When a group has insufficient data for maxdf, its nearest model loss values are set to Inf, and new nearest model is assigned. The check repeats until all groups have sufficient data.

Value

Returns the vector of group membership of id's either unchanged or changed to have sufficient data in non-zero groups.


clustra documentation built on Oct. 14, 2023, 9:15 a.m.