API Reference

This is the full class and function references of tick. Please look at the modules documentation cited below for more examples and use cases, since direct class and function API is not enough for understanding their uses.

tick.hawkes

This module provides tools for the inference and simulation of Hawkes processes.

User guide: tick.hawkes

Learners

HawkesExpKern(decays[, gofit, penalty, C, …])

Hawkes process learner for exponential kernels with fixed and given decays, with many choices of penalization and solvers.

HawkesSumExpKern(decays[, penalty, C, …])

Hawkes process learner for sum-exponential kernels with fixed and given decays, with many choices of penalization and solvers.

HawkesEM([kernel_support, kernel_size, …])

This class is used for performing non parametric estimation of multi-dimensional Hawkes processes based on expectation maximization algorithm.

HawkesADM4(decay[, C, lasso_nuclear_ratio, …])

A class that implements parametric inference for Hawkes processes with an exponential parametrisation of the kernels and a mix of Lasso and nuclear regularization

HawkesBasisKernels(kernel_support[, …])

This class is used for performing non parametric estimation of multi-dimensional Hawkes processes based on expectation maximization algorithm and the hypothesis that kernels are linear combinations of some basis kernels.

HawkesSumGaussians(max_mean_gaussian[, …])

A class that implements parametric inference for Hawkes processes with parametrisation of the kernels as sum of Gaussian basis functions and a mix of Lasso and group-lasso regularization

HawkesConditionalLaw([delta_lag, min_lag, …])

This class is used for performing non parametric estimation of multi-dimensional marked Hawkes processes based on conditional laws.

HawkesCumulantMatching(integration_support)

This class is used for performing non parametric estimation of multi-dimensional Hawkes processes based cumulant matching.

Simulation

Time function

base.TimeFunction(values[, border_type, …])

A function depending on time.

Hawkes kernels

HawkesKernelExp(intensity, decay)

Hawkes kernel with exponential decay

HawkesKernelSumExp(intensities, decays)

Hawkes kernel with sum exponential decays

HawkesKernelPowerLaw(multiplier, cutoff, …)

Hawkes kernel for power law

HawkesKernelTimeFunc([time_function, …])

Hawkes kernel defined by an arbitrary time function.

Simulation of point processes

SimuPoissonProcess(intensities[, end_time, …])

Homogeneous Poisson process simulation

SimuInhomogeneousPoisson(intensities_functions)

Inhomogeneous Poisson process simulation

SimuHawkes([kernels, baseline, n_nodes, …])

Hawkes process simulation

SimuHawkesExpKernels(adjacency, decays[, …])

Hawkes process with exponential kernels simulation

SimuHawkesSumExpKernels(adjacency, decays[, …])

Hawkes process with sum-exponential kernels simulation

SimuHawkesMulti(hawkes_simu, n_simulations)

Parallel simulations of a single Hawkes simulation

Models

ModelHawkesExpKernLogLik(decay[, n_threads])

Hawkes process model exponential kernels with fixed and given decay.

ModelHawkesExpKernLeastSq(decays[, approx, …])

Hawkes process model exponential kernels with fixed and given decays.

ModelHawkesSumExpKernLogLik(decays[, n_threads])

Hawkes process model for sum of exponential kernels with fixed and given decays.

ModelHawkesSumExpKernLeastSq(decays[, …])

Hawkes process model for sum-exponential kernels with fixed and given decays.

tick.linear_model

This modules provides tools for the inference and simulation of generalized linear models.

User guide: tick.linear_model

Learners

LinearRegression([fit_intercept, penalty, …])

Linear regression learner, with many choices of penalization and solvers.

LogisticRegression([fit_intercept, penalty, …])

Logistic regression learner, with many choices of penalization and solvers.

PoissonRegression([step, fit_intercept, …])

Poisson regression learner, with exponential link function.

Models

ModelLinReg([fit_intercept, n_threads])

Least-squares loss for linear regression.

ModelLogReg([fit_intercept, n_threads])

Logistic regression model for binary classification.

ModelPoisReg([fit_intercept, link, n_threads])

