Package 'LongMemoryTS'

Title: Long Memory Time Series
Description: Long Memory Time Series is a collection of functions for estimation, simulation and testing of long memory processes, spurious long memory processes and fractionally cointegrated systems.
Authors: Christian Leschinski [aut, cre], Michelle Voges [ctb], Kai Wenger [ctb]
Maintainer: Christian Leschinski <[email protected]>
License: GPL-2
Version: 0.1.0
Built: 2024-11-03 06:34:30 UTC
Source: CRAN

Help Index


Simulation of Autoregressive Random Level Shift processes.

Description

Simulation of a AR-RLS process as discussed in and Xu and Perron (2014).

Usage

ARRLS.sim(T, phi, sig.shifts, prob, sig.noise = 0, const = 0,
  trend = 0, burnin = 100)

Arguments

T

length of the desired series.

phi

autoregressive parameter that determines the persistence of the shifts. For phi=1 the process is a "stationary RLS" and for phi=0 the process is a non stationary RLS.

sig.shifts

standard deviation of the shifts.

prob

shift probability. For rare shifts p*/T, where p* is the expected number of shifts in the sample.

sig.noise

standard deviation of the noise component. Default is sig.noise=0.

const

mean of the process. Default is const=0.

trend

trend of the process. Default is trend=0.

burnin

length of the burnin period used. Default is burnin=100.

Details

add details here

Author(s)

Christian Leschinski

References

Xu, J. and Perron, P. (2014): Forecasting return volatility: Level shifts with varying jump probability and mean reversion. International Journal of Forecasting, 30, pp. 449-463.

Examples

ts.plot(ARRLS.sim(T=500,phi=0.5, sig.shift=1, prob=0.05), ylab=expression(X[t]))

Cross periodogram of vector valued time series X and Y

Description

Calculates the cross periodogram of the vector valued time series X and Y.

Usage

cross.Peri(X, Y)

Arguments

X

data matrix.

Y

data matrix.

Examples

T<-500
d<-c(0.4, 0.2, 0.3)
data<-FI.sim(T, q=3, rho=0, d=d)
X<-data[,1:2]
Y<-data[,3]
cper<-cross.Peri(X, Y)
pmax<-max(Re(cper),Im(cper))
pmin<-min(Re(cper),Im(cper))
plot(Re(cper[1,,]), type="h", ylim=c(pmin,pmax))
lines(Im(cper[1,,]), col=2)
plot(Re(cper[2,,]), type="h", ylim=c(pmin,pmax))
lines(Im(cper[2,,]), col=2)

Helper function that returns AR-representation of FI(d)-process.

Description

returns the first n coefficients in the AR-infinity representation of an FI(d) process

Usage

ddiffw(n, d)

Arguments

n

number of coefficients to be returned

d

memory parameter


Exact local Whittle estimator of the fractional difference parameter d for stationary and non-stationary long memory.

Description

ELW implements the exact local Whittle estimator of Shimotsu and Phillips (2005) that is consistent and asymptotically normal as long as the optimization range is less than 9/2, so that it is possible to estimate the memory of stationary as well as non-stationary processes.

Usage

ELW(data, m, mean.est = c("mean", "init", "weighted", "none"))

Arguments

data

data vector of length T.

m

bandwith parameter specifying the number of Fourier frequencies. used for the estimation usually floor(1+T^delta), where 0<delta<1.

mean.est

specifies the form of mean correction. One of c("mean","init","weighted","none").

Author(s)

Christian Leschinski

References

Shimotsu, K. and Phillips, P. C. B. (2005): Exact Local Whittle Estimation Of Fractional Integration. The Annals of Statistics, Vol. 33, No. 4, pp. 1890 - 1933

Examples

library(fracdiff)
T<-1000
d<-0.8
series<-cumsum(fracdiff.sim(T,d=(d-1))$series)
ts.plot(series)
ELW(series, m=floor(1+T^0.7))$d

Two-Step Exact local Whittle estimator of fractional integration with unknown mean and time trend.

Description

ELW2S implements the two-step ELW estimator of Shimotsu (2010) that is consistent and asymptotically normal in the range from -1/2 to 2.

Usage

ELW2S(data, m, trend_order = 0, taper = c("Velasco", "HC"))

Arguments

data

data vector of length T.

m

bandwith parameter specifying the number of Fourier frequencies. used for the estimation usually floor(1+T^delta), where 0<delta<1.

trend_order

specifies the form of detrending: 0 for a constant, only, 1 for a linear trend, and so on.

taper

string from c("Velasco","HC") specifying the tapered form of the local Whittle estimator used in the first step.

Author(s)

Christian Leschinski

References

Shimotsu, K. (2010): Exact Local Whittle Estimation Of Fractional Integration with Unknown Mean and Time Trend. Econometric Theory, Vol. 26, pp. 501 - 540.

Examples

library(fracdiff)
T<-1000
d<-0.8
trend<-(1:T)/T
series<-cumsum(fracdiff.sim(T,d=(d-1))$series)
ts.plot(series)
ELW2S(series, m=floor(1+T^0.7), trend_order=0)$d
series2<-series+2*trend
ELW2S(series2, m=floor(1+T^0.7), trend_order=1)$d
series3<-series+2*trend+2*trend^2
ELW2S(series3, m=floor(1+T^0.7), trend_order=2)$d

Empirical cummulative spectral distribution function

Description

Calculates the empirical cummulative spectral distribution function from the cross periodogram of the vector valued time series X and Y.

Usage

F.hat(X, Y, k, l)

Arguments

X

data matrix.

Y

data matrix.

k

integer that determines the order number of the first Fourier frequency used.

l

integer that determines the order number of the last Fourier frequency used.

Examples

T<-500
d<-c(0.4, 0.2, 0.3)

data<-FI.sim(T, q=3, rho=0, d=d)
X<-data[,1:2]
Y<-data[,3]
F.hat(X, Y, 1, floor(T/2))

Fractional Brownian Motion / Bridge of Type I or II.

Description

fBM simulates a fractional Brownian motion / bridge of type I or II.

Usage

fBM(n, d, type = c("I", "II"), bridge = FALSE)

Arguments

n

number of increments in the fractional Brownian motion.

d

memory parameter -0.5<d<0.5. Note that d=H-1/2.

type

either "I" or "II", to define the type of motion.

bridge

either TRUE of FALSE, to specify whether ar fractional Brownian motion or bridge should be returned. Default is FALSE so that the function returns a fractional Brownian motion.

Author(s)

Kai Wenger

References

Marinucci, D., Robinson, P. M. (1999). Alternative forms of fractional Brownian motion. Journal of statistical planning and inference, 80(1-2), 111 - 122.

Davidson, J., Hashimzade, N. (2009). Type I and type II fractional Brownian motions: A reconsideration. Computational statistics & data analysis, 53(6), 2089-2106.

Bardet, J.-M. et al. (2003): Generators of long-range dependent processes: a survey. Theory and applications of long-range dependence, pp. 579 - 623, Birkhauser Boston.

Examples

n<-1000
d<-0.4
set.seed(1234)
motionI<-fBM(n,d, type="I")
set.seed(1234)
motionII<-fBM(n,d, type="II")
ts.plot(motionI, ylim=c(min(c(motionI,motionII)), max(motionI,motionII)))
lines(motionII, col=2)

Rank estimation in fractionally cointegrated systems.

Description

FCI_CH03 Rank estimation in fractionally cointegrated systems by Chen, Hurvich (2003). Returns estimated cointegrating rank.

