Learn R Programming

SMPracticals (version 1.4-3.1)

add.exp.lines: Add Exponential Lines in Practical 11.3

Description

Adds lines to density plot used in Practical 11.3

Usage

add.exp.lines(exp.out, i, B = 10)

Arguments

exp.out

Gibbs sampler output

i

Variable index (=1, 2)

B

Upper bound for truncated exponential density

Author

Anthony Davison

Examples

Run this code
B <-10; I <- 15; S <- 500

exp.out <- exp.gibbs(B=B,I=I,S=S)

hist(exp.out[1,,I],prob=TRUE,nclass=15,xlab="u1",ylab="PDF",xlim=c(0,B),ylim=c(0,1))

add.exp.lines(exp.out,1)

Run the code above in your browser using DataLab