Poisson regression model with identity or exponential link for data with a count label.

ModelHinge([fit_intercept, n_threads])

Hinge loss model for binary classification.

ModelSmoothedHinge([fit_intercept, …])

Smoothed hinge loss model for binary classification.

ModelQuadraticHinge([fit_intercept, n_threads])

Quadratic hinge loss model for binary classification.

Simulation

SimuLinReg(weights[, intercept, features, …])

Simulation of a Linear regression model

SimuLogReg(weights[, intercept, features, …])

Simulation of a Logistic regression model

SimuPoisReg(weights[, intercept, features, …])

Simulation of a Poisson regression model, with identity or exponential link.

tick.robust

This module provides tools for robust inference, namely outliers detection and models such as Huber regression, among others robust losses.

User guide: tick.robust

Tools for robust inference and outliers detection

RobustLinearRegression(C_sample_intercepts)

Robust linear regression learner.

std_mad(x)

Robust estimation of the standard deviation, based on the Corrected Median Absolute Deviation (MAD) of x.

std_iqr(x)

Robust estimation of the standard deviation, based on the inter-quartile (IQR) distance of x.

Robust losses

ModelHuber([fit_intercept, threshold, n_threads])

Huber loss for robust regression.

ModelModifiedHuber([fit_intercept, n_threads])

Modified hinge loss model for binary classification.

ModelAbsoluteRegression([fit_intercept, …])

Absolute value (L1) loss for linear regression.

ModelEpsilonInsensitive([fit_intercept, …])

Epsilon-Insensitive loss for robust regression.

ModelLinRegWithIntercepts([fit_intercept, …])

Linear regression model with individual intercepts.

tick.survival

This module provides tools for inference and simulation for survival analysis.

User guide: tick.survival

Inference

CoxRegression([penalty, C, solver, step, …])

Cox regression learner, using the partial Cox likelihood for proportional risks, with many choices of penalization.

nelson_aalen(timestamps, event_observed)

Computes the Nelson-Aalen cumulative hazard rate estimation given by:

kaplan_meier(timestamps, event_observed)

Computes the Kaplan-Meier survival function estimation given by:

Models

ModelCoxRegPartialLik()

Partial likelihood of the Cox regression model (proportional hazards).

ModelSCCS(n_intervals, n_lags)

Discrete-time Self Control Case Series (SCCS) likelihood.

Simulation

SimuCoxReg(coeffs[, features, n_samples, …])

Simulation of a Cox regression for proportional hazards

tick.prox

This module contains all the proximal operators available in tick.

User guide: See the tick.prox section for further details.

prox.ProxZero([range])

Proximal operator of the null function (identity)

prox.ProxL1(strength[, range, positive])

Proximal operator of the L1 norm (soft-thresholding)

prox.ProxL1w(strength, weights[, range, …])

Proximal operator of the weighted L1 norm (weighted soft-thresholding)

prox.ProxElasticNet(strength, ratio[, …])

Proximal operator of the ElasticNet regularization.

prox.ProxL2Sq(strength[, range, positive])

Proximal operator of the squared L2 norm (ridge penalization)

prox.ProxL2(strength[, range, positive])

Proximal operator of the L2 penalization.

prox.ProxMulti(proxs)

Multiple proximal operator.

prox.ProxNuclear(strength[, n_rows, range, …])

Proximal operator of the nuclear norm, aka trace norm

prox.ProxPositive([range, positive])

Projection operator onto the half-space of vectors with non-negative entries

prox.ProxEquality([strength, range, positive])

Projection operator onto the set of vector with all coordinates equal (or in the given range if given one).

prox.ProxSlope(strength[, fdr, range, positive])

Proximal operator of Slope penalization.

prox.ProxTV(strength[, range, positive])

Proximal operator of the total-variation penalization

prox.ProxBinarsity(strength, blocks_start, …)

Proximal operator of binarsity.

prox.ProxGroupL1(strength, blocks_start, …)

Proximal operator of group-L1, a.k.a group-Lasso.

tick.solver

This module contains all the solvers available in tick.