Usage

FCI_CH03(X, diff_param = 1, m_peri, m)

Arguments

X

vector of length T.

diff_param

integer specifying the order of differentiation in order to ensure stationarity of data, where diff_param-1 are the number of differences. Default is diff_param=1.

m_peri

fixed positive integer for averaging the periodogram, where m_peri>(nbr of series + 3)

m

bandwith parameter specifying the number of Fourier frequencies used for the estimation, usually floor(1+T^delta), where 0<delta<1.

Author(s)

Christian Leschinski

References

Chen, W. W. and Hurvich, C. M. (2003): Semiparametric estimation of multivariate fractional cointegration. Journal of the American Statistical Association, Vol. 98, No. 463, pp. 629 - 642.

Examples

T<-1000
series<-FI.sim(T=T, q=3, rho=0.4, d=c(0.1,0.2,0.4), B=rbind(c(1,0,-1),c(0,1,-1),c(0,0,1)))
FCI_CH03(series,diff_param=1, m_peri=25, m=floor(1+T^0.65))

Residual-based test for fractional cointegration (Chen, Hurvich (2006))

Description

FCI_CH06 Semiparametric residual-based test for fractional cointegration by Chen, Hurvich (2003). Returns test statistic, critical value and testing decision. Null hypothesis: no fractional cointegration.

Usage

FCI_CH06(X, m_peri, m, alpha = 0.05, diff_param = 1)

Arguments

X

data matrix.

m_peri

fixed positive integer for averaging the periodogram, where m_peri>(nbr of series + 3)

m

bandwith parameter specifying the number of Fourier frequencies used for the estimation, usually floor(1+T^delta), where 0<delta<1.

alpha

desired significance level. Default is alpha=0.05.

diff_param

integer specifying the order of differentiation in order to ensure stationarity of data, where diff_param-1 are the number of differences. Default is diff_param=1 for no differences.

Author(s)

Christian Leschinski

References

Chen, W. W. and Hurvich, C. M. (2006): Semiparametric estimation of fractional cointegrating subspaces. The Annals of Statistics, Vol. 34, No. 6, pp. 2939 - 2979.

Examples

T<-1000
series<-FI.sim(T=T, q=2, rho=0.4, d=c(0.1,0.4), B=rbind(c(1,-1),c(0,1)))
FCI_CH06(series, diff_param=1, m_peri=25, m=floor(T^0.65))
series<-FI.sim(T=T, q=2, rho=0.4, d=c(0.4,0.4))
FCI_CH06(series, diff_param=1, m_peri=25, m=floor(T^0.65))

Test for fractional cointegration (Marmol, Velasco (2004))

Description

FCI_MV04 Semiparametric test for fractional cointegration by Marmol, Velasco (2004). Returns test statistic, critical value and testing decision. Null hypothesis: no fractional cointegration.

Usage

FCI_MV04(X, type = c("none", "const", "trend"), N, m, alpha = 0.05)

Arguments

X

data matrix.

type

string that is either "none", "const", or "trend" and determines the form of linear regression.

N

bandwidth parameter specifying the number of Fourier frequencies used for the beta estimation, usually floor(1+T^delta), where 0<delta<1.

m

bandwith parameter specifying the number of Fourier frequencies used for the memory parameter estimation, usually floor(1+T^delta), where 0<delta<1.

alpha

desired significance level. Default is alpha=0.05.

Author(s)

Christian Leschinski, Michelle Voges

References

Marmol, F. and Velasco, C. (2004): Consistent testing of cointegrating relationships. Econometrica, Vol. 72, No. 6, pp. 1809 - 1844.

Examples

T<-500
series<-FI.sim(T=T, q=2, rho=0.1, d=c(0.6,1), B=rbind(c(1,-1),c(0,1)))
FCI_MV04(series, type="const", N=floor(T^(0.75)), m=floor(T^(2/3)))
series<-FI.sim(T=T, q=2, rho=0.1, d=c(0.8,0.8))
FCI_MV04(series, type="const", N=floor(T^(0.75)), m=floor(T^(2/3)))

Nonparametric test for fractional cointegration (Nielsen (2010))

Description

FCI_CH06 Nonparametric test and rank estimation for fractional cointegration by Nielson (2010). Returns either test statistic, critical value and testing decision (null hypothesis: no fractional cointegration) or the estimated cointegrating rank.

Usage

FCI_N10(X, d1 = 0.1, m, mean_correct = c("mean", "init", "weighted",
  "none"), type = c("test", "rank"), alpha = 0.05)

Arguments

X

data matrix.

d1

fixed order of integration, default is d1=0.1 as recommended by Nielsen (2010), no critical values for other choices available.

m

bandwith parameter specifying the number of Fourier frequencies used for the memory estimation required for the asymptotic distribution, usually floor(1+T^delta), where 0<delta<1.

mean_correct

specifies the form of mean correction in the memory estimation.

type

string that determines whether the test or the rank estimation procedure is applied.

alpha

desired significance level. Default is alpha=0.05.

Author(s)

Christian Leschinski, Michelle Voges

References

Nielsen, M. O. (2010): Nonparametric cointegration analysis of fractional systems with unknown integration orders. Journal of Econometrics, Vol. 155, No. 2, pp. 170 - 187.

Examples

T<-1000
series<-FI.sim(T=T, q=2, rho=0.4, d=c(0.1,0.9), B=rbind(c(1,-1),c(0,1)))
FCI_N10(series, m=floor(T^0.75), type="test")
series<-FI.sim(T=T, q=2, rho=0.4, d=c(0.9,0.9))
FCI_N10(series, m=floor(T^0.75), type="test")
series<-FI.sim(T=T, q=3, rho=0.4, d=c(0.2,0.2,1), B=rbind(c(1,-0.5,-0.3),c(0,1,-0.4),c(0,0,1)))
FCI_N10(series,m=floor(T^0.75),type="rank")

Rank estimation in fractionally cointegrated systems by Nielsen, Shimotsu (2007).

Description

FCI_NS07 Rank estimation in fractionally cointegrated systems by Nielsen, Shimotsu (2007). Returns estimated cointegrating rank, r=0,...,dim-1.

Usage

FCI_NS07(X, m, m1, mean_correct = c("mean", "init", "weighted", "none"),
  v_n = m^(-0.3))

Arguments

X

data matrix.

m

bandwith parameter specifying the number of Fourier frequencies used for the estimation of G, usually floor(1+T^delta), where 0<delta<1 and m1>m.

m1

bandwith parameter specifying the number of Fourier frequencies used for the memory estimation , usually floor(1+T^delta1), where 0<delta1<1 and m1>m.

mean_correct

specifies the form of mean correction in the memory estimation.

v_n

bandwidth parameter. Nielsen and Shimotsu (2007) use m^(-0.3) in their simulation studies, which is the default value. m^(-b) mit 0<b<0.5 can be used.

Author(s)

Christian Leschinski, Michelle Voges

References

Nielsen, M. 0. and Shimotsu, K. (2007): Determining the cointegrating rank in nonstationary fractional systems by the exact local Whittle approach. Journal of Econometrics, Vol. 141, No. 2, pp. 574 - 596.

Examples

T<-1000
series<-FI.sim(T=T, q=2, rho=0.4, d=c(0.1,0.4), B=rbind(c(1,-1),c(0,1)))
FCI_NS07(series, m1=floor(1+T^0.75), m=floor(1+T^0.65))
series<-FI.sim(T=T, q=2, rho=0.4, d=c(0.9,0.9))
FCI_NS07(series, m1=floor(1+T^0.75), m=floor(1+T^0.65))

