annotate scripts/deprecated/normal_pdf.m @ 6617:55da54f6c5c2

[project @ 2007-05-14 16:17:46 by jwe]
author jwe
date Mon, 14 May 2007 16:17:46 +0000
parents bee21f388110
children 93c65f2a5668
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5411
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
1 ## Copyright (C) 1995, 1996, 1997 Kurt Hornik
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
2 ##
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
4 ##
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
7 ## the Free Software Foundation; either version 2, or (at your option)
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
8 ## any later version.
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
9 ##
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
14 ##
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, write to the Free
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
18 ## 02110-1301, USA.
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
19
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
20 ## -*- texinfo -*-
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
21 ## @deftypefn {Function File} {} normal_pdf (@var{x}, @var{m}, @var{v})
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
22 ## For each element of @var{x}, compute the probability density function
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
23 ## (PDF) at @var{x} of the normal distribution with mean @var{m} and
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
24 ## variance @var{v}.
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
25 ##
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
26 ## Default values are @var{m} = 0, @var{v} = 1.
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
27 ## @end deftypefn
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
28
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
29 ## Author: TT <Teresa.Twaroch@ci.tuwien.ac.at>
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
30 ## Description: PDF of the normal distribution
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
31
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
32 function pdf = normal_pdf (varargin)
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
33
6617
55da54f6c5c2 [project @ 2007-05-14 16:17:46 by jwe]
jwe
parents: 5411
diff changeset
34 if (nargin > 2)
55da54f6c5c2 [project @ 2007-05-14 16:17:46 by jwe]
jwe
parents: 5411
diff changeset
35 varargin{3} = sqrt (varargin{3});
55da54f6c5c2 [project @ 2007-05-14 16:17:46 by jwe]
jwe
parents: 5411
diff changeset
36 endif
5411
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
37
6617
55da54f6c5c2 [project @ 2007-05-14 16:17:46 by jwe]
jwe
parents: 5411
diff changeset
38 pdf = normpdf (varargin{:});
55da54f6c5c2 [project @ 2007-05-14 16:17:46 by jwe]
jwe
parents: 5411
diff changeset
39
5411
bee21f388110 [project @ 2005-07-13 17:53:44 by jwe]
jwe
parents:
diff changeset
40 endfunction