# prior: Generates 'prior.class' objects. In mathieucarmassi/CaliCo: Code Calibration in a Bayesian Framework

## Description

`prior` is a function that generates a `prior.class` containing information about one or several priors. When several priors are selected, the function `prior` returns a list of `prior.class`.

## Usage

 `1` ```prior(type.prior, opt.prior) ```

## Arguments

 `type.prior` the vector of the prior types selected. For example type.prior=c("gaussian","gamma") `opt.prior` list of the hyperparameters relatives to the prior selected. If the first prior selected is Gaussian, the hyperparameters would be the mean and the standard deviation. See Details for further clarifications.

## Details

The densities implemented are defined as follow

• The Gaussian density:

f(x)=1/(σ*√(2π))exp{-1/2*((x-μ)/σ)^2}

where μ and σ (the mean and the standard deviation) are the two hyperparameters. The vector c(μ,σ^2) is the one looked for in opt.prior.

• The Gamma density:

f(x)=1/(k^a*Γ(a))*x^(a-1)*exp(-(x/k))

where a and k (the shape and the scale) are the two hyperparameters. The vector c(a,k) is the one looked for in opt.prior.

• The Uniform density:

f(x)=1/(b-a)

where a and b (the upper and the lower bound) are the two hyperparameters. The vector c(a,b) is the one looked for in opt.prior.

## Value

`prior` returns a `prior.class` object. Two main methods are available:

• plot() display the probability density of the prior

• print() returns the main information concerning the prior distribution

M. Carmassi

## See Also

`model`, `calibrate`, `forecast`, `sequentialDesign`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12``` ```## Not run: #### Only one prior is wanted ## For a Gaussian Prior gaussian <- prior(type.prior="gaussian",opt.prior=list(c(0.5,0.001))) plot(gaussian) #### For several priors priors <- prior(type.prior=c("gaussian","gamma"),opt.prior=list(c(0.5,0.001),c(5,1))) plot(priors\$Prior1) plot(priors\$Prior2) ## End(Not run) ```

mathieucarmassi/CaliCo documentation built on Aug. 14, 2019, 11:32 a.m.