dlanalysis: dlanalysis

Description Usage Arguments Value Examples

Description

This is a function that analyse the MCMC sampling result by computing the posterior mean, median and credible intervals

Usage

1
dlanalysis(dlresult, alpha = 0.05)

Arguments

dlresult

Posterior samples of beta. A large matrix (nmc/thin)*p

alpha

Level for the credible intervals. For example,the default is alpha = 0.05 means 95% credible intervals

Value

betamean

Posterior mean of beta, a p*1 vector.

LeftCI

The left bounds of the credible intervals.

RightCI

The right bounds of the credible intervals.

betamedian

Posterior median of Beta, a p*1 vector.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
p=50
n=5
#generate x
x=matrix(rnorm(n*p),nrow=n)
#generate beta
beta=c(rep(0,10),runif(n=5,min=-1,max=1),rep(0,10),runif(n=5,min=-1,max=1),rep(0,p-30))
#generate y
y=x%*%beta+rnorm(n)
hyper=dlhyper(x,y)
dlresult=dl(x,y,hyper=hyper)
da=dlanalysis(dlresult,alpha=0.05)
da$betamean
da$betamedian
da$LeftCI
da$RightCI

dlbayes documentation built on May 2, 2019, 8:28 a.m.