Learn R Programming

BaM (version 0.93)

durations.hpd: durations.hpd

Description

Simple HPD calculator from Chapter 2 (page 51).

Usage

simple.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

Examples

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

Run the code above in your browser using DataLab