pcme {pcme} | R Documentation |
Find the maximum entropy completion of a partially specified periodic autocovariance sequence or report that it does not exist.
pcme(r, tau, x0 = NULL, method = "stabilNewton", gradient = TRUE, hessian = FALSE, autoshrink = TRUE, ...)
r |
the autocovariances, see Details. |
tau |
status of the autocovariances, see Details. |
x0 |
initial values, see Details. |
method |
method to use, one of "nlm" and "stabilNewton". |
gradient |
logical, if TRUE use analytical gradient |
hessian |
logical, if TRUE use analytical Hessian |
... |
other arguments to be passed to the optimisation functions. |
autoshrink |
if TRUE automaticallly reduce the number of parameters for non-linear optimisation, see Details. |
The maximum entropy (ME) problem is solved by the method of Boshnakov and Lambert-Lacroix described in the reference below. A sequence of ME problems is solved until an admissible initial value is found. This sequence is finite and usually no longer than 2. Then one final maximisation solves the original problem. So, the initial value is not a problem. For other properties properties of the method and how it detects the absense of solutions or that they are only non-negative definite see the referenced paper.
The argument x0
is not really necessary as
our method efficiently finds a valid initial value. When the
the ME problem has no solution, there is no valid initial value and
this is also reported by the method.
By default the non-linear maximization for the modified ME problems is
done with a stable hybrid Newton method implemented in this package
(see \stabilNewton
), use argument method="nlm"
to switch
to the core R function nlm
. The results are usually comparable
but in certain circumstances nlm
may fail, while in our
experience the stable version is virtually indestructible. Note that
the function stableNewton
is specifically tailored to this
problem and is overly conservative with the convergence criteria.
When method="nlm"
, nlm
may decide that the analytical
derivatives are wrong and ignore them, use the relevant argument of
nlm
if you wish to prevent this. This usually happens when the
autocovariances are close to the boundary of the admissible region
since the derivatives may well go bezerk without being wrong. In such
cases nlm
sometimes fails while the stable method always
succeeds. It is essential to keep the parameters within the
admissible region during optimisation and this is sometimes difficult
with nlm
.
If autoshrink
is TRUE determine the order of the ME model in
advance and optimise with respect to gaps within this order,
see Boshnakov and Lacroix (2009?) for more information. The acf for
the remaining missing values are then obtained from the periodic
Yule-Walker equations.
If autoshrink
is not TRUE the order of all seasons is set to
ncol(r)-1
. The the methods give the same values for the missing
autocovariances but the non-linear optimisation in the second one is
in larger dimension. Also, the model fitted with
autoshrink=TRUE
is the "true" one, the excessive coefficients
in the second method are theoretically zero but numerically only close
to zero.
Arguments gradient
and hessian
are ignored by
stabilNewton
, when it is used.
a list with the following components:
entropy |
value of the entropy at thesolution |
Rg |
autocovariances at the gaps |
gaps |
the gaps as season-lag pairs |
enthist |
entropyhistory |
nf |
nf |
ck |
list of ck's |
totaloptimhistory |
|
x0 |
initial value |
Georgi Boshnakov
Boshnakov, Georgi and Lambert-Lacroix, Sophie (2009?) Maximum entropy for periodically correlated processes from nonconsecutive autocovariance coefficients. J. Time Series Anal. (to appear)
data(pcme.paperex) attach(pcme.paperex) # make rex1 directly visible gap1p2 <- list(c(1,2)) # define some gaps gap2p2 <- list(c(2,2)) # internally use this package's modified Newton method resex1a <- pcme(rex1,gap1p2) resex2a <- pcme(rex2,gap1p2) resex3a <- pcme(rex3,gap1p2) resex4a <- pcme(rex4,gap1p2) resex5a <- pcme(rex5,gap2p2) # internally use core R function "nlm" ### with nlm, without analytical derivatives resex1 <- pcme(rex1,gap1p2,method="nlm",gradient=FALSE) resex2 <- pcme(rex2,gap1p2,method="nlm",gradient=FALSE) resex3 <- pcme(rex3,gap1p2,method="nlm",gradient=FALSE) resex4 <- pcme(rex4,gap1p2,method="nlm",hessian=TRUE,check.analyticals=FALSE) resex5 <- pcme(rex5,gap2p2,method="nlm",hessian=TRUE,check.analyticals=FALSE) ### With analytical Hessian resex1h <- pcme(rex1,gap1p2,method="nlm",hessian=TRUE,check.analyticals=FALSE) resex2h <- pcme(rex2,gap1p2,method="nlm",hessian=TRUE,check.analyticals=FALSE) resex3h <- pcme(rex3,gap1p2,method="nlm",hessian=TRUE,check.analyticals=FALSE) resex4h <- pcme(rex4,gap1p2,method="nlm",hessian=TRUE,check.analyticals=FALSE) resex5h <- pcme(rex5,gap2p2,method="nlm",hessian=TRUE,check.analyticals=FALSE)