Skip to content

Commit d6250d8

Browse files
committed
version of 2009.05.07.12.48.17 (now is 01 Dec 2012).
1 parent 59d4c0a commit d6250d8

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

Diff for: R/fracdiff.R

+26-19
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,28 @@ fracdiff <- function(x, nar = 0, nma = 0,
7676
.Machine$double.neg.eps,
7777
.Machine$double.eps,
7878
PACKAGE = "fracdiff")
79+
## FIXME: In the case of just warning, the warning must be *KEPT*
80+
## ----- and/or be re-issued by summary.fracdiff() etc
7981
if(result$info)
8082
switch(result$info,
8183
stop("insufficient workspace; need ", result$lenw,
82-
" instead of just ", lenw),
83-
stop("error in gamma function"),
84-
stop("invalid MINPACK input"),
85-
warning("warning in gamma function"),
86-
warning("optimization failure"),
87-
warning("optimization limit reached"))
84+
" instead of just ", lenw), # 1
85+
stop("error in gamma function"), # 2
86+
stop("invalid MINPACK input"), # 3
87+
warning("warning in gamma function"), # 4
88+
warning("C fracdf() optimization failure",
89+
call.=FALSE, immediate. = TRUE) # 5
90+
91+
warning("optimization limit reached")) # 6
8892

8993
hess <- .C("fdhpq",
9094
hess = double(npq1 * npq1),
9195
npq1,
9296
result$w,
9397
PACKAGE = "fracdiff")$hess
9498

99+
## Note that the following can be "redone" using fracdiff.var() :
100+
95101
temp <- .C("fdcov",
96102
x,
97103
result$d,
@@ -109,7 +115,9 @@ fracdiff <- function(x, nar = 0, nma = 0,
109115
switch(temp$info,
110116
"fdcov problem in gamma function", # 1
111117
"singular Hessian", # 2
112-
"unable to compute correlation matrix", # 3
118+
## FIXME? improve: different reasons for info = 3 :
119+
"unable to compute correlation matrix; maybe change 'h'",
120+
# 3
113121
stop("error in gamma function")) # 4
114122
warning(msg)
115123
} else "ok"
@@ -177,18 +185,17 @@ fracdiff.var <- function(x, fracdiff.out, h)
177185
rep(0, lwork))),
178186
info = integer(1),
179187
PACKAGE = "fracdiff")
180-
if(temp$info) {
181-
msg <-
182-
switch(temp$info,
183-
"warning in gamma function",
184-
"singular Hessian",
185-
"unable to compute correlation matrix",
186-
stop("error in gamma function"))
187-
warning(msg)
188-
fracdiff.out$msg <- msg
189-
} else {
190-
fracdiff.out$msg <- "ok"
191-
}
188+
## FIXME: should be *automatically* same messages as inside fracdiff() above!
189+
fracdiff.out$msg <-
190+
if(temp$info) {
191+
msg <-
192+
switch(temp$info,
193+
"warning in gamma function",
194+
"singular Hessian",
195+
"unable to compute correlation matrix",
196+
stop("error in gamma function"))
197+
warning(msg)
198+
} "ok"
192199
se.ok <- temp$info != 0 || temp$info < 3 ## << FIXME -- illogical!!
193200
nam <- "d"
194201
if(p) nam <- c(nam, paste("ar", 1:p, sep = ""))

0 commit comments

Comments
 (0)