Learn R Programming

HQM (version 0.1.1)

dataset_split: Split dataset for K-fold cross validation

Description

Creates multiple splits of a dataset which is then used in the bandwidth selection with K-fold cross validation.

Usage

dataset_split(I, data)

Value

A list of data frames with I individuals missing in the above way.

Arguments

data

A data frame of time dependent data points. Missing values are allowed.

I

The number of individuals that should be left out. Optimally, \(K = n/I\) should be an integer, where \(n\) is the number of individuals.

Details

The function dataset_split takes a data frame and transforms it into \(K = n/I\) data frames with \(I\) individuals missing from each data frame. Let \(I_j\) be sets of indices with \(\cup_{j=1}^K I_j = \{1,...,n\}\), \(I_k\cap I_j = \emptyset\) and \(|I_j| = |I_k| = I\) for all \(j, k \in \{1,...,K\}\). Then data frames with \(\{1,...,n \}/I_j\) individuals are created.

See Also

b_selection

Examples

Run this code
splitted_dataset = dataset_split(26, pbc2)

Run the code above in your browser using DataLab