par_distreg {bayesdistreg} | R Documentation |
Parallel compute bayesian distribution regression
Description
par_distreg
uses parallel computation to compute bayesian distribution regression for a given
vector of threshold values and a data (with first column being the continuous outcome variable)
Usage
par_distreg(thresh, data0, fn = distreg, no_cores = 1,
type = "PSOCK", ...)
Arguments
thresh |
vector of threshold values. |
data0 |
the original data set with a continous dependent variable in the first column |
fn |
bayesian distribution regression function. the default is distreg provided in the package |
no_cores |
number of cores for parallel computation |
type |
|
... |
any additional input parameters to pass to fn |
Value
mat a G x M matrix of output (G is the length of thresh, M is the number of draws)
Examples
data0=faithful[,c(2,1)]; qnts<-quantile(data0[,1],c(0.05,0.25,0.5,0.75,0.95))
out<- par_distreg(qnts,data0,no_cores=1,iter = 102, burn = 2)
par(mfrow=c(3,2));invisible(apply(out,1,function(x)plot(density(x,30))));par(mfrow=c(1,1))
[Package bayesdistreg version 0.1.0 Index]