Re: Recursive Calculation of Gaussian-Like Sequence
- To: mathgroup at smc.vnet.net
- Subject: [mg28054] Re: [mg28018] Recursive Calculation of Gaussian-Like Sequence
- From: Tomas Garza <tgarza01 at prodigy.net.mx>
- Date: Thu, 29 Mar 2001 03:24:19 -0500 (EST)
- References: <200103280740.CAA25791@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
I was unable to reproduce the Exp[+(alpha/2)n^2]-type behavior with n as large as 1400. In fact, the sequence f[n] becomes negative at n = 888 (f[888] = -7.66101 x 10^-6) and grows negatively (in an apparently monotonous way) from there on. For example, f[1400] = -29.1429. The approximation Exp[-(alpha/2) n^2] works reasonably well (of course, only when f[n] is positive), say with error of magnitude 10^-4. By the way, I tried to solve your recurrence equation using RSolve, but it flatly refused to. Tomas Garza Mexico City ----- Original Message ----- From: "A. E. Siegman" <siegman at stanford.edu> To: mathgroup at smc.vnet.net Subject: [mg28054] [mg28018] Recursive Calculation of Gaussian-Like Sequence > (Apologies -- this is more a math than a Mathematica question -- but > there seem to be a lot of helpful experts on this group.) > > I'm evaluating the recursion relation: > > f[0] = 1; > f[1] = ((2-alpha)/2) f[0]; > f[n_] := f[n] = (2-alpha + beta (n-1)^2) f[n-1] - f[n-2] > > numerically with beta = alpha^2 and with alpha having some small value > like 2 X 10^(-5), expecting to get a gaussian-like sequence symmetric > about n=0 that's close to f[n] approx= Exp[-(alpha/2) n^2] . > > That's in fact exactly what I get, out to be about 5 or 6 standard > deviations (n approx= 1000 for the alpha value above) -- but then the > numerical results for larger n suddenly turn into a growing > Exp[+(alpha/2)n^2]-type behavior with a sign that's extraordinarily > sensitive to small changes in the initial value of f[1]/f[0]. > > Is this round-off error? (probably not) -- an inherent numerical > instability in the recursion relation? (probably so). Is there a way > around it. > > (The recursion form in the third line above comes from a variational > analysis of a physical problem; the values of alpha and beta can be > adjusted arbitrarily, but have to remain in a k1 + k2 n^2 form.) >
- References:
- Recursive Calculation of Gaussian-Like Sequence
- From: "A. E. Siegman" <siegman@stanford.edu>
- Recursive Calculation of Gaussian-Like Sequence