Maximum likelihood estimation of Poisson and Hawkes processes and extensions to Hawkes process analysis