Based on the formula given in Jolliffe and Primo (2008) this function returns a vector with the right properties to test the presence of a linear deviate to flatness in a rank histogram.
deviate_linear(k)an integer. The number of components.
An rkhist object.
Although the deviate vector is not a rank histogram, this function returns
an rkhist object for the sake of simplicity. This allows for instance
to plot the vector.
Jolliffe, Ian T., and Cristina Primo. "Evaluating rank histograms using decompositions of the chi-square test statistic." Monthly Weather Review 136.6 (2008): 2133-2139. doi:https://doi.org/10.1175/2007MWR2219.1