function [rejprob_val] = rejprobCY(rsim,xsim,maxp,DFbelt,DFGLSbelt, tconf, tquantL, tquantR, Qconf,alpha)

xsimvec=num2cell(xsim,1); % form a cell of dim 1 by N, where each one is a simulated series
rsimvec=num2cell(rsim,1);

    function temp =tempfn(ret, pred) 
        temp = cytest(ret, pred, maxp,DFbelt,DFGLSbelt, tconf, tquantL, tquantR, Qconf,alpha);
    end     


test=cellfun(@tempfn,rsimvec,xsimvec);
rejprob_val = 1- mean(test);

end
