OHDSI / Cyclops

Cyclops (Cyclic coordinate descent for logistic, Poisson and survival analysis) is an R package for performing large scale regularized regressions.
http://ohdsi.github.io/Cyclops/
38 stars 32 forks source link

When excluding vars from regularization, reported prior variance is always 0 #8

Closed schuemie closed 9 years ago

schuemie commented 9 years ago
data <- simulateData(nstrata=1,nrows=1000,ncovars=2000,model="logistic")
cyclopsData <- convertToCyclopsData(data$outcomes,data$covariates,modelType = "lr",addIntercept = TRUE)
prior <- createPrior("laplace", useCrossValidation = TRUE)
control <- createControl(noiseLevel = "silent")
fit <- fitCyclopsModel(cyclopsData,prior=prior,control=control)
fit$variance #is always 0 because intercept is excluded from prior
msuchard commented 9 years ago

uh .. an example of bad magic number coding on my part .. sorry. I have upgraded fit$variance to return with a std::vector that lists the variances for each component in the prior; this should work for excluding parameters from regularization and for hierarchical models.

fit$variance
[1] 0.01 Inf

Note that you may now want to use:


writeLines(paste("Variance =",
                           paste(fit$variance, collapse=" "),
                           ", AUC=",as.character(auc), "PL=", predLogLik))   

Closed with 5c82ca4463fca276bc06c09c5f412ff02ed02878