Hausman-type test for fractional cointegration (Robinson (2008))

Description

FCI_R08 Semiparametric Hausmann-type test for fractional cointegration by Robinson (2008). Returns test statistic, critical value, testing decision and type. Null hypothesis: no fractional cointegration.

Usage

FCI_R08(X, m, type = c("", "*", "**"), alpha = 0.05, a.vec = NULL)

Arguments

X

data matrix.

m

bandwith parameter specifying the number of Fourier frequencies used for the estimation, usually floor(1+T^delta), where 0<delta<1.

type

determines the implementation of the test statistic: "" - real-valued, "*" - complex-valued, or "**" - complex-valued allowing for different memory parameters.

alpha

desired significance level. Default is alpha=0.05.

a.vec

weighting scheme for averaging univariate memory estimates, default is simple arithmetic mean.

Author(s)

Christian Leschinski, Michelle Voges

References

Robinson, P. (2008): Diagnostic testing for cointegration. Journal of Econometrics, Vol. 143, No. 1, pp. 206 - 225.

Examples

T<-1000
series<-FI.sim(T=T, q=2, rho=0.9, d=c(0.1,0.4), B=rbind(c(1,-1),c(0,1)))
FCI_R08(series, m=floor(T^0.75), type="*")
series<-FI.sim(T=T, q=2, rho=0.9, d=c(0.4,0.4))
FCI_R08(series,  m=floor(T^0.75), type="*")

Frequency-domain test for fractional cointegration (Souza, Reise, Franco, Bondon (2018))

Description

FCI_CH06 Semiparametric frequency-domain test for fractional cointegration by Souza, Reise, Franco, Bondon (2018). Returns test statistic, critical value, testing decision and estimate of the cointegrating strength. Null hypothesis: no fractional cointegration.

Usage

FCI_SRFB18(X, d, m, r, alpha = 0.05)

Arguments

X

bivariate data matrix.

d

known common memory parameter. However, simulations indicate that consistent memory estimation does not invalidate the test.

m

bandwith parameter specifying the number of Fourier frequencies used for the estimation, usually floor(1+T^delta), where 0<delta<1.

r

integer trimming parameter, r>0.

alpha

desired significance level. Default is alpha=0.05.

Author(s)

Michelle Voges

References

Souza, I. V. M., Reisen, V. A., Franco, G. d. C. and Bondon, P. (2018): The estimation and testing of the cointegration order based on the frequency domain. Journal of Business & Economic Statistics, Vol. 36, No. 4, pp. 695 - 704.

Examples

T<-1000
series<-FI.sim(T=T, q=2, rho=0.4, d=c(0.1,0.7), B=rbind(c(1,-1),c(0,1)))
FCI_SRFB18(series, d=0.7, m=floor(T^0.75), r=1)
series<-FI.sim(T=T, q=2, rho=0.4, d=c(0.4,0.4))
FCI_SRFB18(series, d=0.4, m=floor(T^0.75), r=1)

Semiparametric test for fractional cointegration (Wang, Wang, Chan (2015))

Description

FCI_WWC15 Semiparametric implementation of the testing strategy for fractional cointegration by Wang, Wang, Chan (2015). Returns test statistic, critical value and testing decision. Null hypothesis: no fractional cointegration.

Usage

FCI_WWC15(X, m, mean_correct = c("init", "mean", "weighted", "none"),
  alpha = 0.05)

Arguments

X

bivariate data matrix.

m

bandwith parameter specifying the number of Fourier frequencies used for the estimation, usually floor(1+T^delta), where 0<delta<1.

mean_correct

specifies the form of mean correction in the memory estimation.

alpha

desired significance level. Default is alpha=0.05.

Author(s)

Christian Leschinski, Michelle Voges

References

Wang, B., Wang, M. and Chan, N. H. (2015): Residual-based test for fractional cointegration. Economics Letters, Vol. 126, pp. 43 - 46.

Hualde, J. (2013): A simple test for the equality of integration orders. Economics Letters, Vol. 119, No. 3, pp. 233 - 237.

Examples

T<-1000
series<-FI.sim(T=T, q=2, rho=0.4, d=c(0.1,0.8), B=rbind(c(1,1),c(0,1)))
FCI_WWC15(series,  m=floor(1+T^0.65))
series<-FI.sim(T=T, q=2, rho=0.4, d=c(0.8,0.8))
FCI_WWC15(series,  m=floor(1+T^0.65))

Rank estimation in fractionally cointegrated systems (Zhang, Robinson, Yao (2018))

Description

FCI_CH06 SRank estimation in fractionally cointegrated systems (Zhang, Robinson, Yao (2018)). Returns estimated cointegrating rank, r=0,...,dim-1.

Usage

FCI_ZRY18(X, lag_max, lag_max2 = 20, c0 = 0.3)

Arguments

X

data matrix.

lag_max

number of lags in autocovariance matrix of data for eigenvector estimation.

lag_max2

number of residual autocorrelations that are averaged, default is m=20 as recommended by Zhang, Robinson, Yao (2018).

c0

threshold to compare averaged residual autocorrelation to, default is c0=0.3 as recommended by Zhang, Robinson, Yao (2018).

Author(s)

Michelle Voges

References

Zhang, R., Robinson, P. and Yao, Q. (2018): Identifying cointegration by eigenanalysis. Journal of the American Statistical Association (forthcoming).

Examples

T<-1000
series<-FI.sim(T=T, q=3, rho=0.4, d=c(0.2,0.2,1), B=rbind(c(1,0,-1),c(0,1,-1),c(0,0,1)))
FCI_ZRY18(series, lag_max=5, lag_max2=20, c0=0.3) 
series<-FI.sim(T=T, q=3, rho=0.4, d=c(1,1,1))
FCI_ZRY18(series, lag_max=5, lag_max2=20, c0=0.3)

Fast fractional differencing procedure of Jensen and Nielsen (2014).

Description

Takes the d-th difference of the series.

Usage

fdiff(x, d)

Arguments

x

series to be differenced

d

memory parameter indicating order of the fractional difference.

Details

This code was first published on the university webpage of Morten Nielsen and is redistributed here with the author's permission.

Author(s)

Jensen, A. N. and Nielsen, M. O.

References

Jensen, A. N. and Nielsen, M. O. (2014): A fast fractional difference algorithm, Journal of Time Series Analysis 35(5), pp. 428-436.

Examples

acf(fdiff(x=rnorm(500), d=0.4))

Narrow band estimation of the cointegrating vector.

Description

Semiparametric estimator for the cointegrating vector as suggested by Robinson (1994) and discussed by Robinson and Marinucci (2003) and Christensen and Nielsen (2006), among others.

Usage

FDLS(X, Y, m)

Arguments

X

data matrix.

Y

data matrix.

m

bandwith parameter specifying the number of Fourier frequencies. used for the estimation of d, usually floor(1+T^delta), where 0<delta<1.

Details

add details here. Assumes that there is no long-run coherence between the errors and the regressors. Consistency and Normality, Stationarity, assumptions,...

References

Christensen, B. J. and Nielsen, M. O. (2006): Asymptotic normality of narrow-band least squares in the stationary fractional cointegration model and volatility forecasting. Journal of Econometrics, 133, pp. 343-371.

Robinson, P. M., (1994): Semiparametric analysis of long-memory time series. Annals of Statistics, 22, pp. 515-539.

