Description Usage Arguments Value Note Author(s) References See Also Examples
Sometimes this is also referred to as the BLUE.
1 | TrenchMean(r, z)
|
r |
vector of autocorrelations or autocovariances of length n |
z |
time series data vector of length n |
the estimate of the mean
An error is given if r is not a postive-definite sequence or
if the lengths of r
and z
are not equal.
A.I. McLeod
McLeod, A.I., Yu, Hao, Krougly, Zinovi L. (2007). Algorithms for Linear Time Series Analysis, Journal of Statistical Software.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #compare BLUE and sample mean
phi<- -0.9
a<-rnorm(100)
z<-numeric(length(a))
phi<- -0.9
n<-100
a<-rnorm(n)
z<-numeric(n)
mu<-100
sig<-10
z[1]<-a[1]*sig/sqrt(1-phi^2)
for (i in 2:n)
z[i]<-phi*z[i-1]+a[i]*sig
z<-z+mu
r<-phi^(0:(n-1))
meanMLE<-TrenchMean(r,z)
meanBLUE<-mean(z)
ans<-c(meanMLE, meanBLUE)
names(ans)<-c("BLUE", "MLE")
ans
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.