tick.simulation
¶This module provides basic tools for the simulation of model weights and features matrices. This is particularly useful to test optimization algorithms, and to compare the statistical properties of inference methods.
Here are functions for the simulation of model weights.
|
Sparse and exponential model weights generator |
|
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 |
Example
import matplotlib.pyplot as plt
from tick.simulation import weights_sparse_exp, weights_sparse_gauss
n_features = 100
weights1 = weights_sparse_exp(n_features, nnz=20)
weights2 = weights_sparse_gauss(n_features, nnz=10)
plt.figure(figsize=(10, 3))
plt.subplot(1, 2, 1)
plt.stem(weights1)
plt.subplot(1, 2, 2)
plt.stem(weights2)
plt.tight_layout()
plt.show()
(Source code, png, hires.png, pdf)
Here are functions for the simulation of a features matrix: each simulated vector or features is distributed as a centered Gaussian vector with a particular covariance matrix (uniform symmetrized or toeplitz).
|
Normal features generator with uniform covariance |
|
Normal features generator with toeplitz covariance |