######################################################### # # # Script for running the Poisson Log-Normal model with # # an inverse-gamma shrinkage prior # # # # By: Viktor Jonsson, 2016-10-15 # # # ######################################################### #Initialize reuqired packages library("rjags") library("coda") #Source required functions source("GLMMfunctions.R") # Data preparations, note data should be supplied in a n x m matrix # containing two groups of samples exampleData <- quickDataSimulation() Y <- exampleData group=c(rep(0,3),rep(1,3)) # indicator vector indicating which samples # belong to which group. Note this implementation # the two groups to be in consecutive order nR <- dim(Y)[1] nC <- dim(Y)[2] normalizingConstants <- colSums(Y) #For simplicity total sum scaling is used #MCMC run settings nrAdapt=1000 nrBurnIn=1000 nrSamples=20000 nrThin = 1 #runs the mcmc for the selected settings and returns the significance score #for each feature result <- GLMMLoanInvGamma(Y=Y,group = group, N = normalizingConstants, nrAdapt=nrAdapt,nrBurnIn=nrBurnIn,nrSamples=nrSamples, nrThin=nrThin)