Crossvalidate_Fn: K-fold crossvalidation

Description Usage Arguments Value

View source: R/Crossvalidate_Fn.R

Description

Crossvalidate_Fn runs a k-fold crossvalidation analysis on a fitted model object

Usage

1
2
Crossvalidate_Fn(record_dir, parhat, original_data, group_i = NULL,
  kfold = 10, skip_finished = FALSE, ...)

Arguments

record_dir,

a directory with writing privilege where the runs are stored

parhat,

a tagged list of parameters from the fitted model, e.g., as generated by parhat <- obj$env$parList() after covergence

original_data,

a tagged list of data for the VAST model

group_i,

a vector of positive integers, indicating the k-fold group for each observation (default=NULL, which generates a new group_i with even probability)

kfold,

the number of crossvalidation batches used (default=10)

skip_finished

boolean specifying whether to rerun (skip_finished==FALSE) or skip (skip_finished==TRUE) previously completed runs (Default=FALSE)

...

Additional arguments to pass to VAST::Build_TMB_Fn

Value

Results a matrix with total predictive negative log-likelihood for each crossvalidation partition, and number of crossvalidation samples for that partition


James-Thorson/VAST documentation built on Oct. 8, 2017, 1:15 a.m.