rlm_stan: Bayesian robust linear regression with Stan

Description Usage Arguments Value Examples

Description

Bayesian robust linear regression with Stan

Usage

1
rlm_stan(x, y, nu = c("fixed", "continuous", "discrete"), ...)

Arguments

x

Numeric matrix of input values. This matrix should not contain a column of 1's.

y

Numeric vector of output values.

nu

Character, either "fixed" for a fixed value of nu (I'm going to make it 4, since this is a fake package), "continuous", in which case the prior distribution for nu is gamma(shape = 2, rate = 0.5), for an expected value of 4, or "discrete", in which case the prior distribution for nu is a discrete uniform(1, 10). In a real package, I'd give more input options (fixed parameter value, shape, rate, upper bound, ...), but I don't care here

...

Arguments passed to 'rstan::sampling' (e.g. iter, chains).

Value

An object of class 'stanfit' returned by 'rstan::sampling'

Examples

1
2
3
4
5
6
7
8
## Not run: 
x <- runif(30, 0, 10)
y <- 1 + 2*x + rt(30, 4)
rlmFitFixed <- rlm_stan(x, y, "fixed")
rlmFitCont <- rlm_stan(x, y, "continuous")
rlmFitDisc <- rlm_stan(x, y, "discrete")

## End(Not run)

cbdavis33/rstanPullTest documentation built on June 4, 2019, 11:48 a.m.