Skip to contents

Summary statistics of a time series

Usage

ts_statistics(ts)

ts_hypothesis_test(ts, split_location = NULL)

ts_percentiles(ts, probabilities = c(0.05, 0.25, 0.5, 0.75, 0.95))

ts_duration(ts)

Arguments

ts

a corehydro_ts.

split_location

the 1-BASED position in the observed values to split at (Python's hypothesis_test() takes the 0-based position, each language following its own convention). NULL, the default, splits the record in half.

probabilities

the probabilities to report, in [0, 1].

Value

a named numeric vector, or for ts_duration() a data frame of percent and value.

Details

ts_statistics() returns the library's fifteen-entry summary (record length, missing count, minimum, maximum, the four product moments and seven percentiles). ts_hypothesis_test() returns the seven-test battery the container carries: Jarque-Bera for normality, Ljung-Box and Wald-Wolfowitz for independence, Mann-Whitney and Mann-Kendall for homogeneity, and a t-test and F-test comparing the two halves of the record. Note this is NOT the ten-test battery analysis_data_hypothesis_test() runs on a flood-frequency data frame – they are different methods with different splits.

Examples

ts <- time_series(as.Date("2000-01-01") + 0:11, c(22, 16, 33, 5, 12, 36, 48, 10, 18, 15, 22, 13))
ts_statistics(ts)
#>  Record Length Missing Values        Minimum        Maximum           Mean 
#>     12.0000000      0.0000000      5.0000000     48.0000000     20.8333333 
#>        Std Dev       Skewness       Kurtosis             1%             5% 
#>     12.4011241      1.0638222      0.6821818      5.5500000      7.7500000 
#>            25%            50%            75%            95%            99% 
#>     12.7500000     17.0000000     24.7500000     41.4000000     46.6800000