diff --git a/DESCRIPTION b/DESCRIPTION index 53a9612..2ffb0bc 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: FGN -Version: 2.0-4 -Date: 2013-03-11 +Version: 2.0-5 +Date: 2013-04-02 Title: Fractional Gaussian Noise and hyperbolic decay time series model fitting Author: A.I. McLeod and Justin Veenstra @@ -15,7 +15,7 @@ LazyLoad: yes LazyData: yes License: CC BY-NC-SA 3.0 URL: http://www.stats.uwo.ca/faculty/aim -Packaged: 2013-03-11 21:33:58 UTC; IanMcLeod +Packaged: 2013-04-02 18:43:59 UTC; Aim NeedsCompilation: yes Repository: CRAN -Date/Publication: 2013-03-12 09:52:55 +Date/Publication: 2013-04-02 21:57:12 diff --git a/MD5 b/MD5 index c36b68a..6fa6f62 100644 --- a/MD5 +++ b/MD5 @@ -1,6 +1,6 @@ -a37e37c98cba50713fed67db5d94c434 *DESCRIPTION -a9855741039676ef7f98d35072f057da *NAMESPACE -d17fc5f58160cdef66fb7fa326f123a1 *NEWS +b9e5ae5bf7de708ca0daea5ba6a045bf *DESCRIPTION +601160f446dc426c0d61bb47613bf908 *NAMESPACE +bbdf261659630d1896b67be196486ea5 *NEWS b834c996deb14ac0ba270e839cdd415f *R/ARToPacf.R cfb49e32b1bbe8aaf7d5c8a33cf46d6b *R/Boot.FitFGN.R e870fb2bd451cd03745e026240c577f2 *R/Boot.R @@ -26,7 +26,7 @@ b5717727508fef59300c2a572d56540d *R/acvfFGN.R e294fa616ca8e97529ce72b537ade626 *R/acvfPLA.R affa8ca353982d8bc6467807f3cc81e3 *R/acvfPLSA.R 0052fa030a9d0ef0785daf1366ed1411 *R/coef.FitFGN.R -a8f43feec290e15137e892cb52c8723b *R/earfima.R +ce5eb4d06d95cc86f5d7fb6a70275ae3 *R/earfima.R f638720000b1401c6333ad085cd7cb34 *R/plot.FitFGN.R 640cf7f5d682447e746fdfb090d172cb *R/predict.FitFGN.R 4bd6e768e68fab8bdb79bdabbe2dfe54 *R/print.FitFGN.R @@ -40,8 +40,8 @@ f638720000b1401c6333ad085cd7cb34 *R/plot.FitFGN.R 758e97148aab910686c504d157d1a780 *R/summary.FitFGN.R 6df07ceddbbec6beabc28ce40e0b7ecd *R/tacf.R dd4d66323129f51f7523100873f1aab4 *R/warfima.R -789fcefdcbf1a267775c774fac59bd0e *data/NileFlowCMS.rda -83e83164b22aa3ea48d9c85bf9197d1c *data/NileMin.rda +5f8d2d4fe369d57c038386dc77491821 *data/NileFlowCMS.rda +560728c6cc3b74c995c191a734c9b3ac *data/NileMin.rda e918f7c41e84a05a6b4181b0edce462b *data/SeriesB.rda b7663e7d42f5b3970d4a1f7d88cc02cc *data/globtp.rda 38cd3e0b2aacd4818e5cf9474572823d *inst/CITATION @@ -50,15 +50,14 @@ b7663e7d42f5b3970d4a1f7d88cc02cc *data/globtp.rda d86f71dcbb40f094b962a26e835b5cd0 *inst/doc/index_files/filelist.xml d2ea643e2693aa428cee4699f122a5ae *inst/doc/index_files/preview.wmf 1d712df30aaae149416bfc0da166f00a *inst/doc/index_files/themedata.thmx -70f452f2cdca88e6714459eabaa184b2 *inst/doc/v23i05.pdf +f50369fac85b2e3d22f4f4b3634cec97 *inst/doc/v23i05.pdf edf2ad5de4ea660c8d1b29ddecea419b *inst/doc/v23i05_table12.R 03dfc3b96ca165312ece4f08ae9cdd9c *inst/doc/v23i05_table14.R 71cbbbe670e61502320bbfb39092c65b *inst/doc/v23i05_table15a.R 13b2384fdf9804d4dca40935bc63fa5c *inst/doc/v23i05_table15b.R -443c44eaaf8f7de6af63f0810e4018d0 *man/ARToPacf.Rd 1c5073d9dd8bd443197ede3c5992054e *man/Boot.FitFGN.Rd a7e4c5cc4ef2b7bc69dceaa1f58fd093 *man/Boot.Rd -28ab24bc440b9a28c70800b61b01f96f *man/FGN-package.Rd +8d226cbb339a039d525362599aa79211 *man/FGN-package.Rd c8243c44bd59fe7fba70f5ee744b44a2 *man/FitFGN.Rd 65911d58148bbd61c8fa880550cae4e7 *man/FitRegressionFGN.Rd 7af77ce4d328fbec6bcd37f5050b56b4 *man/GetFitFD.Rd @@ -66,14 +65,12 @@ c8243c44bd59fe7fba70f5ee744b44a2 *man/FitFGN.Rd cbd8adac114200d1fb374692824222ce *man/GetFitPLA.Rd d0cec38eff0e88c46e74f8239d5c9bcc *man/GetFitPLS.Rd 3deed63d7ece49eed26804406891d75e *man/HurstK.Rd -a50f29d016d9a0993daea6c666f52952 *man/InvertibleQ.Rd 38cf63870be17fac3bf06f072e539ca0 *man/LLFD.Rd d7fa81f60f9cde6d0eaebc16291bc41c *man/LLFGN.Rd 3c9722f4de3299c94dff3dd182683124 *man/LLPLA.Rd a7c72172395a8bd84c79249d8a06716d *man/LLPLS.Rd 4c6e273e00c0ceff97155c22362ed225 *man/NileFlowCMS.Rd 6296911b3ad41f0c6976ddf8e1823c24 *man/NileMin.Rd -70a45d888c5c269406d5e6c39fffb4f4 *man/PacfToAR.Rd 494de5cca44cba5f832f02a79babaa2c *man/Reimann.Rd fc4bdba6e71a77174263d5a7ffd84479 *man/SeriesB.Rd 453866911e9ba763331d9ac6039f789d *man/SimulateFD.Rd @@ -84,7 +81,6 @@ e3278c2d3c708788dbebf3797fec010a *man/WLoglikelihood.Rd 4d8cb860dcaaf47d73f6a8251a10f927 *man/acvfPLA.Rd effb341cc53dfc1ad6ebf1ad16d064c3 *man/acvfPLS.Rd d723458958bc58fd548f5bd7d5d39dba *man/coef.FitFGN.Rd -cdd4b31618308a06df35275aa0c7f01f *man/earfima.Rd acb682b37599f8d86db9d32cfeb6433c *man/globtp.Rd 415fcf55b6461f49ebcbf674d37434b2 *man/plot.FitFGN.Rd e687cc9c8e11a577839eebb76c49efd0 *man/predict.FitFGN.Rd @@ -97,7 +93,6 @@ ccc078af00486b96516cb780b272fe97 *man/sdfPLA.Rd a191b29ed46da52184fe8834c468b148 *man/sdfarma.Rd de3398fa8395c7024850c4975d5cf6cd *man/sdfhd.Rd 880cbcefc7461be5ccedbeb931ad1b29 *man/summary.FitFGN.Rd -154ea0b0fb507285a69dda7d4cd4d5f3 *man/tacvfARFIMA.Rd 3d9188d755aac2e0190cc9a995c9733e *man/warfima.Rd d9cf118d94dfc5a2d09eeb47b1b7320b *src/Makevars 0e0aca6610678156d51c2c44163b498c *src/tacf.c diff --git a/NAMESPACE b/NAMESPACE index 630faad..c0524f0 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,8 +7,7 @@ export( "sdfFGN", "sdfFD", "sdfPLA", "sdfPLS", "LLFGN", "LLFD", "LLPLA", "LLPLS", "GetFitFGN", "GetFitPLA", "GetFitFD", "GetFitPLS", -"sdfarma", "sdfhd", "warfima", "WLoglikelihood", "earfima", -"InvertibleQ", "ARToPacf", "PacfToAR", "tacvfARFIMA", +"sdfarma", "sdfhd", "warfima", "WLoglikelihood", "FitFGN", "Reimann", "Boot.FitFGN", diff --git a/NEWS b/NEWS index ad3b8f4..9ba96d7 100755 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +CHANGES IN 'FGN' VERSION 2.0-5 (2013-04-02) + o improved compatibility with FitAR and arfima CHANGES IN 'FGN' VERSION 2.0-3 (2013-03-11) o ACM license, restricts to academic use CHANGES IN 'FGN' VERSION 2.0-2 (2013-03-10) diff --git a/R/earfima.R b/R/earfima.R index fe9f6a7..f299bf4 100755 --- a/R/earfima.R +++ b/R/earfima.R @@ -47,5 +47,6 @@ earfima <- function(z, order=c(0,0,0), lmodel=c("FD", "FGN", "PLA", "NONE")) { HHat <- 1-alphaHat/2 dHat <- HHat - 0.5 phiHat <- thetaHat <- numeric(0) - list(bHat=bHat, alphaHat=alphaHat, HHat = HHat, dHat=dHat, phiHat=phiHat, thetaHat=thetaHat, LL=LL, convergence=convergence) + ans<-list(bHat=bHat, alphaHat=alphaHat, HHat = HHat, dHat=dHat, phiHat=phiHat, thetaHat=thetaHat, LL=LL, convergence=convergence) + unlist(ans) } diff --git a/data/NileFlowCMS.rda b/data/NileFlowCMS.rda index 2dbba3e..64891c0 100755 Binary files a/data/NileFlowCMS.rda and b/data/NileFlowCMS.rda differ diff --git a/data/NileMin.rda b/data/NileMin.rda index 3af02b4..cb29153 100755 Binary files a/data/NileMin.rda and b/data/NileMin.rda differ diff --git a/inst/doc/v23i05.pdf b/inst/doc/v23i05.pdf index 02fd426..c24e828 100644 Binary files a/inst/doc/v23i05.pdf and b/inst/doc/v23i05.pdf differ diff --git a/man/ARToPacf.Rd b/man/ARToPacf.Rd deleted file mode 100755 index f21de8b..0000000 --- a/man/ARToPacf.Rd +++ /dev/null @@ -1,47 +0,0 @@ -\name{ARToPacf} -\alias{ARToPacf} -\title{Reparametrize AR Coefficients In Terms of PACF} -\description{ - Transform AR parameter coefficients into partial autocorrelation function (PACF). -} -\usage{ -ARToPacf(phi) -} - -\arguments{ - \item{phi}{vector of AR parameter coefficients } -} -\details{ -For details see McLeod and Zhang (2006). -} -\value{ -Vector of length(phi) containing the parameters in the transformed -PACF domain -} -\references{ -McLeod, A.I. and Zhang, Y. (2006). -Partial autocorrelation parameterization for subset autoregression. -Journal of Time Series Analysis, 27, 599-612. -} - -\author{ A.I. McLeod and Y. Zhang} - -\section{Warning}{No check for invertibility is done for maximum computational efficiency -since this function is used extensively in the numerical optimization of -the AR loglikelihood function in FitAR. -Use InvertibleQ to test for invertible AR coefficients. -} - -\seealso{ -\code{\link{InvertibleQ}}, -\code{\link{PacfToAR}} -} -\examples{ -somePACF<-c(0.5,0.6,0.7,0.8,-0.9,-0.8) -#PacfToAR() transforms PACF to AR parameter coefficients. -someAR<-PacfToAR(somePACF) -test<-ARToPacf(someAR) -#This should be very small -sum(abs(test-somePACF)) -} -\keyword{ ts } diff --git a/man/FGN-package.Rd b/man/FGN-package.Rd index c642f2f..240722d 100755 --- a/man/FGN-package.Rd +++ b/man/FGN-package.Rd @@ -15,8 +15,8 @@ Simulation and regression supported for FGN. \tabular{ll}{ Package: \tab FGN\cr Type: \tab Package\cr - Version: \tab 2.0-4\cr - Date: \tab 2013-03-11\cr + Version: \tab 2.0-5\cr + Date: \tab 2013-04-02\cr License: \tab CC BY-NC-SA 3.0\cr LazyLoad: \tab yes\cr LazyData: \tab yes\cr diff --git a/man/InvertibleQ.Rd b/man/InvertibleQ.Rd deleted file mode 100755 index 2ddd568..0000000 --- a/man/InvertibleQ.Rd +++ /dev/null @@ -1,49 +0,0 @@ -\name{InvertibleQ} -\alias{InvertibleQ} -\title{ Test if Invertible or Stationary-casual } -\description{ -Tests if the polynomial -\deqn{1 -\phi(1) B \ldots - \phi(p) B^p,} -where p=length[phi] has all roots -outside the unit circle. -This is the invertibility condition for the polynomial. -} -\usage{ -InvertibleQ(phi) -} -\arguments{ - \item{phi}{ a vector of AR coefficients } -} -\details{ -The PACF is computed for lags 1, \dots, p using eqn. (1) in -McLeod and Zhang (2006). -The invertibility condition is satisfied if and only if -all PACF values are less than 1 in absolute value. -} -\value{ - TRUE, if invertibility condition is satisfied. - FALSE, if not invertible. -} -\references{ -McLeod, A.I. and Zhang, Y. (2006). -Partial autocorrelation parameterization for subset autoregression. -Journal of Time Series Analysis, 27, 599-612. -} -\author{ A.I. McLeod and Y. Zhang} - -\seealso{ \code{\link{ARToPacf}} } -\examples{ -#simple examples -InvertibleQ(0.5) -#find the area of the invertible region for AR(2). -#We assume that the parameters must be less than 2 in absolute value. -#From the well-known diagram in the book of Box and Jenkins (1970), -#this area is exactly 4. -NSIM<-10^4 -phi1<-runif(NSIM, min=-2, max=2) -phi2<-runif(NSIM, min=-2, max=2) -k<-sum(apply(matrix(c(phi1,phi2),ncol=2), MARGIN=1, FUN=InvertibleQ)) -area<-16*k/NSIM -area -} -\keyword{ ts } diff --git a/man/PacfToAR.Rd b/man/PacfToAR.Rd deleted file mode 100755 index e565251..0000000 --- a/man/PacfToAR.Rd +++ /dev/null @@ -1,38 +0,0 @@ -\name{PacfToAR} -\alias{PacfToAR} -\title{Transform from PACF Parameters to AR Coefficients } -\description{ -Transforms AR partical autocorrelation function (PACF) -parameters to AR coefficients based on the Durbin-Levinson recursion. -} -\usage{ -PacfToAR(zeta) -} -\arguments{ - \item{zeta}{ vector of AR PACF parameters } -} -\details{ -See Mcleod and Zhang (2006) -} -\value{ -Vector of AR coefficients -} -\references{ -McLeod, A.I. and Zhang, Y. (2006). -Partial autocorrelation parameterization for subset autoregression. -Journal of Time Series Analysis, 27, 599-612. -} -\author{ A.I. McLeod and Y. Zhang} - -\seealso{ -\code{\link{InvertibleQ}}, -\code{\link{PacfToAR}} -} -\examples{ -somePACF<-c(0.5,0.6,0.7,0.8,-0.9,-0.8) -someAR<-PacfToAR(somePACF) -test<-ARToPacf(someAR) -#this should be very small -sum(abs(test-somePACF)) -} -\keyword{ts } diff --git a/man/earfima.Rd b/man/earfima.Rd deleted file mode 100755 index f842199..0000000 --- a/man/earfima.Rd +++ /dev/null @@ -1,43 +0,0 @@ -\name{earfima} -\alias{earfima} -\title{Exact MLE for ARFIMA} - -\description{ -The time series is corrected for the sample mean and then exact MLE is -used for the other parameters. -} - -\usage{ -earfima(z, order = c(0, 0, 0), lmodel = c("FD", "FGN", "PLA", "NONE")) -} - -\arguments{ - \item{z}{time series} - \item{order}{(p,d,q) where p=order AR, d=regular difference, q=order MA} - \item{lmodel}{type of long-memory component: FD, FGN, PLA or NONE} -} - -\details{The sample mean is asymptotically efficient.} - -\value{ -list with components: - \item{bHat}{transformed optimal parameters} - \item{alphaHat}{estimate of alpha} - \item{HHat}{estimate of H} - \item{dHat}{estimate of d} - \item{phiHat}{estimate of phi} - \item{thetaHat}{estimate of theta} - \item{wLL}{optimized value of Whittle approximate log-likelihood} - \item{LL}{corresponding exact log-likelihood} - \item{convergence}{convergence indicator} -} - -\author{Justin Veenstra and A. I. McLeod} - - -\examples{ -z <- rnorm(100) -earfima(z, lmodel="FGN") -} - -\keyword{ ts} diff --git a/man/tacvfARFIMA.Rd b/man/tacvfARFIMA.Rd deleted file mode 100755 index 5043577..0000000 --- a/man/tacvfARFIMA.Rd +++ /dev/null @@ -1,101 +0,0 @@ -\name{tacvfARFIMA} -\alias{tacvfARFIMA} -\title{ - The theoretical autocovariance function of a long memory process. -} -\description{ - Calculates the tacvf of a mixed long memory-ARMA (with posible seasonal components). - Combines long memory and ARMA (and non-seasonal and seasonal) parts via convolution. -} -\usage{ -tacvfARFIMA(phi = numeric(0), theta = numeric(0), dfrac = numeric(0), - phiseas = numeric(0), thetaseas = numeric(0), - dfs = numeric(0), H = numeric(0), Hs = numeric(0), alpha = numeric(0), - alphas = numeric(0), period = 0, maxlag, - useCt = T, sigma2 = 1) -} - -\arguments{ - \item{phi}{ - The autoregressive parameters in vector form. -} - \item{theta}{ - The moving average parameters in vector form. See Details for differences from \code{\link{arima}}. -} - - \item{dfrac}{ - The fractional differencing parameter. -} - \item{phiseas}{ - The seasonal autoregressive parameters in vector form. -} - - \item{thetaseas}{ - The seasonal moving average parameters in vector form. See Details for differences from \code{\link{arima}}. -} - - \item{dfs}{ - The seasonal fractional differencing parameter. -} - - \item{H}{ - The Hurst parameter for fractional Gaussian noise (FGN). Should not be mixed with \code{dfrac} or \code{alpha}: see "Details". -} - - \item{Hs}{ - The Hurst parameter for seasonal fractional Gaussian noise (FGN). Should not be mixed with \code{dfs} or \code{alphas}: see "Details". -} - \item{alpha}{ - The decay parameter for power-law autocovariance (PLA) noise. Should not be mixed with \code{dfrac} or \code{H}: see "Details". -} - - \item{alphas}{ - The decay parameter for seasonal power-law autocovariance (PLA) noise. Should not be mixed with \code{dfs} or \code{Hs}: see "Details". -} - \item{period}{ - The periodicity of the seasonal components. Must be >= 2. -} - - \item{maxlag}{ - The number of terms to compute: technically the output sequence is from lags 0 to maxlag, so there are maxlag + 1 terms. -} - - \item{useCt}{ - Whether or not to use C to compute the (parts of the) tacvf. -} - - \item{sigma2}{ - variance corresponding to unit innovation variance -} - -} -\details{ - The log-likelihood is computed for the given series z and the parameters. If two or more of \code{dfrac}, \code{H} or \code{alpha} are present and/or - two or more of \code{dfs}, \code{Hs} or \code{alphas} are present, an error will be thrown, as otherwise there is redundancy in the model. - Note that non-seasonal and seasonal components can be of different types: for example, there can be seasonal FGN with FDWN at the non-seasonal level. - - The moving average parameters are in the Box-Jenkins convention: they are the negative of the parameters given by \code{\link{arima}}. -} -\value{ - A sequence of length maxlag + 1 (lags 0 to maxlag) of the tacvf of the given process. -} - -\references{ -Veenstra, J. and McLeod, A. I. (Working Paper). -The arfima R package: Exact Methods for Hyperbolic Decay Time Series - -P. Borwein (1995) -An efficient algorithm for Riemann Zeta function -Canadian Math. Soc. Conf. Proc., 27, pp. 29-34. -} - -\author{ -Justin Veenstra and A. I. McLeod -} - -\examples{ -tacvfARFIMA(phi = c(0.2, 0.1), theta = 0.4, dfrac = 0.3, maxlag = 30) - -} - -\keyword{ ts } \ No newline at end of file