Quantile regression and linprog
Show older comments
I'm trying to implement the linear program at page 2 of this link http://faculty.arts.ubc.ca/pschrimpf/628/hw5-quantile.pdf . I can't seem to get it to work though. As far as I have understood the estimate should be retrievable as the last element of the solution, but this is very small (<10e-10) and it should be 1.0675 according to another quantile regression algorithm (basically the true parameter is set to 1). Any thoughts?
% set seed
rng(1);
% set parameters
n=30;
tau=0.5;
% create regressor and regressand
x=rand(n,1);
y=x+rand(n,1)/10;
% number of regressors (1)
m=size(x,2);
% vektors and matrices for linprog
f=[tau*ones(n,1);(1-tau)*ones(n,1);zeros(m,1)];
A=[eye(n),-eye(n),x;
-eye(n),eye(n),-x;
-eye(n),zeros(n),zeros(n,m);
zeros(n),-eye(n),zeros(n,m)];
b=[y;
y
zeros(n,1);
zeros(n,1)];
% get solution bhat=[u,v,beta] and exitflag (1=succes)
[bhat,~,exflag]=linprog(f',A,b);
Answers (1)
Gittetier
on 24 Sep 2014
0 votes
Hello Patrick, probably this no longer of any interest to you. But I think there is a mistake in the proposition you cite. When you split up the equality condition into two inequalities one of the Y should turn negative. So there is a mistake in your matrix b. In front of the second Y there should be a minus sign. Best Gittetier
Categories
Find more on Linear Predictive Coding in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!