Giter Club home page Giter Club logo

bhglm's Introduction

BhGLM: Bayesian hierarchical GLMs and survival models, with applications to Genomics and Epidemiology

Overview

This R package provides functions for setting up and fitting various Bayesian hierarchical models (generalized linear models (GLMs), Cox survival models, negative binomial models, and ordered logistic or probit regressions), for numerically and graphically summarizing the fitted models, and for evaluating the predictive performance. Several types of priors on the coefficients can be used: double-exponential, Student-t, and mixture double-exponential. The models are fitted by using fast algorithms for estimating posterior modes rather than MCMC. The methods can be used to analyze not only general data but also large-scale molecular data (i.e., detecting disease-associated genes or variants, predictive and prognostic modeling of diseases and traits, etc).

Author: Nengjun Yi [email protected]; Maintainer: Nengjun Yi [email protected]

Installation

library(remotes)

install_github("nyiuab/BhGLM", force=T, build_vignettes=T)

bhglm's People

Contributors

nyiuab avatar boyiguo1 avatar

Stargazers

 avatar Himel Mallick, PhD, FASA avatar  avatar Patrick Bradshaw avatar Tom Wenseleers avatar  avatar Andrew Willems avatar  avatar Yunyi Shen avatar  avatar Michael Komodromos avatar Shareef Dabdoub avatar Shang avatar  avatar Aaro Salosensaari avatar  avatar  avatar  avatar Aurora S. Blucher avatar

Watchers

Tim Howes avatar  avatar  avatar Himel Mallick, PhD, FASA avatar  avatar

bhglm's Issues

Installation with vignettes fail.

If I set build_vignettes=T, the package fails to install. Error message:

Error in loadVignetteBuilder(pkgdir, TRUE) :
vignette builder 'R.rsp' not found
Execution halted

Group-updated `bcoxph` models fail when cross-validation with `cv.bh`

When applying group updating algorithm to fit bcoxph models, an offset will be induced as an element of the model object. The offset element is a by-product of the internal call of coxph by treating non-updating coefficients and its linear predictors as an offset term. However, without replacing the artificial offset with the original offset. It creates a problem when acquiring data within cv.bh when cross-validating the fitted model, see

BhGLM/R/cv.bh.r

Line 136 in ac76cec

if (!is.null(object$offset)) {

Hence, it will produce an error message when calling cv.bh

Error in cv.bh.coxph(object = object, nfolds = nfolds, foldid = foldid, : 'data' not given in object

Minimum reproducible Example:
The following code is a reproducible example where group-updated bcoxph causes the problem while jointly updated does not.

library(BhGLM)
library(survival)

## Example Code from the BhGLM Manual
N = 1000
K = 100
x = sim.x(n=N, m=K, corr=0.6) # simulate correlated continuous variables  
h = rep(0.1, 4) # assign four non-zero main effects to have the assumed heritabilty 
nz = as.integer(seq(5, K, by=K/length(h))); nz
#> [1]  5 30 55 80
yy = sim.y(x=x[, nz], mu=0, herit=h, p.neg=0.5) # simulate responses
yy$coefs
#>         x5        x30        x55        x80 
#>  0.4094061 -0.4152127  0.4186130 -0.3971476

y = yy$y.surv
d = table(y[,2]); d[1]/sum(d) # cencoring proportion
#>     0 
#> 0.486

ps = 0.05
mdl_joint = bcoxph(y ~ ., data = x, prior = De(0, ps))
mdl_group = bcoxph(y ~ ., data = x, prior = De(0, ps), method.coef = 50)

joint_cv <- cv.bh(mdl_joint)  # No error
#> Fitting ncv*nfolds = 10 models: 
#> 1 2 3 4 5 6 7 8 9 10 
#>  Cross-validation time: 0.215 minutes
group_cv <- cv.bh(mdl_group)  # Error caught
#> Error in cv.bh.coxph(object = object, nfolds = nfolds, foldid = foldid, : 'data' not given in object

Created on 2022-01-03 by the reprex package (v2.0.1)

Allowing known 0 intercept and predictors not penalized in bmlasso?

Thanks for the great package!

I find it sometimes useful to set a known 0 intercept, especially when in applications the model involves some categorical predictors and one wants to use dummy coding other than the sort of default reference coding. Can we open the intercept argument in glmnet to the user in bmlasso?

In the case of dummy coding, we might also don't want to penalize some of the predictors that will be interpreted as group means. Is it possible to have something like the no.penalty that will set penalty.factor being 0 in the glmnet part of the algorithm (might also change the updating rule of theta)?

Thanks!
Yunyi

TCGA analysis code

Hey guys, congratulations for your paper. I would like to rerun your analysis with a different pathway database. Could you please point me to the scripts to rerun the analysis?
Thank you in advance,

Regards

Daniel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.