Skip to content

Commit 4d5c9a2

Browse files
committed
fix use of wrong variable
1 parent c79f706 commit 4d5c9a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/scglrCrossVal.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,15 @@ scglrCrossVal <- function(formula,data,family,K=1,folds=10,type="mspe",size=NUL
194194
xnew <- cbind(1,AX[valid,,drop=FALSE])
195195
beta.coefs <- sapply(gamma.fit, coef)
196196
}
197-
197+
198198
predict <- multivariatePredictGlm(Xnew=xnew,family,
199199
beta.coefs,offset[valid,,drop=FALSE])
200200

201201
if(type=="auc"){
202202
cvNull[1:ny] <- auc(roc(y[valid,,drop=FALSE],predict, quiet=TRUE))
203203
} else if(type%in%c("likelihood","aic","bic","aicc","mspe")){
204204
cvNull[1:ny] <- infoCriterion(ynew=y[valid,,drop=FALSE],predict,family,
205-
type=type,size=size[valid,,drop=FALSE],npar=nrow(gamma.coefs))
205+
type=type,size=size[valid,,drop=FALSE],npar=nrow(beta.coefs))
206206
}
207207

208208
try_result <- try({

0 commit comments

Comments
 (0)