Robinson, P. M. and Marinucci, D. (2003): Semiparametric frequency domain analysis of fractional cointegration. In: Robinson, P. M. (Ed.), Time Series with Long Memory, Oxford University Press, Oxford, pp. 334-373.

Examples

T<-500
d<-0.4
beta<-1

data<-FI.sim(T, q=2, rho=0, d=c(d,0))
xt<-data[,1]
et<-data[,2]
yt<-beta*xt+et
FDLS(xt,yt,m=floor(1+T^0.4))

data<-FI.sim(T, q=2, rho=0.8, d=c(d,0))
xt<-data[,1]
et<-data[,2]
yt<-beta*xt+et
FDLS(xt,yt,m=floor(1+T^0.4))

Simulate multivariate fractional white noise.

Description

FI.sim Simulates a

Usage

FI.sim(T, q, rho, d, B = diag(q), var = 1, burnin = 250)

Arguments

T

positive integer determining the length of the simulated series.

q

positive integer determining the dimension of the simulated series.

rho

real value between 0 and 1 that determines correlation between the innovations.

d

vector of memory parameters with length q.

B

qxq matrix specifying cointegrating relations. By default diag(q).

var

positive real value that determines the variance of the innovations. Default value is var=1.

burnin

positive integer determining the length of the burnin period. Default is burnin=250.

Examples

T=1000
series<-FI.sim(T=T,q=2,rho=0.7,d=c(0.4,0.4))
ts.plot(series, col=1:2)
cor(series)

series<-FI.sim(T=T,q=2,rho=0,d=c(0.1,0.4), B=rbind(c(1,-1),c(0,1)))
ts.plot(series, col=1:2)

Fully Modified Narrow Band Least Squares (FMNBLS) estimation of the cointegrating vector.

Description

Semiparametric estimator for the cointegrating vector as suggested by Nielsen and Frederiksen (2011). Refines the FDLS estimator by allowing for long run coherence between the regressors and the errors.

Usage

FMNBLS(X, Y, m0, m1, m2, m3, method = c("local.W", "Hou.Perron", "ELW"))

Arguments

X

data matrix.

Y

data matrix.

m0

bandwidth parameter.

m1

bandwidth parameter.

m2

bandwidth parameter.

m3

bandwidth parameter.

method

one from method=c("local.W","Hou.Perron","ELW"), to determine which semiparametric long memory estimator is to be used.

Details

add details here. Especially on the selection of all these bandwidth parameters. carefull: it is not clear, whether HP an be used here.

References

Nielsen and Frederiksen (2011): Fully modified narrow-band least squares estimation of weak fractional cointegration. The Econometrics Journal, 14, pp. 77-120.

See Also

FDLS, local.W, Hou.Perron, ELW

Examples

T<-500
d<-0.4
beta<-1

m0<-m3<-floor(T^0.4)                        
m1<-floor(T^0.6)                       
m2<-floor(T^0.8)

data<-FI.sim(T, q=2, rho=0.8, d=c(d,0))
xt<-data[,1]
et<-data[,2]
yt<-beta*xt+et
FDLS(xt,yt,m=m0)
FMNBLS(xt,yt,m0=m0, m1=m1, m2=m2, m3=m3)

Estimation of G matrix for multivariate long memory processes.

Description

G.hat Estimates the matrix G of a multivariate long memory process based on an estimate of the vector of memory parameters. The assumed spectral density is that of Shimotsu (2007).

Usage

G.hat(X, d, m)

Arguments

X

data matrix with T observations of q-dimensional process.

d

q-dimensional data vector.

m

bandwith parameter specifying the number of Fourier frequencies. used for the estimation usually floor(1+T^delta), where 0<delta<1.

References

Shimotsu, K. (2007): Gaussian semiparametric estimation of multivariate fractionally integrated processes. Journal of Econometrics, Vol. 137, No. 2, pp. 277 - 310.

Examples

T<-500
d1<-0.4
d2<-0.2
data<-FI.sim(T, q=2, rho=0, d=c(d1,d2))
G.hat(X=data, d=c(d1,d2), m=floor(1+T^0.6))
#diagonal elements should equal 1/(2*pi)

GPH estimator of fractional difference parameter d.

Description

gph log-periodogram estimator of Geweke and Porter-Hudak (1983) (GPH) and Robinson (1995a) for memory parameter d.

Usage

gph(X, m, l = 1)

Arguments

X

vector of length T.

m

bandwith parameter specifying the number of Fourier frequencies. used for the estimation usually floor(1+T^delta), where 0<delta<1.

l

trimming parameter that determines with which Fourier frequency to start. Default value is l=1.

Details

add details here.

References

Robinson, P. M. (1995): Log-periodogram regression of time series with long range dependence. The Annals of Statistics, Vol. 23, No. 5, pp. 1048 - 1072.

Geweke, J. and Porter-Hudak, S. (1983): The estimation and application of long memory time series models. Journal of Time Series Analysis, 4, 221-238.

Examples

library(fracdiff)
T<-500
m<-floor(1+T^0.8)
d=0.4
series<-fracdiff.sim(n=T, d=d)$series
gph(X=series,m=m)

Multivariate local Whittle estimation of long memory parameters.

Description

GSE Estimates the memory parameter of a vector valued long memory process.

Usage

GSE(X, m = m, l = 1)

Arguments

X

data matrix with T observations of q-dimensional process.

m

bandwith parameter specifying the number of Fourier frequencies used for the estimation. Usually floor(1+T^delta), where 0<delta<1.

l

integer that specifies the number of Fourier frequencies (l-1) that are trimmed.

References

Shimotsu, K. (2007): Gaussian semiparametric estimation of multivariate fractionally integrated processes. Journal of Econometrics, Vol. 137, No. 2, pp. 277 - 310.

Examples

T<-500
d1<-0.4
d2<-0.2
data<-FI.sim(T, q=2, rho=0.5, d=c(d1,d2))
ts.plot(data, col=1:2)
GSE(data, m=floor(1+T^0.7))

Multivariate local Whittle estimation of long memory parameters and cointegrating vector.

Description

GSE_coint is an extended version of GSE that allows the joint estimation of the memory parameters and the cointegration vector for a vector valued process.

Usage

GSE_coint(X, m = m, elements, l = 1)

Arguments

X

data matrix with T observations of q-dimensional process.

m

bandwith parameter specifying the number of Fourier frequencies used for the estimation. Usually floor(1+T^delta), where 0<delta<1.

elements

vector specifying which elements of the observation vector are cointegrated.

l

integer that specifies the number of Fourier frequencies (l-1) that are trimmed.

Examples

#
# Cointegration:
#
T<-500
m<-floor(T^0.75)
series<-FI.sim(T=T,q=2,rho=0,d=c(0.1,0.4), B=rbind(c(1,-1),c(0,1)))
ts.plot(series, col=1:2)
GSE_coint(X=series,m=m, elements=c(1,2))

Modified local Whittle estimator of fractional difference parameter d.

Description

Hou.Perron Modified semiparametric local Whittle estimator of Hou and Perron (2014). Estimates memory parameter robust to low frequency contaminations.

Usage

Hou.Perron(data, m)

Arguments

data

data vector of length T.

m

bandwith parameter specifying the number of Fourier frequencies used for the estimation usually floor(1+T^delta), where 0<delta<1.

Details

add details here

Author(s)

Christian Hendrik Leschinski

References

