Title: | Periodic Time Series Analysis |
---|---|
Description: | Identification, model fitting and estimation for time series with periodic structure. Additionally, procedures for simulation of periodic processes and real data sets are included. Hurd, H. L., Miamee, A. G. (2007) <doi:10.1002/9780470182833> Box, G. E. P., Jenkins, G. M., Reinsel, G. (1994) <doi:10.1111/jtsa.12194> Brockwell, P. J., Davis, R. A. (1991, ISBN:978-1-4419-0319-8) Bretz, F., Hothorn, T., Westfall, P. (2010, ISBN: 9780429139543) Westfall, P. H., Young, S. S. (1993, ISBN:978-0-471-55761-6) Bloomfield, P., Hurd, H. L.,Lund, R. (1994) <doi:10.1111/j.1467-9892.1994.tb00181.x> Dehay, D., Hurd, H. L. (1994, ISBN:0-7803-1023-3) Vecchia, A. (1985) <doi:10.1080/00401706.1985.10488076> Vecchia, A. (1985) <doi:10.1111/j.1752-1688.1985.tb00167.x> Jones, R., Brelsford, W. (1967) <doi:10.1093/biomet/54.3-4.403> Makagon, A. (1999) <https://www.math.uni.wroc.pl/~pms/files/19.2/Article/19.2.5.pdf> Sakai, H. (1989) <doi:10.1111/j.1467-9892.1991.tb00069.x> Gladyshev, E. G. (1961) <https://www.mathnet.ru/php/archive.phtml?wshow=paper&jrnid=dan&paperid=24851> Ansley (1979) <doi:10.1093/biomet/66.1.59> Hurd, H. L., Gerr, N. L. (1991) <doi:10.1111/j.1467-9892.1991.tb00088.x>. |
Authors: | Anna Dudek [aut], Harry Hurd [aut], Wioletta Wojtowicz [aut], Karolina Marek [cre] |
Maintainer: | Karolina Marek <[email protected]> |
License: | GPL (>= 2.0) |
Version: | 1.7 |
Built: | 2025-02-21 04:14:44 UTC |
Source: | https://github.com/cran/perARMA |
This package provides procedures for periodic
time series analysis. The package includes procedures for nonparametric
spectral analysis and parametric (PARMA) identification,
estimation/fitting and prediction. The package is
equipped with three examples of periodic time series: volumes
and volumes.sep
,
which record hourly volumes of traded energy, and arosa
containing monthly ozone
levels.
Package: | perARMA |
Type: | Package |
Version: | 1.6 |
Date: | 2016-02-25 |
License: | GPL(>=2.0) |
LazyLoad: | yes |
The main routines are:
Nonparametric spectral analysis: pgram
, scoh
Preliminary identification and conditioning: permest
, persigest
Identification: peracf
, Bcoeff
, perpacf
, acfpacf
Parameter estimation/fitting: perYW
, loglikec
, parmaf
, loglikef
Prediction: predictperYW
, predseries
Simulation and testing: makeparma
, parma_ident
For a complete list of procedures use library(help="perARMA")
.
Anna Dudek, Harry Hurd and Wioletta Wojtowicz
Maintainer: Karolina Marek <[email protected]>
Hurd, H. L., Miamee, A. G., (2007), Periodically Correlated Random Sequences: Spectral Theory and Practice, Wiley InterScience.
Packages for Periodic Autoregression Analysis link{pear}
,
Dynamic Systems Estimation link{dse}
and
Bayesian and Likelihood Analysis of Dynamic Linear Models link{dlm}
.
## Do not run ## It could take more than one minute #demo(perARMA)
## Do not run ## It could take more than one minute #demo(perARMA)
The function ab2phth
transforms an input matrix
a
of size containing the sine and cosine
coefficients in the real Fourier series representation,
to the
output matrix
phi
according to
for
and
.
The inverse transformation is implemented in
phth2ab
function.
ab2phth(a) phth2ab(phi)
ab2phth(a) phth2ab(phi)
a |
matrix of |
phi |
matrix of |
martix phi
or a
for ab2phth
or phth2ab
, respectively.
Harry Hurd
makepar
, makeparma
, parma_ident
m=matrix(seq(0,11),3,4) ab<-ab2phth(m) phi=ab$phi phth2ab(phi)
m=matrix(seq(0,11),3,4) ab<-ab2phth(m) phi=ab$phi phth2ab(phi)
Plots values of usual ACF and PACF functions with confidence
intervals. Function acfpacf
uses procedures acfpacf.acf
and
acfpacf.pacf
, which computes values of ACF and PACF function, respectively.
acfpacf(x, nac, npac, datastr,...) acfpacf.acf(x, normflg) acfpacf.pacf(x, m)
acfpacf(x, nac, npac, datastr,...) acfpacf.acf(x, normflg) acfpacf.pacf(x, m)
x |
input time series, missing values are not permitted. |
nac |
number of ACF values to return (typically much less than length of |
npac |
number of PACF values to return (typically much less than length of |
datastr |
string name of data to be printed on the plot. |
normflg |
computing parameter for ACF values. These values are returned as a series |
m |
maximum lag to compute PACF values. Value for the first lag ( |
... |
other arguments: |
Function acfpacf
returns plot of ACF and PACF values with two types of
thresholds for input acalpha
and pacalpha
, respectively. The first one
denoted by thr
is given for ACF values by and
where
acf(k)
is the ACF value at lag k
. This threshold corresponds to type I
error for null hypothesis that acf(k) = 0
. The plot allows to check if any of
the ACF values are significantly non-zero. Actual
threshold calculations are based on the following asymptotic result:
if is
, then for large
,
for
are
(see Brockwell, P. J., Davis, R. A., 1991, Time Series: Theory and Methods, example 7.2.1, p. 222).
Thus, under the null hypothesis, the plots for
thr = qnorm(1-acalpha/2,0,1/sqrt(nr))
should exhibit a proportion of roughly acalpha
points that lie outside
the interval [-thr, thr]
. Threshold for PACF is based on the same results.
On the other hand we can also interpret the plots as a multiple hypothesis testing problem to compute second
threshold thrm
. Suppose, we decided to plot some number of nonzero lags (equal to nac
)
of the ACF function. If the estimated acf
values estimates
are IID then we have nac
independent tests of acf(k) = 0
. The probability that at least one of values
lies outside the interval [-thr, thr]
is equal to 1-Pr[all lie inside]
, which is [1-(1-acalpha)]^nac
.
Finally, the last expression is approximately
equal to nac*acalpha
. To get a threshold thrmh
such that 1-Pr[all lie inside] = acalpha
we
take the threshold as thrmh = qnorm (1-(acalpha/2)/nac, 0, 1/sqrt(nr))
(for more details check the Bonferroni correction).
For the PACF, the threshold thrm
calculation is based on Theorem 8.1.2
of Time Series: Theory and Methods, p. 241, which states that the PACF values for an AR sequence are
asymptotically normal.
No return value, called for side effects
Procedure acfpacf
is an implementation of the usual (meaning not periodic) ACF and PACF functions.
It happens that for PC time series the usual ACF and PACF are still useful in the identification of model orders and in some cases can be more sensitive than
the perodic versions. The ACF and PACF values inform about the correlations of the random part. It is possible to run acfpacf
on original data which include the peridic mean as a deterministic component. But typically the periodic mean can distort our understanding
(or view) of the random fluctuations, thus running acfpacf
additionally on the data after removing periodic mean is suggested.
It is possible to use also acfpacf.acf
, acfpacf.pacf
procedures to obtain values of
ACF and PACF functions, respectively. When subjected to a truly PC sequence, the usual
ACF and PACF produce an average of the instantaneous (time indexed)
values produced by periodic ACF and periodic PACF. Depending therefore on correlations
between these averaged quantities, the usual ACF and PACF may be more or
less sensitive that the instantaneous ones.
Harry Hurd
Box, G. E. P., Jenkins, G. M., Reinsel, G. (1994), Time Series Analysis, 3rd Ed., Prentice-Hall,
Englewood Cliffs, NJ.
Brockwell, P. J., Davis, R. A. (1991), Time Series: Theory and Methods, 2nd Ed., Springer: New York.
Bretz, F., Hothorn, T., Westfall, P. (2010), Multiple Comparisons Using R, CRC Press.
Westfall, P. H., Young, S. S. (1993), Resampling-Based Multiple Testing: Examples and Methods
for p-Value Adjustment, Wiley Series in Probability and Statistics.
data(volumes) # for original data dev.set(which=1) acfpacf(volumes,24,24,'volumes') # for data after removing periodic mean pmean_out<-permest(t(volumes),24, 0.05, NaN,'volumes',pp=0) xd=pmean_out$xd dev.set(which=1) acfpacf(xd,24,24,'volumes')
data(volumes) # for original data dev.set(which=1) acfpacf(volumes,24,24,'volumes') # for data after removing periodic mean pmean_out<-permest(t(volumes),24, 0.05, NaN,'volumes',pp=0) xd=pmean_out$xd dev.set(which=1) acfpacf(xd,24,24,'volumes')
A fifty-year time series of monthly stratospheric ozone readings from Arosa, Switzerland. The dataset length is equal to 684, but some of the observations are missing (denoted by NaNs).
data(arosa)
data(arosa)
The format is: Time-Series [1:684] from 1 to 684: NaN NaN NaN NaN NaN NaN 312 300 281 267 ...
Bloomfield, P., Hurd, H. L.,Lund, R., (1994), Periodic correlation in stratospheric ozone data. Journal of Time Series Analysis 15, 127-150.
data(arosa) str(arosa)
data(arosa) str(arosa)
The procedure Bcoeff
computes the complex estimators
as Fourier coefficients in covariance function representation.
The procedure first computes the periodic mean
(with missing values ignored) and subtracts it from the series.
For each specified lag
, the values of
are computed only for
,
because for real series
.
Also the p-values for the test
are returned.
The function Bcoeffa
calculates the estimator of the real
coefficients which satisfy
,
for all required lags
and
.
Bcoeff(x, T_t, tau, missval, datastr,...) Bcoeffa(x, T_t, tau, missval, datastr,...)
Bcoeff(x, T_t, tau, missval, datastr,...) Bcoeffa(x, T_t, tau, missval, datastr,...)
x |
input time series. |
T_t |
period length of PC-T structure. |
tau |
vector of lag values on which estimation of |
missval |
notation for missing values. |
datastr |
string name of data for printing. |
... |
other arguments: |
This procedure can be applied to the original series to obtain estimators of in covariance function representation
or to the normalized series (series after periodic mean removal and division by standard deviations) to obtain correlation coefficients.
The p-values for test of
are based on
the ratio of magnitude squares of amplitudes of a high
resolution Fourier decompositions. Magnitudes for the
frequency corresponding to index
are compared to
the magnitudes of neighboring frequencies
(via the F distribution) (see Hurd, H. L., Miamee, A. G., 2007, Periodically Correlated Random Sequences, pp. 272-282, 288-292).
procedures (for positive printflg
parameter) print a table containing the following columns:
k |
index number of the coefficient |
reB_k , imB_k/ahat_k
|
real and imaginary parts of estimated coefficient |
n1 |
degrees of freedom associated to the estimator
|
n2 |
degrees of freedom associated to the
"background" variance estimation |
Fratio |
the statistic |
pv |
p-values for test of |
If printflg
is set to be equal to 0, above values are returned just as matrices.
Harry Hurd
Dehay, D., Hurd, H. L., (1994), Representation and Estimation for Periodically and Almost Periodically
Correlated Random Processes in W. A. Gardner (ed.), Cyclostationarity in Communications and Signal Processing, IEEE Press.
Hurd, H. L., Miamee, A. G., (2007), Periodically Correlated Random Sequences:
Spectral Theory and Practice, Wiley InterScience.
data(volumes) Bcoeff(volumes,24,seq(0,12),NaN,'volumes') Bcoeffa(volumes,24,seq(0,12),NaN,'volumes')
data(volumes) Bcoeff(volumes,24,seq(0,12),NaN,'volumes') Bcoeffa(volumes,24,seq(0,12),NaN,'volumes')
Function loglikec
, given phi
, del
, theta
encoded in ptvec
, evaluates the logarithm of likelihood function from the
PARMA series. Procedure returns also values of the AIC, FPE, BIC information criteria and MSE of residuals,
what enables to examine residuals and evaluate godness of model fit.
loglikec(ptvec, x, conpars)
loglikec(ptvec, x, conpars)
ptvec |
vector of parameters for PARMA(p,q) model, containing matrix parameters
|
x |
input time series. |
conpars |
vector of parameters |
In this procedure first series x
is filtered by matrix coefficients phi
, del
, theta
.
The code to compute logarithm of likelihood function must includes
the computation of covariance matrix from the parameters phi
, del
, theta
.
Since the inverse of the computed covariance is needed for computing the likelihood,
and it is sometimes ill conditioned (or even singular),
the condition is improved by removing rows and columns corresponding to very small eigenvalues.
This corresponds to removing input data that is highly linearly dependent on the remaining
input data. The procedure contains a threshold ZTHRS (which current value is 10*eps
) that governs the discarding of rows and column corresponding to small eigenvalues (these are determined by a Cholesky decomposition). Any eigenvalue smaller than the threshold has its row and column deleted from the matrix. Then the
inverse and the likelihood are computed from the reduced rank covariance matrix.
list of values:
loglik |
logarithm of likehood function (nagative value). |
aicval |
value of AIC criterion. |
fpeval |
value of FPE criterion. |
bicval |
value of BIC criterion. |
In the loglikec
procedure, motivated by the possibility of deficient rank sequences, we made a variant of the Cholesky decomposition. In proposed approach upper traingular
matrix eliminates data points that are lineary dependant on previous ones and removes their consideration in the likelihood value calculation. As a consequence data vector
is reduced so that covariance matrix is positive definite and problem of non-invertible covariance matrix is avoided.
Harry Hurd
Box, G. E. P., Jenkins, G. M., Reinsel, G. (1994), Time Series Analysis, 3rd Ed., Prentice-Hall,
Englewood Cliffs, NJ.
Brockwell, P. J., Davis, R. A. (1991), Time Series: Theory and Methods, 2nd Ed., Springer: New York.
Vecchia, A., (1985), Maximum Likelihood Estimation for Periodic Autoregressive Moving Average Models, Technometrics, v. 27, pp.375-384.
Vecchia, A., (1985), Periodic autoregressive-moving average (PARMA) modeling with applications to water resources, Water Resources
Bulletin, v. 21, no. 5.
## Do not run ## It could take a few seconds data(volumes) pmean<-permest(t(volumes),24, 0.05, NaN,'volumes', pp=0) xd=pmean$xd estimators<-perYW(volumes,24,2,NaN) estvec=c(estimators$phi[,1],estimators$phi[,2],estimators$del) loglikec(estvec,xd,c(24,2,0,0))
## Do not run ## It could take a few seconds data(volumes) pmean<-permest(t(volumes),24, 0.05, NaN,'volumes', pp=0) xd=pmean$xd estimators<-perYW(volumes,24,2,NaN) estvec=c(estimators$phi[,1],estimators$phi[,2],estimators$del) loglikec(estvec,xd,c(24,2,0,0))
Procedure loglikef
computes the logarithm of likelihood function from the PARMA
sequence x
for matrices
phi
(of size ) and
theta
(of size )
inputed in their Fourier representation as
a
and b
, respectively.
loglikef(ab, x, conpars)
loglikef(ab, x, conpars)
ab |
matrix |
x |
input time series. |
conpars |
vector of parameters |
This method of computation of logarithm of likelihood function makes use of the representation of the periodically varying parameters by Fourier series.
This alternative parametrization of PARMA system, introduced by
Jones and Breslford, can sometimes substantially reduce the number of parameters required to represent PARMA system. Mapping between phi
and theta
coefficients
and a
and b
coefficients is one-to-one, so first
logarithm of likelihood is computed for transformed coefficients and then these coefficients are transformed to phi
and theta
.
Fourier series parametrization permits us
to reduce the total number of parameters by constraining some frequencies to have zero amplitude. Then the code includes
the computation of covariance matrix from the parameters phi
, del
, theta
.
Since the inverse of the computed covariance is needed for computing the likelihood, and it is sometimes ill conditioned (or even singular), the condition is improved by removing rows and columns corresponding to very small eigenvalues. This corresponds to removing input data that is highly linearly dependent on the remaining input data. The procedure contains a threshold ZTHRS (which current value is 10*eps
) that governs the discarding of rows and column corresponding to small eigenvalues (these are determined by a Cholesky decomposition). Any eigenvalue smaller than the threshold has its row and column deleted from the matrix. Then the
inverse and the likelihood are computed from the reduced rank covariance matrix.
negative value of the logarithm of likelihood function: y
.
In the loglikef
procedure, motivated by the possibility of deficient rank sequences, we made a variant of the Cholesky decomposition. In proposed approach upper traingular
matrix eliminates data points that are lineary dependant on previous ones and removes their consideration in the likelihood value calculation. As a consequence data vector
is reduced so that covariance matrix is positive definite and problem of non-invertible covariance matrix is avoided.
This function is used in parmaf
procedure, thus for more details please look also at parmaf
code.
Harry Hurd
Box, G. E. P., Jenkins, G. M., Reinsel, G. (1994), Time Series Analysis, 3rd Ed., Prentice-Hall, Englewood Cliffs, NJ.
Brockwell, P. J., Davis, R. A., (1991), Time Series: Theory and Methods, 2nd Ed., Springer: New York.
Jones, R., Brelsford, W., (1967), Time series with periodic structure, Biometrika 54, 403-408.
Makagon, A., (1999), Theoretical prediction of periodically correlated sequences, Probability and Mathematical Statistics 19 (2), 287-322.
Sakai, H., (1989), On the spectral density matrix of a periodic ARMA process, J. Time Series Analysis, v. 12, no. 2, pp. 73-82.
Vecchia, A., (1985), Maximum Likelihood Estimation for Periodic Autoregressive Moving Average Models, Technometrics, v. 27, pp.375-384.
Procedures makeparma
and makepar
enable to construct PARMA and PAR type sequence of length n
according to inputed matrices phi
, theta
, del
.
The optional parameter nprep
defines the number of
periods of simulated output y
that will be discarded to let
the start-up transients settle.
makeparma(n, phi, theta, del, nprep) makepar(n, phi, del, nprep)
makeparma(n, phi, theta, del, nprep) makepar(n, phi, del, nprep)
n |
length of simulated series. |
phi |
matrix of size |
theta |
matrix of size |
del |
vector of length |
nprep |
number of periods of simulated output; for |
A vector of independent
variates is generated by
the standard
random number generator
rnorm
. This vector series is filtered
by parmafil
, which parameters are set by phi
, theta
and del
,
to generate the filtered series (pre-iterates and the n
desired data).
The last n
data of the filtered series are output in the vector y
.
PARMA or PAR sequence returned as y
.
Harry Hurd
##################### simulation of PARMA(2,1) T=12 nlen=480 p=2 a=matrix(0,T,p) q=1 b=matrix(0,T,q) a[1,1]=.8 a[2,1]=.3 phia<-ab2phth(a) phi0=phia$phi phi0=as.matrix(phi0) b[1,1]=-.7 b[2,1]=-.6 thetab<-ab2phth(b) theta0=thetab$phi theta0=as.matrix(theta0) del0=matrix(1,T,1) PARMA21<-makeparma(nlen,phi0,theta0,del0) parma<-PARMA21$y plot(ts(parma)) ##################### simulation of PAR(2) T=24 nlen=1000 p=2 a=matrix(0,T,p) a[1,1]=.5 a[2,2]=.4 phia<-ab2phth(a) phi0=phia$phi phi0=as.matrix(phi0) del0=matrix(1,T,1) PAR1<-makepar(nlen,phi0,del0) par<-PAR1$y plot(ts(par))
##################### simulation of PARMA(2,1) T=12 nlen=480 p=2 a=matrix(0,T,p) q=1 b=matrix(0,T,q) a[1,1]=.8 a[2,1]=.3 phia<-ab2phth(a) phi0=phia$phi phi0=as.matrix(phi0) b[1,1]=-.7 b[2,1]=-.6 thetab<-ab2phth(b) theta0=thetab$phi theta0=as.matrix(theta0) del0=matrix(1,T,1) PARMA21<-makeparma(nlen,phi0,theta0,del0) parma<-PARMA21$y plot(ts(parma)) ##################### simulation of PAR(2) T=24 nlen=1000 p=2 a=matrix(0,T,p) a[1,1]=.5 a[2,2]=.4 phia<-ab2phth(a) phi0=phia$phi phi0=as.matrix(phi0) del0=matrix(1,T,1) PAR1<-makepar(nlen,phi0,del0) par<-PAR1$y plot(ts(par))
Procedure parma_ident
utilizes a collection of procedures
(functions) that together provide
identification of PC structure in the series and saves results in the 'ident.txt'
file, which is
located in the working directory.
This procedure could be applied to the original time series x
or to the residuals of fitted PARMA models
to characterize the goodness of fit.
parma_ident(x, T_t, missval, datastr, ...)
parma_ident(x, T_t, missval, datastr, ...)
x |
input time series. |
T_t |
period of PC-T structure. |
missval |
notation for missing values. |
datastr |
string name of data for printing. |
... |
other arguments: |
Procedure parma_ident
provides a universal method for analyzing series
or residuals. It calls following procedures:
permest
, persigest
, peracf
, Bcoeff
, Bcoeffa
, perpacf
,
ppfcoeffab
, ppfplot
, acfpacf
.
procedure returns list of values:
pmean |
periodic mean values, |
xd |
series after removing periodic mean, |
pstd |
periodic standard deviations values, |
xn |
series obtained after removing periodic mean and divided by periodic standard deviations, |
as well as a text file 'ident.txt'
containing all the textual output generated
in the running of parma_ident
.
Harry Hurd
Hurd, H. L., Miamee, A. G., (2007), Periodically Correlated Random Sequences: Spectral Theory and Practice, Wiley InterScience.
############### PC-T series simulation T=12 nlen=480 descriptor='PARMA(2,1) periodic phis all del =1' p=2 a=matrix(0,T,p) q=1 b=matrix(0,T,q) a[1,1]=.8 a[2,1]=.3 a[1,2]=-.9 phia<-ab2phth(a) phi0=phia$phi phi0=as.matrix(phi0) b[1,1]=-.7 b[2,1]=-.6 thetab<-ab2phth(b) theta0=thetab$phi theta0=as.matrix(theta0) del0=matrix(1,T,1) makeparma_out<-makeparma(nlen,phi0,theta0,del0) y=makeparma_out$y ############### parma_ident use parma_ident(t(y),T,NaN,descriptor,outdir=tempdir())
############### PC-T series simulation T=12 nlen=480 descriptor='PARMA(2,1) periodic phis all del =1' p=2 a=matrix(0,T,p) q=1 b=matrix(0,T,q) a[1,1]=.8 a[2,1]=.3 a[1,2]=-.9 phia<-ab2phth(a) phi0=phia$phi phi0=as.matrix(phi0) b[1,1]=-.7 b[2,1]=-.6 thetab<-ab2phth(b) theta0=thetab$phi theta0=as.matrix(theta0) del0=matrix(1,T,1) makeparma_out<-makeparma(nlen,phi0,theta0,del0) y=makeparma_out$y ############### parma_ident use parma_ident(t(y),T,NaN,descriptor,outdir=tempdir())
Procedure parmaf
enables the estimation of parameters of the chosen representation of PARMA(p,q) model. For general PARMA we use non-linear
optimization methods to obtain minimum of negative logarithm of likelihood function using loglikef
procedure. Intitial values of parameters are computed using Yule-Walker equations.
parmaf(x, T_t, p, q, af, bf, ...)
parmaf(x, T_t, p, q, af, bf, ...)
x |
input time series. |
T_t |
period length of PC-T structure. |
p |
maximum PAR order, which is a number of columns in |
q |
maximum PMA order, which is a number of columns in |
af |
|
bf |
|
... |
Other arguments: |
In order to obtain maximum likelihood estimates of model parameters a
and b
we use a numerical optimization method to minimalize value of y
(as negative value of logarithm of loglikelihood function returned by loglikef
)
over parameter values. Internally, parameters a
and b
are
converted to phi
and theta
as needed via function
ab2phth
. For the present we use optim
function with defined method="BFGS"
(see code for more details).
list of values:
a |
is matrix of Fourier coefficients determining |
b |
is matrix of Fourier corfficients determining |
negloglik |
minimum value of negative logarithm of likehood function. |
aicval |
value of AIC criterion. |
fpeval |
value of FPE criterion. |
bicval |
value of BIC criterion. |
resids |
series of residuals. |
Harry Hurd
Box, G. E. P., Jenkins, G. M., Reinsel, G. (1994), Time Series Analysis, 3rd Ed., Prentice-Hall, Englewood Cliffs, NJ.
Brockwell, P. J., Davis, R. A., (1991), Time Series: Theory and Methods, 2nd Ed., Springer: New York.
Jones, R., Brelsford, W., (1967), Time series with periodic structure, Biometrika 54, 403-408.
Vecchia, A., (1985), Maximum Likelihood Estimation for Periodic Autoregressive Moving Average Models, Technometrics, v. 27, pp.375-384.
######## simulation of periodic series T=12 nlen=480 p=2 a=matrix(0,T,p) q=1 b=matrix(0,T,q) a[1,1]=.8 a[2,1]=.3 a[1,2]=-.9 phia<-ab2phth(a) phi0=phia$phi phi0=as.matrix(phi0) b[1,1]=-.7 b[2,1]=-.6 thetab<-ab2phth(b) theta0=thetab$phi theta0=as.matrix(theta0) del0=matrix(1,T,1) makeparma_out<-makeparma(nlen,phi0,theta0,del0) y=makeparma_out$y ## Do not run ## It could take more than one minute ############ fitting of PARMA(0,1) model p=0 q=1 af=matrix(0,T,p) bf=matrix(0,T,q+1) bf[1,1]=1 bf[1:3,2]=1 parmaf(y,T,p,q,af,bf) ########### fitting of PARMA(2,0) model p=2 q=0 af=matrix(0,T,p) bf=matrix(0,T,q+1) af[1:3,1]=1 af[1:3,2]=1 bf[1,1]=1 parmaf(y,T,p,q,af,bf) ############ fitting of PARMA(2,1) model p=2 q=1 af=matrix(0,T,p) bf=matrix(0,T,q+1) af[1:3,1]=1 af[1:3,2]=1 bf[1,1]=1 bf[1:3,2]=1 parmaf(y,T,p,q,af,bf)
######## simulation of periodic series T=12 nlen=480 p=2 a=matrix(0,T,p) q=1 b=matrix(0,T,q) a[1,1]=.8 a[2,1]=.3 a[1,2]=-.9 phia<-ab2phth(a) phi0=phia$phi phi0=as.matrix(phi0) b[1,1]=-.7 b[2,1]=-.6 thetab<-ab2phth(b) theta0=thetab$phi theta0=as.matrix(theta0) del0=matrix(1,T,1) makeparma_out<-makeparma(nlen,phi0,theta0,del0) y=makeparma_out$y ## Do not run ## It could take more than one minute ############ fitting of PARMA(0,1) model p=0 q=1 af=matrix(0,T,p) bf=matrix(0,T,q+1) bf[1,1]=1 bf[1:3,2]=1 parmaf(y,T,p,q,af,bf) ########### fitting of PARMA(2,0) model p=2 q=0 af=matrix(0,T,p) bf=matrix(0,T,q+1) af[1:3,1]=1 af[1:3,2]=1 bf[1,1]=1 parmaf(y,T,p,q,af,bf) ############ fitting of PARMA(2,1) model p=2 q=1 af=matrix(0,T,p) bf=matrix(0,T,q+1) af[1:3,1]=1 af[1:3,2]=1 bf[1,1]=1 bf[1:3,2]=1 parmaf(y,T,p,q,af,bf)
Procedure parmafil
filters the vector x
according to matrices a, b
containing PARMA model parameters.
The function returns series y
such that
.
parmafil(b, a, x)
parmafil(b, a, x)
b |
matrix of size |
a |
matrix of size |
x |
input time series. |
Filtered signal y
.
To filter using the convention
with
,
set
a=[ones(T,1),-phi]
, b=[theta]
, then x=parmafil(b,a,xi)
.
Harry Hurd
b=matrix(c(1,1,0,0,.5,.5),2,3) a=matrix(c(1,1,.5,.5),2,2) s=sample(1:100,50, replace=TRUE) x=matrix(s,50,1) parmafil_out<-parmafil(a,b,x) y=parmafil_out$y plot(y,type="l")
b=matrix(c(1,1,0,0,.5,.5),2,3) a=matrix(c(1,1,.5,.5),2,2) s=sample(1:100,50, replace=TRUE) x=matrix(s,50,1) parmafil_out<-parmafil(a,b,x) y=parmafil_out$y plot(y,type="l")
Procedure parmaresid
, given phi
(of size ),
del
(of size ),
theta
(of size ), computes the residuals of PARMA series.
parmaresid(x, stype, del, phi,...)
parmaresid(x, stype, del, phi,...)
x |
input time series. |
stype |
numeric parameter connected with covariance matrix computation, so far should be equal to 0 to use procedure
|
del |
vector of coefficients of length |
phi |
matrix of coefficients of size |
... |
matrix of coefficients |
This program uses parmafil
to filter the series and computes the covariance matrix.
This code does the Cholesky factorization and
determines the residuals from the inverse of L
(see the code:
e=Linv*w0_r1
). This allows the treatment of a deficient rank
covariance and a reduction of rank.
Procedure parmaresid
is used in parmaf
function.
Series of residuals resids
.
Harry Hurd
Box, G. E. P., Jenkins, G. M., Reinsel, G. (1994), Time Series Analysis, 3rd Ed., Prentice-Hall,
Englewood Cliffs, NJ.
Brockwell, P. J., Davis, R. A. (1991), Time Series: Theory and Methods, 2nd Ed., Springer: New York.
Vecchia, A., (1985), Maximum Likelihood Estimation for Periodic Autoregressive Moving Average Models, Technometrics, v. 27, pp.375-384.
## Do not run ## It could take a few seconds data(volumes) pmean<-permest(t(volumes),24, 0.05, NaN,'volumes', pp=0) xd=pmean$xd estimators<-perYW(volumes,24,2,NaN) parmaresid(xd, 0, estimators$del, estimators$phi)
## Do not run ## It could take a few seconds data(volumes) pmean<-permest(t(volumes),24, 0.05, NaN,'volumes', pp=0) xd=pmean$xd estimators<-perYW(volumes,24,2,NaN) parmaresid(xd, 0, estimators$del, estimators$phi)
Function peracf
, given an input time series and a specified period T
, computes the periodic correlation coefficients for which
, where
are seasons and
is lag. For each
possible pair of
and
confidence limits for
are also computed using Fisher
transformation. Procedure
peracf
provides also two important tests: and
.
peracf(x, T_t, tau, missval, datastr,...)
peracf(x, T_t, tau, missval, datastr,...)
x |
input time series, at the begining missing values
in |
T_t |
period of PC-T structure. |
tau |
vector of lag values for which estimation is made. |
missval |
notation for missing values (denoted as NaN). |
datastr |
string name of data for printing. |
... |
other arguments, that are connected with the plots: |
Function peracf
uses three separate procedures:rhoci()
returns the upper and lower bands defining a confidence interval for the true values of
,
rho.zero.test()
tests whether the estimated correlation coefficients are equal to zeros, .
rho.equal.test()
tests whether the estimated correlation coefficients are equal to each other for all seasons in the period,
.
In the test , rejection for some
indicates
that series is properly PC and is not just an amplitude modulated stationary
sequence. In other words, there exists a nonzero
lag
for which
is
properly periodic in
.
In the test , the
rejection for some
indicates the sequence is not PC white noise.
tables of values for each specified lag :
rho(t , tau)
|
estimated correlation coefficients. |
lower |
lower bands of confidence intervals. |
upper |
upper bands of confidence intervals. |
nsamp |
number of samples used in each estimation. |
Above values are also returned as matrices.
Harry Hurd
Hurd, H. L., Miamee, A. G., (2007), Periodically Correlated Random Sequences: Spectral Theory and Practice, Wiley InterScience.
data(volumes) dev.set(which=1) peracf(t(volumes),24,seq(1,12),NaN,'volumes')
data(volumes) dev.set(which=1) peracf(t(volumes),24,seq(1,12),NaN,'volumes')
Assuming that the period T
is known, procedure permest
plots and returns the estimated periodic
mean as a function of season. Missing data are permitted.
The confidence intervals for these values, based on the t-distribution, are also computed
and plotted. The de-meaned x
is also returned with missing values
replaced by periodic mean values.
If at time t
there is a missing value,
it is replaced with the periodic mean at (t mod T)
, provided the periodic mean exists (meaning there is at least one non-missing data for the
season (t mod T)
). Otherwise the periodic mean at (t mod T)
will be set to "Missing"
and in the output vectors
xr
and xd
all the values whose times are congruent with (t mod T)
will be set to "Missing"
.
permest(x, T_t, alpha, missval, datastr,...)
permest(x, T_t, alpha, missval, datastr,...)
x |
input time series. |
T_t |
period of the computed mean. |
alpha |
|
missval |
notation for missing values. |
datastr |
string name of data for printing. |
... |
other arguments used in the plot: |
The series may contain missing values (we suggest using NaN
)
and the length of the series need not be
an integer multiple of the period. The program returns
and plots the periodic mean with 1-alpha
confidence
intervals based on all non-missing values present for each
particular season. The p-value for a one-way
ANOVA test for equality of seasonal means is also computed.
procedure returns:
pmean |
periodic mean values. |
lower , upper
|
bounds of the confidence intervals. |
xr |
series with missing values replaced by periodic mean values. |
xd |
series after removing periodic mean. |
pmpv |
p-value for a one-way ANOVA test for equality of means. |
Harry Hurd
Hurd, H. L., Miamee, A. G., (2007), Periodically Correlated Random Sequences:
Spectral Theory and Practice, Wiley InterScience.
Westfall, P. H., Young, S. S. (1993), Resampling-Based Multiple Testing: Examples and Methods
for p-Value Adjustment, Wiley Series in Probability and Statistics.
data(arosa) dev.set(which=1) permest(t(arosa),12, 0.05, NaN,'arosa')
data(arosa) dev.set(which=1) permest(t(arosa),12, 0.05, NaN,'arosa')
The function perpacf
, given an input time series, a specified period T
and a lag p
, computes
the periodic sample correlation coefficients and returns their values as a matrix
ppa
of size .
The ppfcoeffab
procedure transforms the output of perpacf
into Fourier form, i.e. into Fourier coeficients,
so we can represent by its Fourier coefficients.
Function ppfplot
plots perpacf coefficients returned by perpacf
as function of n
for each specified lag .
perpacf(x, T_t, p, missval) ppfcoeffab(ppf, nsamp, printflg, datastr) ppfplot(ppf, nsamp, alpha, datastr)
perpacf(x, T_t, p, missval) ppfcoeffab(ppf, nsamp, printflg, datastr) ppfplot(ppf, nsamp, alpha, datastr)
x |
input time series. |
T_t |
period of PC-T structure. |
p |
maximum lag used in computation. |
missval |
notation for missing values. |
ppf |
matrix of periodic PACF values (of size |
nsamp |
number of samples (periods) used to compute |
printflg |
parameter should be positive to return messages. |
alpha |
parameter for thresolds are displayed along with the Bonferroni corrected thresholds. |
datastr |
string name of data for printing. |
Procedure perpacf
returns ppa
matrix, where for
each separation n=0,1,...,p
, ppa[,n]
is the value
of for
t=1,2,...,T
. Further, since T
is assumed to be the period of the underlying PC process,
is periodic in
t
with period T
. So we can represent by its Fourier coefficients.
Further, if the variation in time of
is really smooth over the period, then looking at
these Fourier coefficients (the output of
ppfcoeffab
) may be a more sensitive detector of linear dependence
of on the preceding
n
samples
(think of n
as fixed here) than looking at for individual times.
The
ppfcoeffab
procedure also needs the sample size nsamp
used by perpacf
in computing the
in order to compute p-values for the
pkab
coefficients. The
p-values are computed assuming that for each t
, is
N(0,1/sqrt(nsamp))
under the null.
The procedure ppfcoeffab
is called in parma_ident
.
Function ppfplot
plots values of and computes p-values for testing
if
for all
t = 1, ..., T
and fix (p-values in column labelled
) and
if
for all
t = 1, ..., T
and (p-values in column labelled
).
perpacf is plotted as function of n for each specified lag
.
The function perpacf
returns two matrixes:
ppa |
matrix of size |
nsamp |
matrix of size |
The function ppfcoeffab
returns table of values:
pihat_k |
Fourier coefficients |
pv |
Bonferroni corrected p-values. |
The function ppfplot
returns plot of coefficients and table of p-vaules for provided
tests. Note that there are two plots; the first plot presents values of
for all considered
and
, whereas
the second plot presents separate charts for particular
values.
Harry Hurd
Hurd, H. L., Miamee, A. G., (2007), Periodically Correlated Random Sequences: Spectral Theory and Practice, Wiley InterScience.
data(volumes) perpacf_out<-perpacf(t(volumes),24,12,NaN) ppa=perpacf_out$ppa nsamp=perpacf_out$nsamp ppfcoeffab(ppa,nsamp,1,'volumes') ppfplot(ppa,41,.05,'volumes')
data(volumes) perpacf_out<-perpacf(t(volumes),24,12,NaN) ppa=perpacf_out$ppa nsamp=perpacf_out$nsamp ppfcoeffab(ppa,nsamp,1,'volumes') ppfplot(ppa,41,.05,'volumes')
Assuming that the period T
is known, procedure persigest
plots and returns the estimated periodic
standard deviation as a function of season. Missing data are permitted. The
confidence intervals for these values, based on the chi-square distribution, are also
computed and plotted. The de-meaned and normalized series
xn
is returned.
First, the periodic mean is computed using the method of permest
. If at time t
there is a missing value in the data, it is ignored
in the computation of periodic standard deviation. For any season (t mod T)
where all the data are missing, the periodic standard
deviation is set to "Missing"
and in the output vector xn
all the values whose times are congruent with (t mod T)
will be set to "Missing"
.
persigest(x, T_t, alpha, missval, datastr,...)
persigest(x, T_t, alpha, missval, datastr,...)
x |
input time series. |
T_t |
period of the computed standard deviation. |
alpha |
|
missval |
notation for missing values. |
datastr |
string name of data for printing. |
... |
other arguments used in the plot: |
The series may contain missing values (we suggest using NaN
)
and the length of the series may not be
an integer multiple of the period. The program returns and plots the
periodic standard deviations with 1-alpha
confidence
intervals based on all non-missing values present for each particular
season.
The p-value for Barttlet's test for homogenity of variance is also computed.
Rejection of homogeneity
(based on the
pspv
value) indicates a properly periodic variance,
but leaves open whether or
not series is simply the result of a stationary process subjected
to amplitude-scale modulation. To
resolve this for some
need to be estimated.
procedure returns:
pstd |
periodic standard deviations values. |
lower , upper
|
bounds of the confidence intervals. |
xn |
series after removing periodic mean and divided by standard deviations |
pspv |
p-value for Bartlett's test for the homogeneity of variance. |
Harry Hurd
Hurd, H. L., Miamee, A. G., (2007), Periodically Correlated Random Sequences:
Spectral Theory and Practice, Wiley InterScience.
data(arosa) dev.set(which=1) persigest(t(arosa),12, 0.05, NaN,'arosa')
data(arosa) dev.set(which=1) persigest(t(arosa),12, 0.05, NaN,'arosa')
Assuming known T
, procedure perYW
implements Yule-Walker
estimation method for a periodic autoregressive PAR(p) model.
Order of autoregression p
, which could be specified using sample
periodic PACF, is constant
for all seasons. For input time series x
, matrix of parameters
phi
and vector of parameters
del
are computed.
perYW(x, T_t, p, missval)
perYW(x, T_t, p, missval)
x |
input time series. |
T_t |
period of PC-T structure (assumed constant over time). |
p |
order of the autoregression. |
missval |
notation for missing values. |
For fixed T
, this procedure implements a periodic version of the
Yule-Walker algorithm.
The algorithm is based on solving for the best coefficients of
LS prediction of in terms of
.
Sample autocorrelations are used in place
of population autocorrelations in the expressions of the best coefficients.
estimated parameters of PAR(p) model:
phi |
matrix of coefficients for autoregressive part. |
del |
vector of noise weights (consider them variances of the shocks). |
Harry Hurd
Brockwell, P. J., Davis, R. A. (1991), Time Series: Theory and Methods, 2nd Ed., Springer: New York.
Vecchia, A., (1985), Maximum Likelihood Estimation for Periodic Autoregressive Moving Average Models, Technometrics, v. 27, pp.375-384.
predictperYW
, loglikef
, parmaf
data(volumes) perYW(volumes,24,2,NaN)
data(volumes) perYW(volumes,24,2,NaN)
The periodogram is a classical tool
based on the sample Fourier transform
for finding periodic components in a time series.
The procedure pgram
computes and plots an average
of periodograms where
np=floor(length(x)/fftlen)
where the
input parameter fftlen
is the length of the FFT; to get just
1 FFT of length fftlen
, use x(1:fftlen)
in place of x
. To get a
significance of high periodogram peaks, the procedure tests,
at each frequency, the value of the averaged periodogram against
the average of 2*halflen
neighboring cells (halflen
on each side),
and averaged over the periodograms; the neighboring cell average
is called the background. Significance of the ratio of center
frequency average to the background average is computed from the
F distribution.
pgram(x, fftlen,...)
pgram(x, fftlen,...)
x |
input time series, missing values denoted by NaNs will be
replaced in |
fftlen |
length of FFT which will be used. In |
... |
other arguments that are connected with periodogram plot: |
When we assume that period T_t
of PC-T structure is unknown,
function pgram
enables us to find
candidate for the period length assuming the period of
the second order structure is the same as the period of
the first order structure (IE, in the series itself).
For any FFT index (say where a strong peak occurs)
corresponds to the number of cycles in the FFT window,
so the period can be easily computed as
T_t = fftlen/j
.
Harry Hurd
Box, G. E. P., Jenkins, G. M., Reinsel, G. (1994), Time Series Analysis, 3rd Ed., Prentice-Hall,
Englewood Cliffs, NJ.
Hurd, H. L., Miamee, A. G., (2007), Periodically Correlated Random Sequences:
Spectral Theory and Practice, Wiley InterScience.
data(volumes) dev.set(which=1) pgram(t(volumes),length(volumes),datastr='volumes')
data(volumes) dev.set(which=1) pgram(t(volumes),length(volumes),datastr='volumes')
Procedure predictperYW
provideds the LMS forecast
of a PAR(p) series. The Yule-Walker method is first use to
estimate the LMS prediction coefficients using all the
observed data in x
.
Additionally, procedure predseries
plots the predicted values of the series with real future
values of the series (provided that such real data is
available).
predictperYW(x, T_t, p, missval, start,...) predseries(real, x, T_t, p, start,...)
predictperYW(x, T_t, p, missval, start,...) predseries(real, x, T_t, p, start,...)
x |
input time series. |
T_t |
period of PC-T structure. |
p |
order of autoregression, it is assumed constant over time. |
missval |
notation for missing values. |
start |
index of forecast value of the series; there are two possible scenarios: |
real |
the real future values of |
... |
other arguments that will be connected with plot: |
procedure predictperYW
for start<length(x)
plots values of x[start:end]
and xp[start:end]
, where xp
are predicted values; for
start>length(x)
function returns and plots two series:
x |
input series together with predicted values added. |
new |
predicted part of the series only. |
Procedure predseries
plots predicted and real values of the series on the same plot.
Wioletta Wojtowicz
Box, G. E. P., Jenkins, G. M., Reinsel, G. (1994), Time Series Analysis, 3rd Ed., Prentice-Hall,
Englewood Cliffs, NJ.
Brockwell, P. J., Davis, R. A. (1991), Time Series: Theory and Methods, 2nd Ed., Springer: New York.
Gladyshev, E. G., (1961), Periodically Correlated Random Sequences, Sov. Math., 2, 385-388.
data(volumes) permest_out<-permest(t(volumes),24, 0.05, NaN,'volumes', pp=0) xd=permest_out$xd dev.set(which=1) predictperYW(xd,24,2,NaN,956,end=980) dev.set(which=1) predictperYW(xd[1:980],24,2,NaN,1004) data(volumes.sep) dev.set(which=1) realdata=c(volumes,volumes.sep) predseries(realdata,t(volumes[1:980]),24,2,1004)
data(volumes) permest_out<-permest(t(volumes),24, 0.05, NaN,'volumes', pp=0) xd=permest_out$xd dev.set(which=1) predictperYW(xd,24,2,NaN,956,end=980) dev.set(which=1) predictperYW(xd[1:980],24,2,NaN,1004) data(volumes.sep) dev.set(which=1) realdata=c(volumes,volumes.sep) predseries(realdata,t(volumes[1:980]),24,2,1004)
Procedure R_w_ma
computes the covariance matrix of the moving average
part of a PARMA sequence.
This is used in maximum likelihood estimation in conjunction with
the Ansley transformation method of computing the likelihood
of the sample conditioned on the firt m = max(p; q)
samples being ignored (or set to null); see Ansley or Brockwell and Davis for
background on the procedure. The method avoids the cumbersome calculation of
full covariance matrix.
R_w_ma(theta, nstart, nlen)
R_w_ma(theta, nstart, nlen)
theta |
matrix of size |
nstart |
starting time, for conditional likelihood in PARMA set to |
nlen |
size of the covariance matrix. |
Procedure R_w_ma
implements calculation of covariance matrix of size nlen-p
from the parameters theta
and phi
of PARMA sequence.
The result is returned as two vectors, first containing non-zero
elements of covariance matrix and the second containing indexes of this parameters.
Using these vectors covariance matrix can be easily reconstructed.
procedure returns covariance matrix in sparse format as following:
R |
vector of non-zero elements of covariance matrix. |
rindex |
vector of indexes of non-zero elements. |
Harry Hurd
Ansley, (1979), An algorithm for the exact likelihood of a mixed autregressive moving average process, Biometrika, v.66, pp.59-65.
Brockwell, P. J., Davis, R. A. (1991), Time Series: Theory and Methods, 2nd Ed., Springer: New York.
T=12 nlen=480 p=2 a=matrix(0,T,p) q=1 b=matrix(0,T,q) a[1,1]=.8 a[2,1]=.3 phia<-ab2phth(a) phi0=phia$phi phi0=as.matrix(phi0) b[1,1]=-.7 b[2,1]=-.6 thetab<-ab2phth(b) theta0=thetab$phi theta0=as.matrix(theta0) del0=matrix(1,T,1) R_w_ma(cbind(del0,theta0),p+1,T)
T=12 nlen=480 p=2 a=matrix(0,T,p) q=1 b=matrix(0,T,q) a[1,1]=.8 a[2,1]=.3 phia<-ab2phth(a) phi0=phia$phi phi0=as.matrix(phi0) b[1,1]=-.7 b[2,1]=-.6 thetab<-ab2phth(b) theta0=thetab$phi theta0=as.matrix(theta0) del0=matrix(1,T,1) R_w_ma(cbind(del0,theta0),p+1,T)
The magnitude of squared coherence is computed in a specified square set of
and using a specified smoothing window. The perception of this empirical spectral coherence is aided
by plotting the coherence values only at points where thereshold is exceeded. For identification/discovery of
PC structure, the sample periodic mean should be first subtracted from the series because a periodic mean itself has
PC structure that can dominate and confound the perception of the second order PC structure.
scoh(x, m, win,...)
scoh(x, m, win,...)
x |
input time series. |
m |
length of the smoothing window. |
win |
vector of smoothing weights, they should be non-negative. |
... |
other arguments that will be connected with squared coherence statistic plot: |
To ensure that periodic structure seen in the spectral coherence image is not a consequence
of an additive periodic mean, it is recommended that the permest
function is first used to remove the periodic mean.
The program returns plot of squared coherence statistic values, that exceed threshold.
Harry Hurd
Hurd, H. L., Gerr, N. L., (1991), Graphical Methods for Determining
the Presence of Periodic Correlation in Time Series, J.
Time Series Anal., (12), pp. 337-350(1991).
Hurd, H. L., Miamee, A. G., (2007), Periodically Correlated Random Sequences:
Spectral Theory and Practice, Wiley InterScience.
## Do not run ## It could take a few seconds data(volumes) m=16 win=matrix(1/m,1,m) dev.set(which=1) scoh(t(volumes),m,win,datastr='volumes')
## Do not run ## It could take a few seconds data(volumes) m=16 win=matrix(1/m,1,m) dev.set(which=1) scoh(t(volumes),m,win,datastr='volumes')
One-dimensional discrete time series, which contains 984 real-valued observations of volumes of energy traded on the Nord Pool Spot Exchange from July 6th to August 31st 2010. Analysed series contains the hourly records only from weekdays from the considered period.
data(volumes)
data(volumes)
The format is: Time-Series [1:984] from 1 to 984: 24888 24316 23755 23354 23290 ...
Data were found on http://www.npspot.com ( Downloads -> Historical market data )
selecting Elspot volumes
and hourly
resolution to download file Elspot\_volumes\_2010\_hourly.xls.
data(volumes) message(volumes)
data(volumes) message(volumes)
One-dimenssional discrete time series, which conatins 48 real-valued
observations of volumes of energy traded on the Nord Pool Spot Exchange.
These are omitted before the last two days of
volumes
data and are used to compare the predicted values
of the series volumes
with real values in volumes.sep
.
data(volumes.sep)
data(volumes.sep)
The format is: Time-Series [1:48] from 1 to 48: 25281 24576 24306 24266 24515 ...
Data were found on http://www.npspot.com ( Downloads -> Historical market data )
selecting Elspot volumes
and hourly
resolution to download file Elspot\_volumes\_2010\_hourly.xls.
data(volumes.sep) message(volumes.sep)
data(volumes.sep) message(volumes.sep)