[R-SIG-Finance] Error on "fBasics::dstable"

Shiazy Fuzzy shiazy at gmail.com
Sun Aug 26 09:08:49 CEST 2007


Hi,

I get this error on fBasics::dstable function:

--- [CUT HERE] ---
Error in dstable(y, alpha = alpha, beta = beta, gamma = gamma, delta =
delta) : object "result" not found
--- [/CUT HERE] ---

Looking at the code ("2A-StableDistribution.R"), it seems it is
sufficient to add an initialization instruction, for instance, at line
442:

--- [CUT HERE] ---
    result = 0; # ADDED INITIALIZATION
    # Special Cases:
    if (alpha == 2) {
        result = dnorm(x, mean = 0, sd = sqrt(2))
    }
    if (alpha == 1 & beta == 0) {
        result = dcauchy(x)
    }
--- [/CUT HERE] ---

Furthermore, I think the test on "beta" ("... & abs(beta) <= 1") at
line 454 is useless because of test at lines 425 and 426 ("if (beta  <
-1) ...." and "if (beta  > -1) ...", respectively).

My system is:
CPU: AMD Turion x2 TL-52
RAM: 1GB
OS: Fedora 7 x86_64
R: v. 2.5.1
fBasics. fCalendar, fEcofin: v. 251.70

Sincerely,

-- Marco



More information about the R-SIG-Finance mailing list