1. A method for operating a memory that includes a plurality of analog memory cells, comprising: storing data in the memory by writing first storage values to the cells; reading second storage values from the cells and estimating a Cumulative Distribution Function (CDF) of the second storage values; processing the estimated CDF so as to compute one or more thresholds; and performing a memory access operation on the cells using the one or more thresholds.