BayesQR.jl
Bayesian quantile regression (BQR) models in Julia.
Installation
Pkg.add("BayesQR")Function Documentation
BayesQR.bqr — Functionbqr(y::AbstractVector{<:Real}, X::AbstractMatrix{<:Real}, τ::Real, niter::Int, burn::Int)Runs the Bayesian quantile regression with dependent variable y and covariates X for quantile τ. Priors currently implemented are the Normal and Laplace.
Arguments
σᵦ::Real: variance of π(β)prior::String: "Normal" or "Laplace"
bqr(f::FormulaTerm, df::DataFrame, τ::Real, niter::Int, burn::Int)Runs the Bayesian quantile regression with dependent variable y and covariates X constructed from f and df.
Fitting BayesQR models
Two methods can be used to fit a BQR: bqr(formula, data, τ, niter, burn) and bqr(y, X, τ, niter, burn). Their arguments must be: -formula: a StatsModels.jl Formula object referring to columns in data.
data: a table in the Tables.jl definition, e.g. a data frame; NAs are droppedXa matrix holding values of the independent variable(s) in columnsya vector holding values of the dependent variable
Both method returns a MCMCChains.jl Chains object