pspectrum
from psd package as a
replacement for sapa::SDF
. Not recommended for use in
production yet since psd::psectrum
does not preserve
spectrum estimates from multivariate spectrum to univariate, i.e.,
spectrum of linear combination does not equal linear combination
(quadratic form) of spectrum. psd::pspectrum
an be used to
compute univariate forecastability estimates based on a better
(smoothed) estimates of periodogram compared to raw
spec.pgram
.remove all dependencies and calls to sapa R
package. In particular this means no "wosa"
,
"multitaper"
, or "direct"
spectral
method
argument anymore. Instead rely on
"mvspec"
in the astsa package.
This is (unfortunately) necessary since ifultools and all its dependencies were removed from CRAN by 2020-06-09. sapa was the workhorse package for ForeCA.
ForeCA
compatible with R 4.0.0expect_true
wherever possible)quadratic_form
now computes the vector product with the
transpose and conjugate of the vector, i.e., the Hermitian of
the vector. Also added small speed up using crossprod
function.sqrt_matrix
did not work correctly for singular
matrices (zero eigenvalue). Fixed issue with numerical precision errors
testing for equality to zero. Now throws an error if matrix is not of
full rank and the inverse is required.fill_hermitian()
is now a public function (and added
tests)foreca.EM.E_and_M_step
as a wrapper for
foreca.EM.E_step
followed by
foreca.EM.M_step
.TRUE/FALSE
“normalized” attribute to objects of
class mvspectrum. This speeds up computation and checks significantly
since check_mvspectrum_normalized
only needs to check the
attribute, rather than computing the sum and comparing it to identity
matrix."lag window"
option for mvspectrum
since it does not work well with normalize_mvspectrum
.plot.mvspectrum
S3 methodnormalize_mvspectrum()
normalizes by left and right
multiplication of inverse square root of frequency total aggregate
estimate. This fixes the issue with different results of normalization
based on multivariate vs. univariate spectra estimation.print()
statement when running
foreca()
(displayed Omega
scores of the final
ForeCs)sqrt_matrix
threw an error if input matrix had
complex-valued eigen-values (since it checked for negative values).
Fixed now.nrow
in diag()
if
n.comp=1
in foreca.multiple_weightvectors
(otherwise it generated non-comformable arrays error).test_mvspectrum()
1e-6
(see
complete_algorithm_control()
)A bug-fix release and more modular, less repetitive coding under the hood; results in improved performance of the main algorithms.
Main notable change for users: to specify spectrum and entropy
estimation use spectrum.control
and
entropy.control
. Otherwise no relevant visible
user-interface changes.
Also review the manual; it has been very thoroughly reviewed.
sqrt_matrix
complete_entropy_control
complete_spectrum_control
complete_algorithm_control
check_whitened
check_mvspectrum_normalized
weightvector2entropy_wcov
mvpgram
print.foreca
S3 methodOmega
and several foreca.*
functions
changed arguments:
spectrum.conrol = list(...)
is the new way to specify
spectrum.method
, smoothing
.entropy.control = list(...)
is the new way to specify
entropy.method
, threshold
,
prior.weight
."mvfft"
default for spectrum estimation, using
mvfft
in R. This avoids the requirement to have
sapa or astsa installed.foreca.one_weightvector
and
foreca.multiple_weightvectors
wrappers for more modular and
less repititve coding.prior.weight = 1e-03
in
order to avoid log(0)
throughout the computations. If you
don’t want this, you have to explicitly specify
prior.weight = 0
in the entropy.control
argument.spectrum.method
s for
estimation of the spectrum/spectral density in the
complete_spectrum_control
help page.foreca.*()
functions only accept whitened time
series U
, not series
. Only
foreca()
directly accepts the original (unwhitened)
series
. Use U <- whiten(series)$U
to
obtain the whitened series.foreca.EM
: use
foreca(..., algorithm.type = "EM")
directly.R.utils::wrap
got replaced by
base::aperm
.method
argument in several functions.)spectral_entropy
now only works with a spectral density
input f.U
; not with series
or
spectrum.estimate
.whiten()
(thanks to Bjoern Weghenkel for pointing this
out):
initialize_weightvector
used the minimum Omega vector,
not maximum, for method = "max"
.mvspectrum
: the smooth univariate spectrum estimate
(smoothing = TRUE
) uses an exponential distribution with a
logarithmic link function in the mgcv::gam
function.discrete_entropy
:
prior.weight
is now between 0 and
1, not just greater than 0. can be done just with the
prior.weight
argument.''MLE''
is a valid method
now. If you
want to use ''smoothed''
, then thiscontinuous_entropy
changed from a
and b
to lower
and
upper
.eigen()
calls got symmetric = TRUE
. About
3x faster.initialize_weightvector
have the
r
prefix, i.e., "rnorm"
instead of
"norm"
. Same for "cauchy"
and
"unif"
.foreca.EM.opt_weightvector
changed to
foreca.EM.one_weightvector
._
) in argument names to dot
(.
). E.g., max_iter
to
max.iter
=
to <-
assignment operator
(big thanks to tidy.source()
)checkUsage()
)NEWS
file and edited to conform to proper
markdown formatmethod
argument in foreca()
to
algorithm.type
EM
class, to its own function (initialize_weightvector()
)"burg"
in
spec.ar()
tol
, nstart
, and
max.iter
in foreCA.EM()
into a
control
list (where nstart
became
num.starts
)plot.foreca.EM.opt_weightvector
mvspectrum2wcov()
mvspectrum()
(set
detrend = FALSE
and fast = FALSE
in
astsa::mvspec
)T/2
+/- 1 depending on even/odd sample
size)fill_symmetric()
(double counting diagonal;
only affected SDF
type estimation)EM
or MLE
). E.g.,
ForeCA.EM
to foreca.EM
;foreca.one_weightvector()
to
foreca.EM.opt_weightvector()
ForeCA.EM
First version 0.0.1 written by Georg M. Goerg on May 14, 2012.
data.table
package?