create_prior | R Documentation |
This function creates a prior distribution for use in Bayesian inference based on the specified distribution family.
create_prior(distribution_prior, sd_of_theory, tail)
distribution_prior |
A character string specifying the prior distribution. Options include '"normal"', '"uniform"', and '"cauchy"'. |
sd_of_theory |
The standard deviation or scale parameter for the prior (depends on the chosen distribution). |
tail |
The number of tails (1 or 2). |
- **Normal prior:** Centered at '0' with standard deviation 'sd_of_theory'. - **Uniform prior:** A flat distribution ranging from '-sd_of_theory' to '+sd_of_theory'. - **Cauchy prior:** Centered at '0' with scale 'sd_of_theory'.
A 'bayesplay' prior object corresponding to the specified distribution.
bayesplay::prior
, Bf_samplesize
## Not run:
# Normal prior with SD = 0.5
normal_prior <- create_prior("normal", sd_of_theory = 0.5)
# Uniform prior from -1 to 1
uniform_prior <- create_prior("uniform", sd_of_theory = 1)
# Cauchy prior with scale = 0.3
cauchy_prior <- create_prior("cauchy", sd_of_theory = 0.3)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.