Hou, J., Perron, P. (2014): Modified local Whittle estimator for long memory processes in the presence of low frequency (and other) contaminations. Journal of Econometrics, Vol. 182, No. 2, pp. 309 - 328.

Examples

library(fracdiff)
T<-1000
d<-0
mean<-c(rep(0,T/2),rep(2,T/2))
FI<-fracdiff.sim(n=T, d=d)$series
series<-mean+FI
ts.plot(series)
lines(mean, col=2)
local.W(series, m=floor(1+T^0.65))
Hou.Perron(series, m=floor(1+T^0.65))

Log-likelihood function of a VARFIMA(1,1) in final equations form.

Description

ll.VARFIMA returns the value of the log-likelihood function for a given sample and parameter vector.

Usage

ll.VARFIMA(theta, data, q, approx = 100, pre.sample = matrix(0, approx,
  q), rep = FALSE)

Arguments

theta

parameter vector.

data

data matrix with T observations of q-dimensional process.

q

dimension of the process.

approx

order of the AR-approximation that is supposed to be used. Default is approx=100.

pre.sample

if likelihood is conditioned on previous observations pre.sample is an additional sample matrix.

rep

determines whether the parameter vector is printed.

References

Lutkepohl, H. (2007): New introduction to multiple time series analysis. Springer.


Local Whittle estimator of fractional difference parameter d.

Description

local.W Semiparametric local Whittle estimator for memory parameter d following Robinson (1995). Returns estimate and asymptotic standard error.

Usage

local.W(data, m, int = c(-0.5, 2.5), taper = c("none", "Velasco",
  "HC"), diff_param = 1, l = 1)

Arguments

data

vector of length T.

m

bandwith parameter specifying the number of Fourier frequencies. used for the estimation usually floor(1+T^delta), where 0<delta<1.

int

admissible range for d. Restricts the interval of the numerical optimization.

taper

string that is either "none", "Velasco", or "HC" and determines whether the standard local Whittle estimator of Robinson (1995), the tapered version of Velasco (1999), or the differenced and tapered estimator of Hurvich and Chen (2000) is used.

diff_param

integer specifying the order of differentiation for the estimator of Hurvich and Chen (2000). Default is diff_param=1.

l

integer that determines how many frequencies (l-1) are trimmed out if taper="none" is selected. Default is l=1.

References

Robinson, P. M. (1995): Gaussian Semiparametric Estimation of Long Range Dependence. The Annals of Statistics, Vol. 23, No. 5, pp. 1630 - 1661.

Velasco, C. (1999): Gaussian Semiparametric Estimation for Non-Stationary Time Series. Journal of Time Series Analysis, Vol. 20, No. 1, pp. 87-126.

Hurvich, C. M., and Chen, W. W. (2000): An Efficient Taper for Potentially Overdifferenced Long-Memory Time Series. Journal of Time Series Analysis, Vol. 21, No. 2, pp. 155-180.

Examples

library(fracdiff)
T<-1000
d<-0.4
series<-fracdiff.sim(n=T, d=d)$series
local.W(series,m=floor(1+T^0.65))

LongMemoryTS: Long Memory Time Series

Description

The LongMemoryTS package is a collection of functions for estimation, simulation and testing of long memory processes, spurious long memory processes, and fractionally cointegrated systems.

Author(s)

Christian Hendrik Leschinski <[email protected]>, Michelle Voges, Kai Wenger

References

Bai, J. and Perron, P. (1998): Estimating and Testing Linear Models With Multiple Structural Changes. Econometrica, Vol. 66, No. 1, pp. 47 - 78.

Bai, J. and Perron, P. (2003): Computation and Analysis of Multiple Structural Change Models. Journal of Applied Econometrics, Vol. 18, pp. 1-22.

Bardet, J.-M. et al. (2003): Generators of long-range dependent processes: a survey. Theory and applications of long-range dependence, pp. 579 - 623, Birkhauser Boston.

Chen, W. W. and Hurvich, C. M. (2003): Semiparametric estimation of multivariate fractional cointegration. Journal of the American Statistical Association, Vol. 98, No. 463, pp. 629 - 642.

Chen, W. W. and Hurvich, C. M. (2006): Semiparametric estimation of fractional cointegrating subspaces. The Annals of Statistics, Vol. 34, No. 6, pp. 2939 - 2979.

Christensen, B. J. and Nielsen, M. O. (2006): Asymptotic normality of narrow-band least squares in the stationary fractional cointegration model and volatility forecasting. Journal of Econometrics, 133, pp. 343-371.

Davidson, J., Hashimzade, N. (2009). Type I and type II fractional Brownian motions: A reconsideration. Computational Statistics & Data Analysis, No. 53, Vol. 6, pp. 2089 - 2106.

Frederiksen, P., Nielsen, F. S., and Nielsen, M. O. (2012): Local polynomial Whittle estimation of perturbed fractional processes. Journal of Econometrics, Vol. 167, No.2, pp. 426-447.

Geweke, J. and Porter-Hudak, S. (1983): The estimation and application of long memory time series models. Journal of Time Series Analysis, 4, 221-238.

Hou, J., Perron, P. (2014): Modified local Whittle estimator for long memory processes in the presence of low frequency (and other) contaminations. Journal of Econometrics, Vol. 182, No. 2, pp. 309 - 328.

Hualde, J. (2013): A simple test for the equality of integration orders. Economics Letters, Vol. 119, No. 3, pp. 233 - 237.

Hurvich, C. M., and Chen, W. W. (2000): An Efficient Taper for Potentially Overdifferenced Long-Memory Time Series. Journal of Time Series Analysis, Vol. 21, No. 2, pp. 155-180.

Jensen, A. N. and Nielsen, M. O. (2014): A fast fractional difference algorithm. Journal of Time Series Analysis 35(5), pp. 428-436.

Lavielle, M. and Moulines, E. (2000): Least Squares Estimation of an Unknown Number of Shifts in a Time Series. Journal of Time Series Analysis, Vol. 21, No. 1, pp. 33 - 59.

Lutkepohl, H. (2007): New introduction to multiple time series analysis. Springer.

Marinucci, D., Robinson, P. M. (1999). Alternative forms of fractional Brownian motion. Journal of Statistical Planning and Inference, Vol. 80 No. 1-2, pp. 111 - 122.

Marmol, F. and Velasco, C. (2004): Consistent testing of cointegrating relationships. Econometrica, Vol. 72, No. 6, pp. 1809 - 1844.

McCloskey, A. and Perron, P. (2013): Memory parameter estimation in the presence of level shifts and deterministic trends. Econometric Theory, 29, pp. 1196-1237.

Nielsen, M. O. (2010): Nonparametric cointegration analysis of fractional systems with unknown integration orders. Journal of Econometrics, Vol. 155, No. 2, pp. 170 - 187.

Nielsen, M. O. and Frederiksen (2011): Fully modified narrow-band least squares estimation of weak fractional cointegration. The Econometrics Journal, 14, pp. 77-120.

Nielsen, M. O. and Shimotsu, K. (2007): Determining the coinegrating rank in nonstationary fractional systems by the exact local Whittle approach. Journal of Econometrics, 141, pp. 574-59.

Qu, Z. (2011): A Test Against Spurious Long Memory. Journal of Business and Economic Statistics, Vol. 29, No. 3, pp. 423 - 438.

Robinson, P. M., (1994): Semiparametric analysis of long-memory time series. Annals of Statistics, 22, pp. 515-539.

