dcpo_xvt {DCPO}R Documentation

Cross-validation testing for DCPO

Description

dcpo_xvt performs a single cross-validation test for DCPO

Usage

dcpo_xvt(
  dcpo_input,
  fold_number = 1,
  number_of_folds = 10,
  fold_seed = 324,
  chime = TRUE,
  ...
)

Arguments

dcpo_input

a data frame of survey items and marginals generated by DCPOtools::dcpo_setup

fold_number

an integer indicating the number of the fold to treated as test data in the current analysis

number_of_folds

an integer indicating the total number of folds

fold_seed

a seed for reproducibly randomly assigning observations to folds; when a complete set of k-fold cross-validations is to be performed, the same seed should be used for all

chime

play chime when complete?

...

arguments to be passed to rstan::stan. See dcpo.

Details

dcpo_xvt performs a single cross-validation test of a DCPO estimation. To perform a complete k-fold cross-validation, call it repeatedly, changing only the fold_number argument.

Value

a stanfit object

Examples


# Single cross-validation test with 25% test set
demsup_xvtest_25pct <- dcpo_xvt(demsup_data,
                           number_of_folds = 4,
                           iter = 300,
                           chains = 1) # 1 chain/300 iterations for example only; use defaults



[Package DCPO version 0.5.3 Index]