mosum.local_prune
¶
Module Contents¶
Functions¶
|
Multiscale MOSUM algorithm with localised pruning |
|
|
|
|
|
|
|
- mosum.local_prune.multiscale_localPrune(x, G=None, max_unbalance=4, threshold='critical_value', alpha=0.1, threshold_function=None, criterion='eta', eta=0.4, epsilon=0.2, rule='pval', penalty='log', pen_exp=1.01, do_confint=False, level=0.05, N_reps=1000)¶
Multiscale MOSUM algorithm with localised pruning
- xlist
input data
- Gint
- vector of bandwidths; given as either integers less than len(x)/2,
or numbers between 0 and 0.5 describing the moving sum bandwidths relative to len(x)
- max_unbalancefloat
a numeric value for the maximal ratio between maximal and minimal bandwidths to be used for candidate generation, at least 1
- thresholdStr
indicates which threshold should be used to determine significance. By default, it is chosen from the asymptotic distribution at the given significance level ‘alpha`. Alternatively it is possible to parse a user-defined function with ‘threshold_function’.
- alphafloat
numeric value for the significance level with ‘0 <= alpha <= 1’; use iff ‘threshold = “critical_value”’
- threshold_functionfunction
criterion : Str
indicates how to determine whether each point ‘k’ at which MOSUM statistic exceeds the threshold is a change point; possible values are ‘eta’ : there is no larger exceeding in an ‘eta*G’ environment of ‘k’ ‘epsilon’ : ‘k’ is the maximum of its local exceeding environment, which has at least size ‘epsilon*G’
- etafloat
a positive numeric value for the minimal mutual distance of changes, relative to moving sum bandwidth (iff ‘criterion = “eta”’)
- epsilonfloat
a numeric value in (0,1] for the minimal size of exceeding environments, relative to moving sum bandwidth (iff ‘criterion = “epsilon”’)
- ruleStr
Choice of sorting criterion for change point candidates in merging step. Possible values are: ‘pval’ : smallest p-value ‘jump’ : largest (rescaled) jump size
- penaltyStr
Type of penalty term to be used in Schwarz criterion; possible values are: ‘log’ : use ‘penalty = log(len(x))**pen_exp’ ‘polynomial’ : use ‘penalty = len(x)**pen_exp’
- pen_expfloat
penalty exponent
- do_confintbool
flag indicating whether to compute the confidence intervals for change points
- levelfloat
use iff ‘do_confint = True’; a numeric value (‘0 <= level <= 1’) with which ‘100(1-level)%’ confidence interval is generated
- N_repsint
use iff ‘do.confint = True’; number of bootstrap replicates to be generated
multiscale_cpts object containing x : list
input data
- Gint
bandwidth vector
- threshold, alpha, threshold_function, eta
input
- cptsndarray
estimated change point
- cpts_infoDataFrame
information on change points, including detection bandwidths, asymptotic p-values, scaled jump sizes
- pooled_cptsndarray
change point candidates
- do_confintbool
input
- ci
confidence intervals
>>> import mosum >>> xx = mosum.testData("mix")["x"] >>> xx_m = mosum.multiscale_localPrune(xx, G = [8,15,30,70]) >>> xx_m.summary() >>> xx_m.print()
- mosum.local_prune.local_prune(x, all_cpts, rule, log_penalty, pen_exp)¶
- mosum.local_prune.local_env(j, est_cpts_ind, all_cpts, current, ac)¶
- mosum.local_prune.dup_merge(all_cpts)¶
- mosum.local_prune.detect_interval(all_cpts, est_cpts)¶