From: Gonzalo on 31 May 2010 18:10 Hi all, I need to generate RN's from a double hyperbolic tangent function. f(x) = p(1) .* (tanh((x - p(2)) ./ p(4))- tanh((x - p(3)) ./ p(5)) I can't do it using the inverse-transform method because it's not possible to solve for x. Does anybody know of a routine that works the Composition, or convolution or any other methods?? Thanks
From: Walter Roberson on 31 May 2010 19:33 Gonzalo wrote: > I need to generate RN's from a double hyperbolic tangent function. > > f(x) = p(1) .* (tanh((x - p(2)) ./ p(4))- tanh((x - p(3)) ./ p(5)) > > I can't do it using the inverse-transform method because it's not > possible to solve for x. Does anybody know of a routine that works the > Composition, or convolution or any other methods?? x can be solved for numerically given the other parameters. The key value to be solved for is, RootOf(2*_Z*p(5)-2*p(3)+2*p(2)-p(4)*ln((p(1)*exp(_Z)^2+p(1)+exp(_Z)^2-1)/(p(1)* exp(_Z)^2+p(1)-exp(_Z)^2+1))) where RootOf is a notation indicating that the value _Z should be found such that the expression evaluates to 0 at _Z . However, for some combinations of parameters, some of the x might be imaginary. For example, p(1)=1/2, p(2)=1/3, p(3)=1/5, p(4)=1/7 and p(5) from about 0.18 to about 0.54, whereas with p(1)=2, p(2)=3, p(3)=5, p(4)=7 then in my experiments I do not see any p(5) that would make the expression imaginary.
|
Pages: 1 Prev: Faster custom spectrogram code Next: Local Gabor Binary Pattern Vectorization Problem |