function Beta=test_PQL(X)
% X=test data matrix
%% Clear workspace
clc
close all
%% Create test data
X=[ones(size(X,1),1),X];
y=(X(:,end));
X=X(:,1:end-1);
%% Set parameters
mu=logspace(-7,-2,100);
p=.8;
q=.1;
epsilon=1e-4;
options.epsilon=epsilon;
tol=1e-4;
options.tollerance=tol;
iter=1000;
options.max_iterations=iter;
options.waitbar='off';
%% Recover
Beta=zeros(length(X'*y),length(mu));
B=Beta;
for i=1:length(mu)
    beta = lplqRegression(X,y,p,q,mu(i),options);
    Beta(:,i)=beta;
    b=0*beta;
    b(abs(beta)>epsilon)=1;
    B(:,i)=b;
end
%% Show results
[J,Mu]=meshgrid(1:24,log10(mu));

% Create figure
figure1 = figure;

% Create axes
axes1 = axes('Parent',figure1);
hold(axes1,'on');

% Create surf
surf(J-.5,Mu,Beta','Parent',axes1);

% Create ylabel
ylabel({'$\log_{10}(\lambda)$'},'FontSize',20,'Interpreter','latex');

% Create xlabel
xlabel({'$j$'},'FontSize',20,'Interpreter','latex');

view(axes1,[15.7309392265193 48.7528037383178]);
grid(axes1,'on');
% Set the remaining axes properties
set(axes1,'XTick',[1 3 5 7 9 11 13 15 17 19 21 23]);

% Create figure
figure1 = figure;

% Create axes
axes1 = axes('Parent',figure1);
hold(axes1,'on');

% Create surf
surf(J(:,2:end,:)-.5,Mu(:,2:end),abs(Beta(2:end,:))','Parent',axes1);

% Create ylabel
ylabel({'$\log_{10}(\lambda)$'},'FontSize',20,'Interpreter','latex');

% Create xlabel
xlabel({'$j$'},'FontSize',20,'Interpreter','latex');


grid(axes1,'on');
% Set the remaining axes properties
set(axes1,'XTick',[1 3 5 7 9 11 13 15 17 19 21 23]);
