par_distreg: Parallel compute bayesian distribution regression

Description Usage Arguments Value Examples

View source: R/Regression_Functions.R

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

1
2
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

type passed to makeCluster() in the package parallel

...

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

1
2
3
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))

bayesdistreg documentation built on May 1, 2019, 8:03 p.m.