Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sd_to_prec

Transform a prior from SD to precision.


Description

JAGS uses precision rather than SD. This function converts dnorm(4.2, 1.3) into dnorm(4.2, 1/1.3^2). It allows users to specify priors using SD and then it's transformed for the JAGS code. It works for the following distributions: dnorm|dt|dcauchy|ddexp|dlogis|dlnorm. In all of these, tau/sd is the second parameter.

Usage

sd_to_prec(prior_str)

Arguments

prior_str

String. A JAGS prior. Can be truncated, e.g. dt(3, 2, 1) T(my_var, ).

Value

A string

Author(s)

Jonas Kristoffer Lindeløv jonas@lindeloev.dk


mcp

Regression with Multiple Change Points

v0.3.0
GPL-2
Authors
Jonas Kristoffer Lindeløv [aut, cre] (<https://orcid.org/0000-0003-4565-0595>)
Initial release
2020-07-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.