Last data update: 2014.03.03

R: Predictive distribution for a binomial sample with a discrete...
pdiscpR Documentation

Predictive distribution for a binomial sample with a discrete prior

Description

Computes predictive distribution for number of successes of future binomial experiment with a discrete distribution for the proportion.

Usage

pdiscp(p, probs, n, s)

Arguments

p

vector of proportion values

probs

vector of probabilities

n

size of future binomial sample

s

vector of number of successes for future binomial experiment

Value

vector of predictive probabilities for the values in the vector s

Author(s)

Jim Albert

Examples

p=c(.1,.2,.3,.4,.5,.6,.7,.8,.9)
prob=c(0.05,0.10,0.10,0.15,0.20,0.15,0.10,0.10,0.05)
n=10
s=0:10
pdiscp(p,prob,n,s)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(LearnBayes)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LearnBayes/pdiscp.Rd_%03d_medium.png", width=480, height=480)
> ### Name: pdiscp
> ### Title: Predictive distribution for a binomial sample with a discrete
> ###   prior
> ### Aliases: pdiscp
> ### Keywords: models
> 
> ### ** Examples
> 
> p=c(.1,.2,.3,.4,.5,.6,.7,.8,.9)
> prob=c(0.05,0.10,0.10,0.15,0.20,0.15,0.10,0.10,0.05)
> n=10
> s=0:10
> pdiscp(p,prob,n,s)
 [1] 0.03211473 0.06657051 0.09190545 0.11272071 0.12897176 0.13543368
 [7] 0.12897176 0.11272071 0.09190545 0.06657051 0.03211473
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>