Last data update: 2014.03.03
R: Fractional Gaussian Noise and hyperbolic decay time series...
FGN-package R Documentation
Fractional Gaussian Noise and hyperbolic decay time series model fitting
Description
Exact and Whittle MLE for time series models with hyperbolic decay.
Simulation and regression supported for FGN.
Details
Package: FGN
Type: Package
Version: 2.0-12
Date: 2014-05-15
License: CC BY-NC-SA 3.0
LazyLoad: yes
LazyData: yes
Author(s)
A. I. McLeod and Justin Veenstra
Maintainer: aimcleod@uwo.ca
References
Hipel, K.W. and McLeod, A.I., (2005).
Time Series Modelling of Water Resources and Environmental Systems.
Electronic reprint of our book orginally published in 1994.
http://www.stats.uwo.ca/faculty/aim/1994Book/ .
McLeod, A.I., Yu, Hao, Krougly, Zinovi L. (2007).
Algorithms for Linear Time Series Analysis,
Journal of Statistical Software.
McLeod, A.I. and Veenstra, Justin (2012).
Hyperbolic Decay Time Series Models (in press).
See Also
HurstK
,
FitFGN
,
FitRegressionFGN
,
SimulateFGN
,
print.FitFGN
,
summary.FitFGN
,
predict.FitFGN
,
plot.FitFGN
,
residuals.FitFGN
,
GetFitFGN
,
GetFitFD
,
GetFitPLS
,
GetFitPLA
Examples
#Example 1
#Compare HurstK and MLE for H
#Hurst K for Nile Minima
data(NileMin)
HurstK(NileMin)
out<-FitFGN(NileMin)
summary(out)
plot(out)
coef(out)
#
#Example 2.
#Compare models
## Not run:
T1 <- proc.time()[3]
ansFD <- GetFitFD(NileMin)
T2 <- proc.time()[3]
ansFGN <- GetFitFGN(NileMin)
T3 <- proc.time()[3]
ansPLS <- GetFitPLS(NileMin)
T4 <- proc.time()[3]
ansPLA <- GetFitPLA(NileMin)
T5 <- proc.time()[3]
tbLLE <- c(ansFD[[2]],ansFGN[[2]],ansPLS[[2]],ansPLA[[2]])
est <- c(ansFD[[3]],ansFGN[[3]],ansPLS[[3]],ansPLA[[3]])
tbLL <- round(tbLLE, 2)
est <- round(est, 3)
T<-c(T2-T1,T3-T2,T4-T3,T5-T4)
m<-matrix(c(est,tbLL, T),nrow=4, ncol=3)
dimnames(m)<-list(list("FD","FGN","PLS","PLA"), list("alpha","logL", "time"))
mE <- m
mE
#
T1 <- proc.time()[3]
ansFD <- GetFitFD(NileMin, algorithm="wmle")
T2 <- proc.time()[3]
ansFGN <- GetFitFGN(NileMin, algorithm="wmle")
T3 <- proc.time()[3]
ansPLA <- GetFitPLS(NileMin, algorithm="wmle")
T4 <- proc.time()[3]
ansPLS <- GetFitPLA(NileMin, algorithm="wmle")
T5 <- proc.time()[3]
#tbLL <- c(ansFD[[2]],ansFGN[[2]],ansPLS[[2]],ansPLA[[2]])
z <- NileMin-mean(NileMin)
tbLLW <- c(LLFD(ansFD[[1]],z), LLFGN(ansFGN[[1]],z), LLPLS(ansPLS[[1]],z), LLPLA(ansPLA[[1]],z))
est <- c(ansFD[[3]],ansFGN[[3]],ansPLS[[3]],ansPLA[[3]])
tbLL <- round(tbLLW, 2)
est <- round(est, 3)
T<-c(T2-T1,T3-T2,T4-T3,T5-T4)
m<-matrix(c(est,tbLL, T),nrow=4, ncol=3)
dimnames(m)<-list(list("FD","FGN","PLS","PLA"), list("alpha","logL", "time"))
mW<-m
mW
m<-cbind(mE,mW)
m
## End(Not run)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(FGN)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/FGN/FGN-package.Rd_%03d_medium.png", width=480, height=480)
> ### Name: FGN-package
> ### Title: Fractional Gaussian Noise and hyperbolic decay time series model
> ### fitting
> ### Aliases: FGN-package
> ### Keywords: ts package
>
> ### ** Examples
>
> #Example 1
> #Compare HurstK and MLE for H
> #Hurst K for Nile Minima
> data(NileMin)
> HurstK(NileMin)
[1] 0.8249975
> out<-FitFGN(NileMin)
> summary(out)
#Nile River minima series
H = 0.831, R-sq = 38.46%
length of series = 663 , number of parameters = 2
mean = 11.4812518853695 RMSE = 0.696191503559154
loglikelihood = 236.52 , AIC = -469 , BIC = -460
100 98.73 0.4887911
> plot(out)
> coef(out)
MLE sd Z-ratio
H 0.8314766 0.02662516 12.450
mu 11.4812519 0.29693674 38.666
> #
> #Example 2.
> #Compare models
> ## Not run:
> ##D T1 <- proc.time()[3]
> ##D ansFD <- GetFitFD(NileMin)
> ##D T2 <- proc.time()[3]
> ##D ansFGN <- GetFitFGN(NileMin)
> ##D T3 <- proc.time()[3]
> ##D ansPLS <- GetFitPLS(NileMin)
> ##D T4 <- proc.time()[3]
> ##D ansPLA <- GetFitPLA(NileMin)
> ##D T5 <- proc.time()[3]
> ##D tbLLE <- c(ansFD[[2]],ansFGN[[2]],ansPLS[[2]],ansPLA[[2]])
> ##D est <- c(ansFD[[3]],ansFGN[[3]],ansPLS[[3]],ansPLA[[3]])
> ##D tbLL <- round(tbLLE, 2)
> ##D est <- round(est, 3)
> ##D T<-c(T2-T1,T3-T2,T4-T3,T5-T4)
> ##D m<-matrix(c(est,tbLL, T),nrow=4, ncol=3)
> ##D dimnames(m)<-list(list("FD","FGN","PLS","PLA"), list("alpha","logL", "time"))
> ##D mE <- m
> ##D mE
> ##D #
> ##D T1 <- proc.time()[3]
> ##D ansFD <- GetFitFD(NileMin, algorithm="wmle")
> ##D T2 <- proc.time()[3]
> ##D ansFGN <- GetFitFGN(NileMin, algorithm="wmle")
> ##D T3 <- proc.time()[3]
> ##D ansPLA <- GetFitPLS(NileMin, algorithm="wmle")
> ##D T4 <- proc.time()[3]
> ##D ansPLS <- GetFitPLA(NileMin, algorithm="wmle")
> ##D T5 <- proc.time()[3]
> ##D #tbLL <- c(ansFD[[2]],ansFGN[[2]],ansPLS[[2]],ansPLA[[2]])
> ##D z <- NileMin-mean(NileMin)
> ##D tbLLW <- c(LLFD(ansFD[[1]],z), LLFGN(ansFGN[[1]],z), LLPLS(ansPLS[[1]],z), LLPLA(ansPLA[[1]],z))
> ##D est <- c(ansFD[[3]],ansFGN[[3]],ansPLS[[3]],ansPLA[[3]])
> ##D tbLL <- round(tbLLW, 2)
> ##D est <- round(est, 3)
> ##D T<-c(T2-T1,T3-T2,T4-T3,T5-T4)
> ##D m<-matrix(c(est,tbLL, T),nrow=4, ncol=3)
> ##D dimnames(m)<-list(list("FD","FGN","PLS","PLA"), list("alpha","logL", "time"))
> ##D mW<-m
> ##D mW
> ##D m<-cbind(mE,mW)
> ##D m
> ##D
> ## End(Not run)
>
>
>
>
>
> dev.off()
null device
1
>