File: normal.normal.mix.Rd

package info (click to toggle)
r-cran-learnbayes 2.15-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,064 kB
  • sloc: sh: 16; makefile: 1
file content (32 lines) | stat: -rw-r--r-- 1,076 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
\name{normal.normal.mix}
\alias{normal.normal.mix}
\title{Computes the posterior for normal sampling and a mixture of normals prior}
\description{
 Computes the parameters and mixing probabilities for a normal sampling problem, variance known,
where the prior is a discrete mixture of normal densities.
} 
\usage{
normal.normal.mix(probs,normalpar,data)
}
\arguments{
  \item{probs}{vector of probabilities of the normal components of the prior}
  \item{normalpar}{matrix where each row contains the mean and variance parameters for a normal component of the prior}
  \item{data}{vector of observation and sampling variance}
}
\value{
\item{probs}{vector of  probabilities of the normal components of the posterior}
\item{normalpar}{matrix where each row contains the mean and variance parameters for a normal component of the posterior}
}
\author{Jim Albert}

\examples{
probs=c(.5, .5)
normal.par1=c(0,1)
normal.par2=c(2,.5)
normalpar=rbind(normal.par1,normal.par2)
y=1; sigma2=.5
data=c(y,sigma2)
normal.normal.mix(probs,normalpar,data)
}

\keyword{models}