Mercurial > hg > ishara
annotate general/numerical/scalar/hypdecay.m @ 35:f1ce7876346a
Updated docs.
author | samer |
---|---|
date | Mon, 21 Jan 2013 11:01:45 +0000 |
parents | db7f4afd27c5 |
children |
rev | line source |
---|---|
samer@4 | 1 function ret=hypdecay(k,d) |
samer@4 | 2 % hypdecay - compute interpolation ratio for hyperbolic decay |
samer@4 | 3 % |
samer@4 | 4 % hypdecay :: [Size->nonneg], [Size->nonneg] -> [Size->nonneg]. |
samer@4 | 5 % hypdecay :: [Size->nonneg] -> ([Size->nonneg] -> [Size->nonneg]). |
samer@4 | 6 % |
samer@4 | 7 % this gives 'hyperbolic' convergence which is more like |
samer@4 | 8 % a sort of diffusion by Brownian motion. The trick is |
samer@4 | 9 % to add a constant to the inverse of each natural parameter, |
samer@4 | 10 % which is like a temperature or variance. The constant |
samer@4 | 11 % is like a diffusion constant |
samer@4 | 12 % |
samer@4 | 13 % This function supports partial application: if only one |
samer@4 | 14 % argument is supplied, it returns a function handle. |
samer@4 | 15 |
samer@4 | 16 if nargin==2, ret=1./(1+k*d); |
samer@4 | 17 else ret=@(d)1./(1+k*d); end |