File: discrete.bayes.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 (39 lines) | stat: -rw-r--r-- 1,002 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
31
32
33
34
35
36
37
38
39
\name{discrete.bayes}
\alias{discrete.bayes}
\alias{print.bayes}
\alias{plot.bayes}
\alias{summary.bayes}
\title{Posterior distribution with discrete priors}
\description{
Computes the posterior distribution for an arbitrary one parameter distribution
 for a discrete prior
distribution.
}
\usage{
discrete.bayes(df,prior,y,...)
}
\arguments{
  \item{df}{name of the function defining the sampling density}
  \item{prior}{vector defining the prior density; names of the vector
  define the parameter values and entries of the vector define 
  the prior probabilities}
  \item{y}{vector of data values}
  \item{...}{any further fixed parameter values used in the sampling density
  function}
}
\value{
  \item{prob}{vector of posterior probabilities}
  \item{pred}{scalar with prior predictive probability}
}

\author{Jim Albert}

\examples{
prior=c(.25,.25,.25,.25)
names(prior)=c(.2,.25,.3,.35)
y=5
n=10
discrete.bayes(dbinom,prior,y,size=n)
}

\keyword{models}