function [ fsave,fsaveL,fsaveH,VAR01,L,fbup,fblow,VARbs ] = runproxyvarff( datap,instrument,MaxL,HORZ,BS,REPS )

%proxy
L=MaxL;%GETLAGS(datap,MaxL);
%proxy SVAR Code by M Ravn and K Mertens available at 
VAR.p      = L;                                 % Number of Lags
 VAR.irhor  =HORZ;                                % Impulse Response Horizon
 VAR.vars             = datap;
 VAR.proxies          = instrument;
VAR01=VAR;
VAR01      = doProxySVAR_single(VAR01,datap);
fsave=VAR01.irs*-1;
fsaveL=0;
fsaveH=0;
fbup=0;
fblow=0;
VARbs=0;
if BS
  [VARbs,fbs] = doProxySVARbootstrap_singleFEVD(VAR01,REPS,95,datap,L,HORZ);  
fbup=squeeze(prctile(fbs,97.5,1));
fblow=squeeze(prctile(fbs,2.5,1));
temp3L=VARbs.irsL*-1;
fsaveL=temp3L;

temp3H=VARbs.irsH*-1;
fsaveH=temp3H;
end






end

