| trend_wrapper | R Documentation |
Wraps the three single-change tests that hydrology and climatology use as
their standard vocabulary, from the trend package. All three test
H_0: no change against a single change in the mean, differing in how
they measure it:
"pettitt"a rank-based (Mann-Whitney) statistic, distribution-free and robust to outliers.
"buishand"the Buishand range test, based on rescaled adjusted partial sums; assumes normality.
"snht"the standard normal homogeneity test of Alexandersson, the reference method for detecting inhomogeneities in climate records.
Each reports a location and a p-value, and, unlike most engines here, that p-value is valid, because the location was not chosen from a larger model search.
trend_wrapper(x, test = c("pettitt", "buishand", "snht"), alpha = 0.05, ...)
x |
A numeric vector. |
test |
Which test to run. Defaults to |
alpha |
Significance level below which the changepoint is reported.
Defaults to |
... |
Additional arguments passed to the trend function. |
A ggcpt object with the test's p_value and
statistic on the changepoints tibble. The per-position test
statistic is available through cpt_statistic().
pettitt1979testggchangepoint
\insertRefbuishand1982testsggchangepoint
\insertRefalexandersson1986snhtggchangepoint
Other changepoint engines:
bcp_wrapper(),
beast_wrapper(),
bfast_wrapper(),
binsegrcpp_wrapper(),
bocpd_wrapper(),
capa_wrapper(),
cpm_wrapper(),
cpop_wrapper(),
cpt_wrapper(),
decafs_wrapper(),
ecp_wrapper(),
envcpt_wrapper(),
esac_wrapper(),
fabisearch_wrapper(),
fastcpd_wrapper(),
fcov_wrapper(),
fmean_wrapper(),
fpop_wrapper(),
geomcp_wrapper(),
hdcov_wrapper(),
hdreg_wrapper(),
idetect_wrapper(),
inspect_wrapper(),
kcp_wrapper(),
kwc_wrapper(),
mcp_wrapper(),
mosum_wrapper(),
network_wrapper(),
not_wrapper(),
npmojo_wrapper(),
nsp_wrapper(),
ocd_wrapper(),
pilliat_wrapper(),
segmented_wrapper(),
smuce_wrapper(),
sn_wrapper(),
strucchange_wrapper(),
taylor_wrapper(),
tguh_wrapper(),
var_wrapper(),
wbs2_wrapper(),
wbs_wrapper(),
wbsts_wrapper()
set.seed(2026)
x <- c(rnorm(60), rnorm(60, 2))
trend_wrapper(x, test = "pettitt")
trend_wrapper(x, test = "snht")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.