sample_prior: Sample from the Prior Distribution

View source: R/plot_prior.R

sample_priorR Documentation

Sample from the Prior Distribution

Description

Samples from a prior distribution with parameters defined in prior. The result can be plotted using the plot function.

Usage

sample_prior(
  method = c("hs", "lasso"),
  prior = switch(method, lasso = c(df = 1, scale = 1), hs = c(df = 1, df_global = 1,
    df_slab = 4, scale_global = 1, scale_slab = 2, par_ratio = NULL)),
  iter = 1000
)

Arguments

method

Character string, indicating which prior to sample from. Default: first element of c("hs", "lasso").

prior

Numeric vector, specifying the prior to use. See brma for more details.

iter

A positive integer specifying the number of iterations to sample. Default: 1000

Value

NULL, function is called for its side-effect of plotting to the graphics device.

Examples

sample_prior("lasso", iter = 10)

pema documentation built on March 31, 2023, 11:38 p.m.