Robinson, P. M. (1995): Log-periodogram regression of time series with long range dependence. The Annals of Statistics, Vol. 23, No. 5, pp. 1048 - 1072.

Robinson, P. M. (1995): Gaussian Semiparametric Estimation of Long Range Dependence. The Annals of Statistics, Vol. 23, No. 5, pp. 1630 - 1661.

Robinson, P. (2008): Diagnostic testing for cointegration. Journal of Econometrics, Vol. 143, No. 1, pp. 206 - 225.

Robinson, P. M. and Marinucci, D. (2003): Semiparametric frequency domain analysis of fractional cointegration. In: Robinson, P. M. (Ed.), Time Series with Long Memory, Oxford University Press, Oxford, pp. 334-373.

Robinson, P. M. and Yajima, Y. (2002): Determination of cointegrating rank in fractional systems. Journal of Econometrics, Vol. 106, No.2, pp. 217-241.

Shimotsu, K. (2007): Gaussian semiparametric estimation of multivariate fractionally integrated processes. Journal of Econometrics, Vol. 137, No. 2, pp. 277 - 310.

Shimotsu, K. (2010): Exact Local Whittle Estimation Of Fractional Integration with Unknown Mean and Time Trend. Econometric Theory, Vol. 26, pp. 501 - 540.

Shimotsu, K. and Phillips, P. C. B. (2005): Exact Local Whittle Estimation Of Fractional Integration. The Annals of Statistics, Vol. 33, No. 4, pp. 1890-1933.

Sibbertsen, P., Leschinski, C. H., Holzhausen, M., (2018): A Multivariate Test Against Spurious Long Memory. Journal of Econometrics, Vol. 203, No. 1, pp. 33 - 49.

Souza, I. V. M., Reisen, V. A., Franco, G. d. C. and Bondon, P. (2018): The estimation and testing of the cointegration order based on the frequency domain. Journal of Business & Economic Statistics, Vol. 36, No. 4, pp. 695 - 704.

Velasco, C. (1999): Gaussian Semiparametric Estimation for Non-Stationary Time Series. Journal of Time Series Analysis, Vol. 20, No. 1, pp. 87-126.

Wang, B., Wang, M. and Chan, N. H. (2015): Residual-based test for fractional cointegration. Economics Letters, Vol. 126, pp. 43 - 46.

Xu, J. and Perron, P. (2014): Forecasting return volatility: Level shifts with varying jump probability and mean reversion. International Journal of Forecasting, 30, pp. 449-463.

Zhang, R., Robinson, P. and Yao, Q. (2018): Identifying cointegration by eigenanalysis. Journal of the American Statistical Association (forthcoming).

See Also

ARRLS.sim, ELW, ELW2S, F.hat, FCI_CH03, FCI_CH06, FCI_MV04, FCI_N10, FCI_NS07, FCI_R08, FCI_SRFB18, FCI_WWC15, FCI_ZRY18, FDLS, FI.sim, FMNBLS, G.hat, GSE, GSE_coint, Hou.Perron, LPWN, MLWS, McC.Perron, Peri, Qu.test, T.rho, T0stat, VARFIMA.est, VARFIMA.sim, W_multi, cross.Peri, ddiffw, fBM, fdiff, gph, ll.VARFIMA, local.W, partition.X, pre.White, rank.est


Local polynomial Whittle plus noise estimator

Description

LPWN calculates the local polynomial Whittle plus noise estimator of Frederiksen et al. (2012).

Usage

LPWN(data, m, R_short = 0, R_noise = 0)

Arguments

data

data vector

m

bandwith parameter specifying the number of Fourier frequencies.

R_short

number of (even) polynomial terms used for approximation of spectral density at the origin.

R_noise

number of (even) polynomial terms used for approximation of dependence in perturbation term.

Details

add details here.

References

Frederiksen, P., Nielsen, F. S., and Nielsen, M. O. (2012): Local polynomial Whittle estimation of perturbed fractional processes. Journal of Econometrics, Vol. 167, No.2, pp. 426-447.

Examples

library(fracdiff)
T<-2000
d<-0.2
series<-fracdiff.sim(n=T, d=d, ar=0.6)$series+rnorm(T)
LPWN(series, m=floor(1+T^0.8), R_short=1, R_noise=0)

GPH estimation of long memory parameter robust to low frequency contaminations.

Description

McC.Perron trimmed and adaptive log-periodogram estimators of McCloskey and Perron (2013, ET) for robust estimation of the memory parameter d.

Usage

McC.Perron(X, m, epsilon = 0.05, method = c("adaptive", "trimmed"),
  Kl = 1)

Arguments

X

vector of length T.

m

bandwith parameter specifying the number of Fourier frequencies. used for the estimation usually floor(1+T^delta), where 0<delta<1.

epsilon

small constant that determines the choice of the trimming parameter l used by the gph estimator. Default is epsilon=0.05.

method

either "adaptive" or "trimmed" for the corresponding estimator. Confer McCloskey and Perron (2013, ET) for details. Default is method="adaptive".

Kl

proportionality factor for bandwidth selection. Default is Kl=1.

Details

add details here. Recommendation of McCloskey, A. and Perron, P. (2013): Use trimmed version of estimator if there is reason to assume that shifts are present and use adaptive with epsilon=0.05 and m=T^0.8 if you are agnostic about the presence of shifts.

References

Robinson, P. M. (1995): Log-periodogram regression of time series with long range dependence. The Annals of Statistics, Vol. 23, No. 5, pp. 1048 - 1072.

McCloskey, A. and Perron, P. (2013): Memory parameter estimation in the presence of level shifts and deterministic trends. Econometric Theory, 29, pp. 1196-1237.

Examples

library(fracdiff)
T<-1000
m<-floor(1+T^0.8)
d=0.4
series<-fracdiff.sim(n=T, d=d)$series
McC.Perron(series,m)

MLWS test for multivariate spurious long memory.

Description

Multivariate local Whittle Score type test for the null hypothesis of true long memory against the alternative of spurious long memory suggested by Sibbertsen, Leschinski and Holzhausen (2018).

Usage

MLWS(X, m, epsilon = c(0.02, 0.05), coint.elements = NULL, B = NULL,
  prewhite = c("none", "uni", "multi"), eta = rep(1/sqrt(min(dim(X))),
  min(dim(X))), rep = FALSE, approx = 100, split = 1,
  T_limdist = 1000, M_limdist = 5000)

Arguments

X

data matrix

m

bandwith parameter specifying the number of Fourier frequencies used for the estimation usually floor(1+T^delta), where 0.5<delta<0.8 for consistency.

epsilon

trimming parameter epsilon=0.05 by default. Determines minimum number of Fourier frequencies used in test statistic. For T>500 it is recommended to use epsilon=0.02. Confer Sibbertsen, Leschinski, Holzhausen (2018) for further details.

coint.elements

Vector specifying which elements in the vector series are in a cointegrating relationship. By default NULL. Cf details.

B

cointegrating matrix, if known. Default is B=NULL.

prewhite

specifies the form of pre-whitening applied. One of c("none","uni","multi"). If uni is selected the univariate a univariate of maximal order (1,d,1) is selected using the AIC. If multi is selected VARFIMA_est is used to fit a VARFIMA(1,d,1) in final equations form. Default is none.

eta

vector of weights. Default is rep(1/sqrt(min(dim(X))),min(dim(X))).

rep

if prewhite="multi" is selected, rep specifies whether the current parameter values are displayed to the user during optimization procedure. Default is rep=FALSE.

approx

