Skip to content
Snippets Groups Projects
sample_elicitation.Rd 1.21 KiB
Newer Older
thierrychambert's avatar
thierrychambert committed
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/elicitation.R
\name{sample_elicitation}
\alias{sample_elicitation}
\title{Function to sample an expert elicited distribution}
\usage{
sample_elicitation(n, out, smooth = TRUE, expert = NULL)
}
\arguments{
\item{n}{number of draws}

\item{out}{the output list from the elicitation function}

\item{smooth}{logical. If TRUE, uses the smoothed distribution, averaged across all experts.}

\item{expert}{a number telling which expert's distribution to draw the values from. Only implemented if smooth = FALSE.}
}
\value{
a vector of sample draws
}
\description{
Function to sample an expert elicited distribution
}
\examples{
## Elicited values for 4 experts
E1 <- c(50, 70, 100)
E2 <- c(200, 240, 280)
E3 <- c(100, 180, 300)
E4 <- c(120, 160, 220)
vals <- matrix(cbind(E1, E2, E3, E4), nrow = 3, byrow = FALSE)

## Elicited coverage probabilities from the same 4 experts
Cp = c(0.80, 0.90, 0.90, 0.70)

## Estimate
out <- elicitation(vals, Cp)

## Draw values from a smoothed, averaged distribution
sample_elicitation(n=100, out = out)

# Draw values from an indiviual expert's distribution
sample_elicitation(n=100, out = out, smooth = FALSE, expert = 3)

}