iterGlmCV {mseq}R Documentation

cross-validation for iterative glm

Description

Get the cross-validation R squared for iterative glm.

Usage

iterGlmCV(data, fold = 5, seed = 281142, thrd = 0.01, max_iter = 10)

Arguments

data the data frame generated by expData.R
fold number of folds of CV
seed seed to generate training indexes
thrd threshold for R squared increase in iterative glm
max_iter maximum times of iterations in iterative glm

Value

the CV R squared, a numeric value

Examples

 # read and expand the data
 data(g1_part) # for real data, please use read.csv, like g1 <- read.csv("g1.csv")
 data <- expData(g1_part, 2, 3) # In real datasets, surrounding sequences should be set longer.
 
 # get the CV R squared for Poisson linear model
 R_sq <- iterGlmCV(data)

[Package mseq version 1.1 Index]