I am studying how to use the
pettitt.test function from the
trend package in R to detect change-point in a time-series. However, after testing this function on some example datasets, I noticed that sometimes the p-value is larger than one. Below is an example.
library(trend) # Example vector vec <- c(-0.2, -0.2, -1.8, -0.3, 1.5, -0.2, -0.2, 1.2, -1, 1.2, -1, -0.5, 1.1, -1.2) pettitt.test(vec)
Pettitt's test for single change-point detection data: vec U* = 17, p-value = 1.109 alternative hypothesis: two.sided sample estimates: probable change point at time K 10
I thought the p-value should be a number from 0 to 1. Are there any reasons why this function generates a p-value larger than 1?