prior is a function that generates a
prior.class containing information about one or
several priors. When several priors are selected, the function
returns a list of
the vector of the prior types selected. For example type.prior=c("gaussian","gamma")
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.
The densities implemented are defined as follow
The Gaussian density:
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:
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:
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.
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
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.