X-DataInitiative / tick

Module for statistical learning, with a particular emphasis on time-dependent modelling
https://x-datainitiative.github.io/tick/
BSD 3-Clause "New" or "Revised" License
484 stars 105 forks source link

constrainsts on HawkesExpKern #460

Open sumau opened 4 years ago

sumau commented 4 years ago

Hey I'm trying to recreate the approach in this paper: https://scholar.harvard.edu/files/bgreen/files/jama-iternmed-17.pdf They use a multivariate hawkes model with an exponential kernel where the baselines are identical for all dimensions and the adjacency is identical for all neighbours. I was wondering if there was a way of tweaking the tick library, perhaps the LearnerOptim() class, to set constraints? Examples:

  1. Baseline is identical for all nodes
  2. Adjacency is zero for specific elements and identical for the other elements

Thanks!

KristenMoore commented 4 years ago

I would also like constrain some adjacency elements to be zero and the rest to be positive. Did you get anywhere with this @samau?

sumau commented 4 years ago

@KristenMoore I wrote a new Learner in Python. It's not very flexible but you're welcome to use it: https://bitbucket.org/soumau/network_contagion/src/master/src/hawkesexpkernelidentical.py

I'm using it to infer contagion in a network of nodes. It assumes that: (1) Baseline is identical for all nodes (2) Adjacency is identical for neighbours and zero otherwise

KristenMoore commented 4 years ago

Thanks a lot for sharing this, @sumau. I'll try to adapt it to my case.