rdq.condf {QTE.RD}R Documentation

Conditional density estimation

Description

rdq.condf estimates conditional density functions by using the differencing method.

Usage

rdq.condf(x, Q, bcoe, taus, taul, delta, cov)

Arguments

x

a vector (or a matrix) of covariates.

Q

a vector of estimated conditional quantiles.

bcoe

quantile regression coefficient estimates.

taus

a vector of quantiles of interest.

taul

a vector of quantiles used for the conditional density estimation. It is needed to estimate the tail parts of conditional density functions more precisely.

delta

bandwidths for estimating the conditional density.

cov

either 0 or 1. Set cov=1 if covariates are present in the model; otherwise set cov=0.

Value

conditional density function estimates

Examples

n = 500
x = runif(n,min=-4,max=4)
d = (x > 0)
y = x + 0.3*(x^2) - 0.1*(x^3) + 1.5*d + rnorm(n)
tlevel = seq(0.1,0.9,by=0.1)
hh = rep(2,length(tlevel))

ab = rdq(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,h.tau=hh,cov=0)
delta = 0.186
fe = rdq.condf(x=x,Q=ab$qp.est,bcoe=ab$bcoe.p,taus=0.5,taul=tlevel,delta=delta,cov=0)



[Package QTE.RD version 1.0.0 Index]