check_df {clustra}R 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.


[Package clustra version 0.2.1 Index]