kfoldRSF: Perform kfold cross-validation on a RSF output.

View source: R/fcts RSF.R

kfoldRSFR Documentation

Perform kfold cross-validation on a RSF output.

Description

Perform kfold cross-validation on a RSF output. Similar to what is recommended in Boyce 2002. Function developped with Mathieu Basille

Usage

kfoldRSF(
  mod,
  k = 5,
  nrepet = 10,
  nbins = 10,
  jitter = TRUE,
  random = TRUE,
  method = method,
  x = m,
  form_ls = ls,
  reproducible = TRUE
)

Arguments

mod

A RSF model (glm or glmer)

k

number of fold (default = 5)

nrepet

Number of repetitions (default =10)

nbins

Number of bins (default =10)

jitter

Logical, whether to add some random noise to the predictions (useful when the model is fitted on categorical variables, which can produces error in the ranking process).

reproducible

Logical, whether to use a fixed seed for each repetition.

Value

A data frame with the correlations (cor) and the type of value (type).


BastilleRousseau/IndRSA documentation built on Jan. 28, 2024, 2:14 a.m.