User guide: See the tick.solver section for further details.

Batch solvers

solver.GD([step, tol, max_iter, linesearch, …])

Proximal gradient descent

solver.AGD([step, tol, max_iter, …])

Accelerated proximal gradient descent

solver.BFGS([tol, max_iter, verbose, …])

Broyden, Fletcher, Goldfarb, and Shanno algorithm

solver.GFB([step, tol, max_iter, surrelax, …])

Generalized Forward-Backward algorithm

solver.SCPG([step, tol, max_iter, verbose, …])

Self-Concordant Proximal Gradient descent

Stochastic solvers

solver.SGD([step, epoch_size, rand_type, …])

Stochastic gradient descent solver

solver.AdaGrad([step, epoch_size, …])

Adaptive stochastic gradient descent solver

solver.SVRG([step, epoch_size, rand_type, …])

Stochastic Variance Reduced Gradient solver

solver.SAGA([step, epoch_size, rand_type, …])

Stochastic Average Gradient solver, for the minimization of objectives of the form

solver.SDCA(l_l2sq[, epoch_size, rand_type, …])

Stochastic Dual Coordinate Ascent

History

solver.History()

A class to manage the history along iterations of a solver

tick.simulation

This module contains basic tools from simulation.

User guide: See the tick.simulation section for further details.

Weights simulation

simulation.weights_sparse_exp([n_weigths, …])

Sparse and exponential model weights generator

simulation.weights_sparse_gauss([n_weights, …])

Sparse and gaussian model weights generator Instance of weights for a model, given by a sparse vector, where non-zero coordinates (chosen at random) are centered Gaussian with given standard-deviation

Features simulation

simulation.features_normal_cov_uniform([…])

Normal features generator with uniform covariance

simulation.features_normal_cov_toeplitz([…])

Normal features generator with toeplitz covariance

tick.plot

This module contains some utilities functions for plotting.

User guide: See the tick.plot section for further details.

Functions

plot.plot_history(solvers[, x, y, labels, …])

Plot the history of convergence of learners or solvers.

plot.plot_hawkes_kernels(kernel_object[, …])

Generic function to plot Hawkes kernels.

plot.plot_hawkes_kernel_norms(kernel_object)

Generic function to plot Hawkes kernel norms.

plot.plot_basis_kernels(learner[, support, …])

Function used to plot basis of kernels

plot.plot_timefunction(time_function[, …])

Quick plot of a tick.base.TimeFunction

plot.plot_point_process(point_process[, …])

Plot point process realization

plot.stems(ys[, titles, sync_axes, …])

Plot several stem plots using either matplotlib or bokeh rendering.

tick.dataset

This module provides easy access to some datasets used as benchmarks in tick.

User guide: See the tick.dataset section for further details.

dataset.fetch_tick_dataset(dataset_path[, …])

Fetch dataset from tick_datasets github repository.

dataset.fetch_hawkes_bund_data()

Load Hawkes formatted bund data from https://github.com/X-DataInitiative/tick-datasets/tree/master/hawkes/bund

tick.preprocessing

This module contains some utilities functions for preprocessing of data.

User guide: See the tick.preprocessing section for further details.

Classes

preprocessing.FeaturesBinarizer([method, …])

Transforms continuous data into bucketed binary data.

preprocessing.LongitudinalFeaturesProduct([…])

Transforms longitudinal exposure features to add the corresponding product features.

preprocessing.LongitudinalFeaturesLagger(n_lags)

Transforms longitudinal exposure features to add columns representing lagged features.

tick.metrics

This module contains some functions to compute some metrics that help evaluate the performance of learning techniques.

User guide: See the tick.metrics section for further details.

metrics.support_fdp(x_truth, x[, eps])

Computes the False Discovery Proportion for selecting the support of x_truth using x, namely the proportion of false positive among all detected positives, given by FP / (FP + TP).

metrics.support_recall(x_truth, x[, eps])

Computes proportion of true positives (TP) among the number ground truth positives (namely TP + FN, where FN is the number of false negatives), hence TP / (TP + FN).