Home > matlab > uniform_specification.m

uniform_specification

PURPOSE ^

Specification of the uniform density function parameters

SYNOPSIS ^

function [m,s,p6,p7] = uniform_specification(m,s,p3,p4)

DESCRIPTION ^

 Specification of the uniform density function parameters

 INPUTS
    m:      mean
    s:      standard deviation 
    p3:     lower bound 
    p4:     upper bound

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [m,s,p6,p7] = uniform_specification(m,s,p3,p4)
0002 % Specification of the uniform density function parameters
0003 %
0004 % INPUTS
0005 %    m:      mean
0006 %    s:      standard deviation
0007 %    p3:     lower bound
0008 %    p4:     upper bound
0009 
0010 % OUTPUTS
0011 %    m:      mean
0012 %    s:      standard deviation
0013 %    p1:     lower bound
0014 %    p2:     upper bound
0015 %
0016 % SPECIAL REQUIREMENTS
0017 %    none
0018 
0019 % Copyright (C) 2004-2009 Dynare Team
0020 %
0021 % This file is part of Dynare.
0022 %
0023 % Dynare is free software: you can redistribute it and/or modify
0024 % it under the terms of the GNU General Public License as published by
0025 % the Free Software Foundation, either version 3 of the License, or
0026 % (at your option) any later version.
0027 %
0028 % Dynare is distributed in the hope that it will be useful,
0029 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0030 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0031 % GNU General Public License for more details.
0032 %
0033 % You should have received a copy of the GNU General Public License
0034 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0035 
0036 if ~(isnan(p3) || isnan(p4))
0037     p6 = p3;
0038     p7 = p4;
0039     m  = (p3+p4)/2;
0040     s  = (p4-p3)/(sqrt(12));
0041 else
0042     p6 = m-s*sqrt(3);
0043     p7 = m+s*sqrt(3);
0044 end

Generated on Tue 22-May-2012 02:40:23 by m2html © 2005