if prewhite="multi" is selected, approx specifies the order of the AR-approximation used in VARFIMA_est. Default is approx=100.

split

if prewhite="multi" is selected, split whether the sample should be split into subsamples to speed up the estimation. Default is split=1, so that the whole sample is used.

T_limdist

number of increments used in simulation if limit distribution. Only relevant for component-wise version of the test. Default is T_limdist=1000.

M_limdist

number of replications for simulation of the limit distribution. Default is M_limdist=5000.

References

Sibbertsen, P., Leschinski, C. H., Holzhausen, M., (2018): A Multivariate Test Against Spurious Long Memory. Journal of Econometrics, Vol. 203, No. 1, pp. 33 - 49.

Examples

T<-500
m<-floor(1+T^0.75)
series<-FI.sim(T=T,q=2,rho=0.7,d=c(0.4,0.2))
ts.plot(series, col=1:2)
MLWS(X=series, m=m, epsilon=0.05)

shift.series<-series+ARRLS.sim(T=T, phi=0, sig.shift=2, prob=5/T)
ts.plot(shift.series, col=1:2)
MLWS(X=shift.series, m=m, epsilon=0.05)

T<-500
m<-floor(T^0.75)
series<-FI.sim(T=T,q=2,rho=0,d=c(0.1,0.4), B=rbind(c(1,-1),c(0,1)))
ts.plot(series, col=1:2)
MLWS(series, m=m)
MLWS(series, m=m, coint.elements=c(1,2))

Automated partitioning of estimated vector of long memory parameters into subvectors with equal memory.

Description

partition.X conducts a sequence of tests for the equality of two or more estimated memory parameters to find possible partitions of a vector into subvectors with equal memory parameters. The procedure follows Robinson and Yajima (2002).

Usage

partition.X(data, d.hat, m, m1, alpha = 0.05, report = FALSE)

Arguments

data

(Txq) data matrix

d.hat

(qx1) vector of d-estimates obtained using a local Whittle method such as that described in Robinson (1995).

m

the bandwidth parameter to be used for estimation of G

m1

the bandwidth parameter used for estimation of d.vec with m1>>m

alpha

the desired significance level for the tests

report

either TRUE or FALSE determining, whether information about the partitioning process should be printed to the user. Default is report=FALSE.

Details

add a lot of details.

References

Robinson, P. M. (1995): Gaussian semiparametric estimation of long rang dependence. The Annals of Statistics, Vol. 23, No. 5, pp. 1630-1661.

Robinson, P. M. and Yajima, Y. (2002): Determination of cointegrating rank in fractional systems. Journal of Econometrics, Vol. 106, No.2, pp. 217-241.

See Also

partitions, T.rho, T0stat

Examples

library(fracdiff)
T<-1000
d1<-0.2
d2<-0.4
X<-cbind(fracdiff.sim(n=T,d=d1)$series,fracdiff.sim(n=T,d=d1)$series,
fracdiff.sim(n=T,d=d2)$series,fracdiff.sim(n=T,d=d2)$series)
alpha<-0.05
m1<-floor(1+T^0.75)
m<-floor(1+T^0.65)
d.hat<-c(local.W(X[,1],m=m1)$d,local.W(X[,2],m=m1)$d,local.W(X[,3],m=m1)$d,local.W(X[,4],m=m1)$d)
partition.X(data=X, d.hat=d.hat, m=m, m1=m1, alpha=0.05, report=TRUE)

Multivariate Periodogram.

Description

Peri calculates the periodogram of a multivariate time series.

Usage

Peri(X)

Arguments

X

(Txq) data matrix.

Details

Returns an array of dimension c(q,q,floor(T/2)).

Examples

series<-FI.sim(T=1000,q=2,rho=0.7,d=c(0.4,0.4))
peri<-Peri(series)
par(mfrow=c(2,2))
for(i in 1:2){
for(j in 1:2){
plot(Re(peri[i,j,]), type="h")
lines(Im(peri[i,j,]), col=2)
}}

Pre-whitening for application of semiparametric long memory estimator.

Description

Given a parameter vector theta obtained using VARFIMA_est, pre.White returns the pre-whitened sample.

Usage

pre.White(theta, data, q, approx = 100)

Arguments

theta

estimated parameter vector.

data

data matrix with T observations of q-dimensional process.

q

dimension of the process.

approx

order of the AR-approximation that is supposed to be used. Default is approx=100.

Details

add details here.

References

Sibbertsen, P., Leschinski, C. H., Holzhausen, M., (2015): A Multivariate Test Against Spurious Long Memory. Hannover Economic Paper.


Qu test for true long memory against spurious long memory.

Description

Qu.test Test statistic of Qu (2011) for the null hypotesis of true long memory against the alternative of spurious long memory.

Usage

Qu.test(data, m, epsilon = 0.05)

Arguments

data

data vector of length T.

m

bandwith parameter specifying the number of Fourier frequencies used for the estimation usually floor(1+T^delta), where 0.5<delta<0.8 for consistency.

epsilon

trimming parameter epsilon=0.05 by default. Determines minimum number of Fourier frequencies used in test statistic. For T>500 it is recommended to use epsilon=0.02.Confer Qu (2011) for further details.

References

Qu, Z. (2011): A Test Against Spurious Long Memory. Journal of Business and Economic Statistics, Vol. 29, No. 3, pp. 423 - 438.

Examples

library(fracdiff)
T<-500
m<-floor(1+T^0.75)
series<-fracdiff.sim(n=T,d=0.4)$series
shift.series<-ARRLS.sim(T=500,phi=0.5, sig.shift=0.75, prob=5/T, sig.noise=1)
ts.plot(series, ylim=c(min(min(series),min(shift.series)),max(max(series),max(shift.series))))
lines(shift.series, col=2)
Qu.test(series,m=m, epsilon=0.05)
Qu.test(shift.series,m=m, epsilon=0.05)

Cointegration Rank Estimation using Model Selection.

Description

Model selection procedure to estimate the cointegrating rank based on eigenvalues of correlation matrix P suggested by Robinson and Yajima (2002).

Usage

rank.est(data, d.hat, m, m1, v_n = m^(-0.3))

Arguments

data

data matrix of dimension (qxT).

d.hat

the estimated d.vector

m

bandwith parameter specifying the number of Fourier frequencies. used for the estimation of d, usually floor(1+T^delta), where 0<delta<1.

m1

the bandwidth parameter used for estimation of d.vec with m1>>m

v_n

bandwidth parameter. Nielsen and Shimotsu (2007) use m^(-0.3) in their simulation studies, which s the default value. m^(-b) mit 0<b<0.5 can be used.

Details

add details here.

References

Robinson, P. M. and Yajima, Y. (2002): Determination of cointegrating rank in fractional systems. Journal of Econometrics, Vol. 106, No.2, pp. 217-241.

Nielsen, M. O. and Shimotsu, K. (2007): Determining the coinegrating rank in nonstationary fractional systems by the exact local Whittle approach. Journal of Econometrics, 141, pp. 574-596.

Examples

library(fracdiff)
T<-2000
d<-0.4
m1<-floor(1+T^0.75)
m<-floor(1+T^0.65)
xt<-fracdiff.sim(n=T, d=d)$series
yt<-xt+rnorm(T)
zt<-xt+rnorm(T)
X<-cbind(xt,yt,zt)
lW.wrap<-function(data,m){local.W(data,m)$d}
d.hat<-apply(X,2,lW.wrap, m=m1)
rank.est(data=X, d.hat, m=m, m1=m1)

