1function [m,s,p6,p7,error_indicator] = uniform_specification(m,s,p3,p4)
2% Specification of the uniform density function parameters
3%
4% INPUTS
5%    m:      mean
6%    s:      standard deviation
7%    p3:     lower bound
8%    p4:     upper bound
9
10% OUTPUTS
11%    m:      mean
12%    s:      standard deviation
13%    p6:     lower bound
14%    p7:     upper bound
15%    error_indicator:   whether inconsistent prior specification was used
16%
17% SPECIAL REQUIREMENTS
18%    none
19
20% Copyright (C) 2004-2017 Dynare Team
21%
22% This file is part of Dynare.
23%
24% Dynare is free software: you can redistribute it and/or modify
25% it under the terms of the GNU General Public License as published by
26% the Free Software Foundation, either version 3 of the License, or
27% (at your option) any later version.
28%
29% Dynare is distributed in the hope that it will be useful,
30% but WITHOUT ANY WARRANTY; without even the implied warranty of
31% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32% GNU General Public License for more details.
33%
34% You should have received a copy of the GNU General Public License
35% along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
36error_indicator=0;
37if ~(isnan(p3) || isnan(p4))
38    p6 = p3;
39    p7 = p4;
40    if ~isnan(m) || ~isnan(s)
41        error_indicator=1;
42    end
43    m  = (p3+p4)/2;
44    s  = (p4-p3)/(sqrt(12));
45else
46    p6 = m-s*sqrt(3);
47    p7 = m+s*sqrt(3);
48
49end