GetFitFGN {FGN}R Documentation

Fit FGN Time Series Model

Description

Exact maximum likelihood estimation of the parameter H in fractional Gaussian noise (FGN). This is a utility function used by FitFGN but it is also useful in simulation experiments since it is faster than using FitFGN. See example below.

Usage

GetFitFGN(z, MeanZeroQ = FALSE)

Arguments

z time series data vector
MeanZeroQ optional argument, default is MeanZeroQ=FALSE. Set to TRUE if the mean is known to be zero

Details

The function optimize is used. It is very rare but it has been observed that optimize can incorrectly choose an endpoint. If this happens a warning is given and optim is used.

Value

a list with two elements:

Loglikelihood value of the maximized loglikelihood
H MLE for H

Author(s)

A.I. McLeod

References

McLeod, A.I., Yu, Hao, Krougly, Zinovi L. (2007). Algorithms for Linear Time Series Analysis, Journal of Statistical Software.

See Also

optimize, optim, Boot.FitFGN, FitFGN, FitRegressionFGN

Examples

#Example 1
#fit Gaussian White Noise, H=0.5
z<-rnorm(500, 100, 10)
GetFitFGN(z)

#Example 2
#estimate H for NileMin series
data(NileMin)
GetFitFGN(NileMin)

#Example 3
#Timing comparison for GetFitFGN and FitFGN
ns<-c(500,1000) #may extend this to other n's
H<-0.8
nR<-10
tim1<-tim2<-numeric(length(ns))
for (i in 1:length(ns)){
    n <- ns[i]    
    t1<-t2<-0
    s1<-proc.time()[1]
    for (iR in 1:nR){
        z<-SimulateFGN(n, H)
        H1<-GetFitFGN(z)
        }
    e1<-proc.time()[1]
    t1<-t1+(e1-s1)
    s2<-proc.time()[1]
    for (iR in 1:nR){
        z<-SimulateFGN(n, H)
        H2<-FitFGN(z)
        }
    e2<-proc.time()[1]
    t2<-t2+(e2-s2)
    tim1[i]<-t1
    tim2[i]<-t2
}
tb<-matrix(c(tim1,tim2),ncol=2)
dimnames(tb)<-list(ns,c("GetFitFGN","FitFGN"))


[Package FGN version 1.1 Index]