View source: R/Regression_Functions.R
par_distreg | R Documentation |
par_distreg
uses parallel computation to compute bayesian distribution regression for a given
vector of threshold values and data (with first column being the outcome variable)
par_distreg(thresh, data0, fn = distreg, no_cores = 1, type = "PSOCK", ...)
thresh |
vector of threshold values. |
data0 |
the original data set with the 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 |
mat a G x M matrix of output (G is the length of thresh, M is the number of draws)
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.