make_Z: Make cross-validation folds.

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Make a list of cross-validation folds. Each element of the list is a vector of the cross-validation points for one cross-validation run.

Usage

1
make_Z(obs, nRuns = 30, frac = 0.1, contiguous = TRUE)

Arguments

obs

Vector of observations.

nRuns

Number of repetitions.

frac

Fraction of left-out points. For leave-one-out, use frac = 1, otherwise use any value less than 1. Default is 0.1 (leave-10%-out).

contiguous

Logical. If TRUE, the default, the left-out points are made in contiguous blocks; otherwise, they are scattered randomly.

Value

A list of cross-validation folds

Examples

1
Z <- make_Z(NPannual, nRuns = 30, frac = 0.25, contiguous = TRUE)

ldsr documentation built on May 4, 2020, 5:06 p.m.