changelog shortlog tags changeset files revisions annotate raw

scripts/deprecated/lognormal_inv.m

changeset 9846: 1d90fc211872
parent:1cdb42b372e8
author: John W. Eaton <jwe@octave.org>
date: Sat Nov 21 21:44:51 2009 -0500 (33 hours ago)
permissions: -rw-r--r--
description: configure.ac: report freetype, fontconfig, and fltk cflags and libs info
1## Copyright (C) 1995, 1996, 1997, 2005, 2006, 2007, 2008 Kurt Hornik
2##
3## This file is part of Octave.
4##
5## Octave is free software; you can redistribute it and/or modify it
6## under the terms of the GNU General Public License as published by
7## the Free Software Foundation; either version 3 of the License, or (at
8## your option) any later version.
9##
10## Octave is distributed in the hope that it will be useful, but
11## WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13## General Public License for more details.
14##
15## You should have received a copy of the GNU General Public License
16## along with Octave; see the file COPYING. If not, see
17## <http://www.gnu.org/licenses/>.
18
19## -*- texinfo -*-
20## @deftypefn {Function File} {} lognormal_inv (@var{x}, @var{a}, @var{v})
21## For each element of @var{x}, compute the quantile (the inverse of the
22## CDF) at @var{x} of the lognormal distribution with parameters @var{a}
23## and @var{v}. If a random variable follows this distribution, its
24## logarithm is normally distributed with mean @code{log (@var{a})} and
25## variance @var{v}.
26##
27## Default values are @var{a} = 1, @var{v} = 1.
28## @end deftypefn
29
30## Author: KH <Kurt.Hornik@wu-wien.ac.at>
31## Description: Quantile function of the log normal distribution
32
33## Deprecated in version 3.0
34
35function inv = lognormal_inv (varargin)
36
37 persistent warned = false;
38 if (! warned)
39 warned = true;
40 warning ("Octave:deprecated-function",
41 "lognormal_inv is obsolete and will be removed from a future version of Octave; please use logninv instead");
42 endif
43
44 if (nargin > 1)
45 a = varargin{2};
46 idx = a >= 0;
47 a(idx) = log (a(idx));
48 a(!idx) = NaN;
49 varargin{2} = a;
50 endif
51
52 if (nargin > 2)
53 v = varargin{3};
54 idx = v >= 0;
55 v(idx) = sqrt (v(idx));
56 v(!idx) = NaN;
57 varargin{3} = v;
58 endif
59
60 inv = logninv (varargin{:});
61
62endfunction