1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/kfcv.R
\name{kfcv}
\alias{kfcv}
\title{Sample sizes for k-fold cross-validation}
\usage{
kfcv(k, N)
}
\arguments{
\item{k}{number of groups.}
\item{N}{total sample size.}
}
\value{
A vector of length \code{k} containing \eqn{k} sample sizes.
}
\description{
Compute sample sizes for \eqn{k}-fold cross-validation.
}
\details{
If N/k is an integer, the sample sizes are k `N/k's (N/k, N/k, ...),
otherwise the remainder will be allocated to each group as `uniformly' as
possible, and at last these sample sizes will be permuted randomly.
}
\examples{
## divisible
kfcv(5, 25)
## not divisible
kfcv(10, 77)
}
\seealso{
\code{\link{cv.ani}}
}
\author{
Yihui Xie
}
|