@@ -76,22 +76,28 @@ fracdiff <- function(x, nar = 0, nma = 0,
76
76
.Machine $ double.neg.eps ,
77
77
.Machine $ double.eps ,
78
78
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
79
81
if (result $ info )
80
82
switch (result $ info ,
81
83
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
88
92
89
93
hess <- .C(" fdhpq" ,
90
94
hess = double(npq1 * npq1 ),
91
95
npq1 ,
92
96
result $ w ,
93
97
PACKAGE = " fracdiff" )$ hess
94
98
99
+ # # Note that the following can be "redone" using fracdiff.var() :
100
+
95
101
temp <- .C(" fdcov" ,
96
102
x ,
97
103
result $ d ,
@@ -109,7 +115,9 @@ fracdiff <- function(x, nar = 0, nma = 0,
109
115
switch (temp $ info ,
110
116
" fdcov problem in gamma function" , # 1
111
117
" 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
113
121
stop(" error in gamma function" )) # 4
114
122
warning(msg )
115
123
} else " ok"
@@ -177,18 +185,17 @@ fracdiff.var <- function(x, fracdiff.out, h)
177
185
rep(0 , lwork ))),
178
186
info = integer(1 ),
179
187
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"
192
199
se.ok <- temp $ info != 0 || temp $ info < 3 # # << FIXME -- illogical!!
193
200
nam <- " d"
194
201
if (p ) nam <- c(nam , paste(" ar" , 1 : p , sep = " " ))
0 commit comments