% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/validation.R
\name{create_paired_cv_splits}
\alias{create_paired_cv_splits}
\title{Create paired indices for bivariate cross-validation
Ensures that paired observations (e.g., u_wind and v_wind at same location)
are kept together in the same fold}
\usage{
create_paired_cv_splits(data, loc_col, group, k, seed = NULL)
}
\arguments{
\item{data}{data frame containing the observations}

\item{loc_col}{character vector of column names defining locations (e.g., c("lon", "lat") or c("x", "y"))}

\item{group}{character, name of the group column (e.g., "direction" for wind data)}

\item{k}{number of folds}

\item{seed}{random seed}
}
\value{
list with test_idx and train_idx, each containing k lists of indices
}
\description{
Create paired indices for bivariate cross-validation
Ensures that paired observations (e.g., u_wind and v_wind at same location)
are kept together in the same fold
}
\examples{
# Example with wind data
data_long <- data.frame(
  lon = rep(c(1, 2, 3, 4), 2),
  lat = rep(c(1, 1, 2, 2), 2),
  direction = rep(c("u_wind", "v_wind"), each = 4),
  wind = rnorm(8)
)
splits <- create_paired_cv_splits(data_long, c("lon", "lat"), "direction", k = 2)
}
