# mode2g: Moment and inverse moment prior elicitation. In mombf: Moment and Inverse Moment Bayes Factors

## Description

`mode2g` finds the `g` value corresponding to a given prior mode. `g2mode` finds the prior mode corresponding to a given `g` value. `priorp2g` finds the `g` value giving `priorp` prior probability to the interval (`-q`,`q`).
All routines operate in the standardized effect sizes scale.

## Usage

 ```1 2 3``` ```mode2g(prior.mode, prior=c("iMom", "normalMom", "tMom"), nu=1, dim=1) g2mode(g, prior=c("iMom", "normalMom", "tMom"), nu=1, dim=1) priorp2g(priorp, q, nu=1, prior=c("iMom", "normalMom", "tMom")) ```

## Arguments

 `prior.mode` Prior mode for the quadratic form (theta-theta0)' * solve(Sigma) * (theta-theta0)/(n*g*sigma^2), where sigma is the dispersion parameter and Sigma is given by the design matrix. `prior` `prior=='normalMom'` does computations for the normal moment prior, `prior=='tMom'` for the T moment prior, `prior=='iMom'` does computations for the inverse moment prior. Currently `prior=='tMom'` is not implemented in `priorp2g`. `nu` Prior degrees of freedom for the T moment prior or the iMom prior (ignored if `prior=='normalMom'`). `dim` Dimensionality of the parameter, i.e. `dim==1` for univariate, `dim==2` for bivariate and so on. `g` Prior parameter. See `dimom` for details. `priorp` `priorp2g` returns g giving `priorp` prior probability to the interval `(-q,q)`. `q` `priorp2g` returns g giving `priorp` prior probability to the interval `(-q,q)`.

## Details

See `dmom` and `dimom` for details on the meaning of the prior parameters.

## Value

`mode2g` returns the value of the prior parameter `g` matching the given mode.

`g2mode` returns the prior mode for a given prior parameter `g`.

`priorp2g` returns g giving `priorp` prior probability to the interval `(-q,q)`.

## Author(s)

David Rossell [email protected]

## References

`dmom`, `dimom`, `mombf`, `imombf`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16``` ```#find g value giving a prior mode for (theta/(sigma*n*Sigma))^2 at 0.2^2 data(hald) lm1 <- lm(hald[, 1] ~ hald[, 2] + hald[, 3] + hald[, 4] + hald[, 5]) prior.mode <- .2 gmom <- mode2g(prior.mode^2, prior='normalMom') gtmom <- mode2g(prior.mode^2, prior='tMom', nu=3) gimom <- mode2g(prior.mode^2, prior='iMom') gmom gimom #find g value giving 0.05 probability to interval (-.2,.2) priorp <- .05; q <- .2 gmom <- priorp2g(priorp=priorp, q=q, prior='normalMom') gimom <- priorp2g(priorp=priorp, q=q, prior='iMom') gmom gimom ```