I am basically trying to use the Mann-Kendall test for a trend in time series data (Daily data sets going back to about 1980).
The only part I cannot calculate with normal excel formulas is the second half of the formula for VaR(S) from this website..
http://tenyearsnow.wordpress.com/201...rical-example/
Basically, i want to calculate this figure at each data point, looking back at the previous n-1 points. I guess i should try and explain the rationale of this part of the equation...
If we had n=1 to 10 as the following data points.. 9,8,8,6,5,4,4,3,2,1 (obviously there would also be lots of preceding data points).
g is a tied group when, in a data set, 2 or more of the data is the same. so here we have two tied groups as there are two 8's and two 4's. For each tied group we need to calculate tp(tp-1)(tp+5), (where tp is the number of data points in each group g, so here both groups would have tp=2 as there are two 8's and two 4's).
Then summing together all tp(tp-1)(tp+5) for all g's withing the 10 data points.
The hard part is that i want to do this at every point in the data. I also want to test this for varying lengths, for example n=1 to 20, n=1 to 30 etc.
The furthest i have ever really got with VBA is Alt-F11, so any help will be most appreciated.
Bookmarks