function ps = pshape(o)

% Returns the prior shape codes as a vector.
%
% Shape codes: 0=none (ML), 1=Beta, 2=Gamma, 3=Gaussian, 4=Inv-Gamma-1,
%              5=Uniform, 6=Inv-Gamma-2, 8=Weibull.
%
% INPUTS
% - o   [dprior]  Prior object.
%
% OUTPUTS
% - ps  [double]  n×1 vector of shape codes.

% Copyright © 2026 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare.  If not, see <https://www.gnu.org/licenses/>.

ps = zeros(length(o), 1);
ps(o.idbeta) = 1;
ps(o.idgamma) = 2;
ps(o.idgaussian) = 3;
ps(o.idinvgamma1) = 4;
ps(o.iduniform) = 5;
ps(o.idinvgamma2) = 6;
ps(o.idweibull) = 8;
