create_prior: Generate a Prior Distribution for Bayes Factor Calculation

View source: R/create_prior.R

create_priorR Documentation

Generate a Prior Distribution for Bayes Factor Calculation

Description

This function creates a prior distribution for use in Bayesian inference based on the specified distribution family.

Usage

create_prior(distribution_prior, sd_of_theory, tail)

Arguments

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).

Details

- **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'.

Value

A 'bayesplay' prior object corresponding to the specified distribution.

See Also

bayesplay::prior, Bf_samplesize

Examples

## 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)

BencePalfi/SampleSizeBF documentation built on April 3, 2025, 2:01 p.m.