Test for equality of all elements in an estimated d-vector based on pairwise comparisons.

Description

T.rho Uses pairwise test as suggested by Robinson and Yajima (2002) to test for the equality of the memory parameters in a vector series.

Usage

T.rho(data, d.hat, m, m1, alpha = 0.05, s_bar = 1,
  h_n = 1/sqrt(log(max(dim(data)))))

Arguments

data

data matrix of dimension (qxT).

d.hat

the estimated d.vector

m

bandwith parameter specifying the number of Fourier frequencies. used for the estimation of G, usually floor(1+T^delta), where 0<delta<1.

m1

the bandwidth parameter used for estimation of d.vec with m1>>m

alpha

the desired significance level for the tests

s_bar

number of subvectors to be tested in partitioning procedure. Default is s_bar=1, for independent use.

h_n

bandwidth parameter. Default is h_n=1/sqrt(log(max(dim(data)))) which is recommended by Nielsen and Shimotsu (2007) in their simulation study. Robinson and Yajima (2002) argue non-rejection with h_n=0 would imply non-rejection with any h_n>0.

Author(s)

Christian Leschinski

References

Robinson, P. M. and Yajima, Y. (2002): Determination of cointegrating rank in fractional systems. Journal of Econometrics, Vol. 106, No.2, pp. 217-241.

Nielsen, M. O. and Shimotsu, K. (2007): Determining the coinegrating rank in nonstationary fractional systems by the exact local Whittle approach. Journal of Econometrics, 141, pp. 574-596.

Examples

library(fracdiff)
T<-1000
d1<-0.2
d2<-0.4
X<-cbind(fracdiff.sim(n=T,d=d1)$series,fracdiff.sim(n=T,d=d1)$series,
fracdiff.sim(n=T,d=d2)$series,fracdiff.sim(n=T,d=d2)$series)
alpha<-0.05
m1<-floor(1+T^0.75)
m<-floor(1+T^0.65)
lW.wrap<-function(data,m){local.W(data,m)$d}
d.hat<-apply(X,2,lW.wrap, m=m1)
T.rho(data=X, d.hat=d.hat, m=m, m1=m1)

Test for equality of all elements in an estimated d-vector based.

Description

T0stat tests equality of all memory parameters simultaneously. Statistic was suggested by Robinson and Yajima (2002). Test statistic was denoted by T_0 in Nielsen and Shimotsu (2007).

Usage

T0stat(data, d.hat, m, m1, alpha = 0.05, s_bar = 1,
  h_n = 1/sqrt(log(max(dim(data)))))

Arguments

data

data matrix of dimension (qxT).

d.hat

the estimated d.vector

m

bandwith parameter specifying the number of Fourier frequencies. used for the estimation of d, usually floor(1+T^delta), where 0<delta<1.

m1

the bandwidth parameter used for estimation of d.vec with m1>>m

alpha

the desired significance level for the tests

s_bar

number of subvectors to be tested in partitioning procedure. Default is s_bar=1, for independent use.

h_n

bandwidth parameter. Default is h_n=1/sqrt(log(max(dim(data)))) which is recommended by Nielsen and Shimotsu (2007) in their simulation study. Robinson and Yajima (2002) argue non-rejection with h_n=0 would imply non-rejection with any h_n>0.

Details

add details here.

References

Robinson, P. M. and Yajima, Y. (2002): Determination of cointegrating rank in fractional systems. Journal of Econometrics, Vol. 106, No.2, pp. 217-241.

Nielsen, M. O. and Shimotsu, K. (2007): Determining the coinegrating rank in nonstationary fractional systems by the exact local Whittle approach. Journal of Econometrics, 141, pp. 574-596.

Examples

library(fracdiff)
T<-1000
d1<-0.2
d2<-0.4
X<-cbind(fracdiff.sim(n=T,d=d1)$series,fracdiff.sim(n=T,d=d1)$series,
fracdiff.sim(n=T,d=d2)$series,fracdiff.sim(n=T,d=d2)$series)
alpha<-0.05
m1<-floor(1+T^0.75)
m<-floor(1+T^0.65)
lW.wrap<-function(data,m){local.W(data,m)$d}
d.hat<-apply(X,2,lW.wrap, m=m1)
T0stat(data=X, d.hat=d.hat, m=m, m1=m1)

Maximum likelihood estimation of a VARFIMA(1,1) in final equations form.

Description

VARFIMA.est returns the maximum likelihood estimate of the parameter vector of a VARFIMA(1,1) in final equations form.

Usage

VARFIMA.est(data, approx = 100, split = 1, rep = FALSE)

Arguments

data

data matrix with T observations of q-dimensional process.

approx

order of the AR-approximation that is supposed to be used. Default is approx=100.

split

to increase the speed the sample can be divided in split parts. Parmeter estimation is then carried out seperately for each subsample and results are averaged across the subsamples.

rep

is passed to ll_VARFIMA and determines whether the current parameter vector is printed to the user in every iteration of the numerical maximization procedure.

Details

add details here.

References

Lutkepohl, H. (2007): New introduction to multiple time series analysis. Springer.

Examples

series<-VARFIMA.sim(phi=0.4, THETA=matrix(c(0,0,0,0),2,2), 
d.vec=c(0.4,0.3), T=1000, Sigma=matrix(c(1,0.4,0.4,1),2,2))
ts.plot(series, col=1:2)
acf(series, lag=100)
VARFIMA.est(series, approx=100, rep=FALSE)

Simulation of a VARFIMA(1,1) in final equations form.

Description

VARFIMA.sim returns a sample from a VARFIMA(1,1)-process.

Usage

VARFIMA.sim(phi, THETA, d.vec, T, Sigma, approx = 100, burnin = 100)

Arguments

phi

AR(1)-parameter.

THETA

MA(1)-matrix.

d.vec

vector of memory parameters.

T

desired sample size.

Sigma

Variance-Covariance-Matrix of the innovations.

approx

order of the AR-approximation that is supposed to be used. Default is approx=100.

burnin

length of the burnin period that is discarded. Default is burnin=100.

Details

add details here.

References

Lutkepohl, H. (2007): New introduction to multiple time series analysis. Springer.

Examples

series<-VARFIMA.sim(phi=0.4, THETA=matrix(c(0,0,0,0),2,2), 
d.vec=c(0.4,0.3), T=1000, Sigma=matrix(c(1,0.4,0.4,1),2,2))
ts.plot(series, col=1:2)
acf(series, lag=100)

Helper function for MLWS test for multivariate spurious long memory.

Description

Multivariate local Whittle Score type test for the null hypothesis of true long memory against the alternative of spurious long memory suggested by Sibbertsen, Leschinski and Holzhausen (2015).

Usage

W_multi(X, d_vec, m, epsilon, eta)

Arguments

X

data matrix

d_vec

estimated vector of memory parameters.

m

bandwith parameter specifying the number of Fourier frequencies used for the estimation usually floor(1+T^delta), where 0.5<delta<0.8 for consistency.

epsilon

trimming parameter epsilon=0.05 by default. Determines minimum number of Fourier frequencies used in test statistic. For T>500 it is recommended to use epsilon=0.02. Confer Sibbertsen, Leschinski, Holzhausen (2015) for further details.

eta

weight vector.

Details

add details here

References

Sibbertsen, P., Leschinski, C. H., Holzhausen, M., (2015): A Multivariate Test Against Spurious Long Memory. Hannover Economic Paper.