Learn R Programming

BaM (version 1.0.3)

durations.hpd: durations.hpd

Description

Simple HPD calculator from Chapter 2 (page 51, 2nd Edition).

Usage

durations.hpd(support,fn.eval,start,stop,target=0.90,tol=0.01)

Arguments

support

x-axis values

fn.eval

function values at x-axis points

start

starting point in the vectors

stop

stoppng point in the vectors

target

Desired X Level

tol

Tolerance for round-off

Author

Jeff Gill

Examples

Run this code
if (FALSE) {
  get("cabinet.duration")
  ruler <- seq(0.45,0.75,length=10000)
  g.vals <- round(dgamma(ruler,shape=sum(cabinet.duration$N), 
                  rate=sum(cabinet.duration$N*cabinet.duration$dur)),2)
  start.point  <- 1000; stop.point <- length(g.vals)
  durations.hpd(ruler,g.vals,start.point,stop.point)
}

Run the code above in your browser using DataLab