Hi @nperez
I have finished the development of Trend(). A few things:
- The documentation is revised except the examples.
- We decided not to reorder the array after Apply(), but since this one has been done so I kept it as reordered.
- About the confidence intervals, now the function doesn't saves the intervals of intercept (just like the old Trend(), which contains A1, A2,..., but not A0). However, by this mean, the array cannot align with $trend (which contains A0, A1, A2,...). Do you think it will impact the usage convenience?
data <- array(c(-5, -7, -10:10, 12, 11, 7, 16), dim = c(dat = 1, sdate = 13, ftime = 2))
aa <- Trend(data)
> str(aa)
List of 4
$ trend : num [1, 1:2, 1:2] -9.769 0.659 0.962 0.797 #the 2nd dim is c(A0, A1)
$ conf.lower: num [1, 1, 1:2] 0.37 0.538 #the 2nd dim is c(A1)
$ conf.upper: num [1, 1, 1:2] 0.949 1.056 #the 2nd dim is c(A1)
$ detrended : num [1, 1:13, 1:2] 4.11 1.45 -2.21 -1.87 -1.53 ...
Please let me know if you have any suggestion, thanks!
Cheers,
An-Chi