I am trying to modify the code mkTrend.R from 'fume' package to implement Hamed and Rao (1998) variance correction approach.
From the code of mkTrend, the following line is very confusing (Line-29 to Line-34)
Now, Please help me with the following three questions
acf(rank(lm(x ~ I(1:n))$resid), lag.max=(n-1), plot=FALSE)$acf[-1] -> ro
qnorm((1+ci)/2)/sqrt(n) -> sig
rep(NA,length(ro)) -> rof
for (i in 1:(length(ro))) {
if(ro[i] > sig || ro[i] < -sig) {
rof[i] ro