File: histprior.Rd

package info (click to toggle)
r-cran-learnbayes 2.15.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,864 kB
  • sloc: sh: 15; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 671 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\name{histprior}
\alias{histprior}
\title{Density function of a histogram distribution}
\description{
Computes the density of a probability distribution defined on a set
of equal-width intervals
}
\usage{
histprior(p,midpts,prob)
}
\arguments{
  \item{p}{vector of values for which density is to be computed}
  \item{midpts}{vector of midpoints of the intervals}
  \item{prob}{vector of probabilities of the intervals}
}

\value{
vector of values of the probability density
}

\author{Jim Albert}

\examples{
midpts=c(.1,.3,.5,.7,.9)
prob=c(.2,.2,.4,.1,.1)
p=seq(.01,.99,by=.01)
plot(p,histprior(p,midpts,prob),type="l")
}

\keyword{models}