#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"))
Run the code above in your browser using DataLab