GPDPQuantReg: Fits GPDPQuantReg

Description Usage Arguments Value Author(s) Examples

View source: R/fitting.R

Description

Runs a MCMC algorithm to fit a quantile regression model, using Gaussian and Dirichlet Processes. Returns a GPDP_MCMC object with thinned chains. Scales data in the process so the induced correlation makes sense, and unscales at the end. Take it into account for the initial parameters.

Usage

1
2
3
4
5
GPDPQuantReg(
  formula, data, p = 0.5, c_DP = 2, d_DP = 1, c_lambda = 2,
  d_lambda = 0.5, alpha = sqrt(nrow(data)), M = zero_function,
  mcit = 3e4, burn = 1e4, thin = 10
)

Arguments

formula

formula object with the dependent and independent variables

data

data frame

p

real between (0,1), probability corresponding to the estimated quantile

c_DP

real > 0, shape parameter for the DP's base distribution

d_DP

real > 0, scale parameter fot the DP's base distribution

c_lambda

real > 0, shape parameter for the GP's lambda distribution

d_lambda

real > 0, scale parameter fot the GP's lambda distribution

alpha

real > 0, DP's concentration parameter

M

function, a priori estimation for the final function

mcit

integer > 0, number of MCMC algorithm's valid chains

burn

integer > 0, number of MCMC algorithm's first burned chains

thin

integer > 0 and < mcit, MCMC algorithm's thinning

Value

GPDP_MCMC object, with the MCMC algorithm's chains

Author(s)

Omar Pardo (omarpardog@gmail.com)

Examples

1
2
3
4
5
m <- 35
x <- sort(sample(seq(-15, 15, 0.005), m))
f_x <- function(x) return((1/40) * x^2 - (1/20) * x - 2)
data <- data.frame(x = x, y = f_x(x) + rnorm(m, 0, 1))
GPDP_MCMC <- fit_GPDPQuantReg(y ~ x, data, p = 0.250)

opardo/GPDPQuantReg documentation built on Nov. 24, 2019, 3:28 a.m.