function pautV = partialaut(xV,pmax)
% pautV = partialaut(xV,pmax)
% PARTIALAUT computes the partial autocorrelation for a given time series
% 'xV' and for a number of orders (lags) from 1 to a given order 'pmax'.
% INPUT
% - xV      : the vector of the time series.
% - pmax    : the largest order to compute partial autocorrelation for.
% OUTPUT
% - pautV   : the vector of size pmax x 1 of the partial autocorrelations.

pautV = NaN*ones(pmax,1);
for p=1:pmax
    armod = ar(xV,p);
    phiV = polydata(armod);
    pautV(p) = -phiV(p+1);
end
