Inference of unobserved event streams with neural Hawkes particle smoothing

1 INTRODUCTION . Event streams , i.e. , discrete events in continuous time , are often partially observed in the world . Given trained models of the complete data and the missingness mechanism , one can probabilistically predict the unobserved events , no matter whether they are missing at random ( MAR ) or missing not at random ( MNAR ) . Such an ability is useful in many applied domains : • Scientific experiments . Scientific findings rely heavily on experimental observations , but due to practical limitations , measurements are often incomplete . For example , a systems neuroscientist will miss all the neural spikes from unmonitored neurons , but these are imputable to some degree from spikes observed elsewhere in the system , providing a more complete picture of neural activity . • Medical records . Some patients keep a diary or use a smartphone app to log their behavior in between their hospital visits , but other patients don ’ t . Out-of-hospital events such as symptoms , self-administered medications , diet , and sleep may correlate with monitored inhospital events such as tests , diagnoses , and treatments . Inferring these events when they are not recorded may help doctors counsel patients . • Competitive games . In competitive games such as StarCraft and poker , a player does not have full information about what her opponents have done ( e.g. , build mines and train soldiers ) or acquired ( e.g. , certain cards ) . Correctly imputing what has happened “ what I did ” and “ what I saw he did ” would help the player make good decisions . Similar remarks apply to practical scenarios ( e.g. , military ) where multiple actors compete and/or cooperate . • User interface interactions . Many important user actions are not observed by the software . For example , users of an online news provider may have known what they need by reading an information-rich headline without clicking ( to read more details ) . Such events are expensive to observe ( e.g . via a gaze tracker ) thus often missing . However , imputing them ( to some extent ) given the observed events ( e.g . clicks ) would be useful , e.g. , helping the software to improve the user satisfaction in the long run . • Other partially observed event streams arise in online shopping , social media , etc . A flexible probabilistic model for complete event streams is the neural Hawkes process ( Mei & Eisner , 2017 ) , a recurrent neural model that allows past events to have complex influences on the type and timing of subsequent events . Suppose we have a trained version of this model , as well as a separate probability model ( the “ missingness mechanism ” ) that stochastically determines which of the events will be observed . We can then easily use Bayes ’ Theorem to define the posterior distribution over the complete sequence x t z given just the observed events x : see equation ( 3 ) below . However , it is computationally difficult to reason about this posterior distribution . In this paper we provide approximate methods for sampling complete sequences from the posterior . In the remainder of the introduction , we provide a high-level sketch of these methods . Mei & Eisner ( 2017 ) give an algorithm to sample a complete sequence from a neural Hawkes process . Each event in turn is sampled given the complete history of previous events . However , this algorithm only samples from the prior . We will adapt it into a particle filtering algorithm that samples from the posterior , i.e. , given all the observed events . The basic idea ( Figure 1a ) is to draw the events in sequence as before , but now we force any observed events to be “ drawn ” at the appropriate times . That is , we add the observed events to the sequence as they happen ( and they duly affect the distribution of subsequent events ) . There is an associated cost : if we are forced to draw an observed event that is improbable given its past history , we must downweight the resulting complete sequence accordingly , because evidently this particular past history—as determined by the previous draws— was inconsistent with the observed event , and hence can not be part of a high-likelihood complete sequence . Using this method , we sample many sequences ( or particles ) of different relative weights . Alas , this approach is computationally inefficient . Sampling a complete sequence that is actually probable under the posterior requires great luck , as the thinning algorithm must have the good fortune to draw only events that happen to be consistent with future observations . Such lucky particles would appropriately get a high weight relative to other particles . The problem is that we will rarely get such particles at all ( unless we sample a very large number of particles ) . To get a more accurate picture of the posterior , we can improve the method by drawing each event from a smarter distribution that is explicitly conditioned on the future observations ( rather than drawing the event in ignorance of the future and then downweighting the particle if the future does not turn out as hoped ) . This idea is called particle smoothing ( Doucet & Johansen , 2009 ) . How does it work in our setting ? The neural Hawkes process defines the distribution of the next event using the state of a continuoustime LSTM that has read the past history from left-to-right . When sampling a proposed event , we now use an modified distribution ( Figure 1b ) that also considers the state of a second continuoustime LSTM that has read the future observations from right-to-left . As this augmented distribution is imperfect—merely a proposal distribution—we still have to reweight our particles to match the actual posterior under the model . But this reweighting is not as drastic as for particle filtering , because the new proposal distribution was constructed and trained to resemble the actual posterior . Bidirectional recurrent neural networks have proven effective at predicting linguistic words and their properties given their left and right contexts ( Graves et al. , 2013 ; Bahdanau et al. , 2015 ; Peters et al. , 2018 ) : in particular , Lin & Eisner ( 2018 ) recently applied them to particle smoothing for sequence tagging , To our knowledge , however , this is the first time such an architecture has been extended to predict events in continuous time . 2 PRELIMINARIES1 . We consider a missing-data setting ( Little & Rubin , 1987 ) . We are given a fixed time interval [ 0 , T ] over which events can be observed . Each possible outcome in our probability distributions is a complete event sequence in which each event is designated as either observed or missing . The random variables Obs , Miss , and Comp refer respectively to the sets of observed events , missing events , and all events over [ 0 , T ] . Thus Comp = Obs t Miss , where t denotes disjoint union . Under the probability distributions we will consider , |Comp| is almost surely finite . We will observe Obs to be some particular set of events x = { k0 @ t0 , k1 @ t1 , k2 @ t2 , . . . , kI @ tI , kI+1 @ tI+1 } , where each ki ∈ { 1 , 2 , . . . , K } is an event type and 0 = t0 < t1 < t2 < . . . < tI < tI+1 = T are the times of occurrence in increasing order . This sequence always includes the special boundary events k0 @ t0 = BOS @ 0 ( “ beginning of sequence ” ) and kI+1 @ tI+1 = EOS @ T ( “ end of sequence ” ) . Following each observed event ki @ ti for 0 ≤ i ≤ I , we may hypothesize some Ji ≥ 0 unobserved events { ki,1 @ ti,1 , ki,2 @ ti,2 , . . . , ki , Ji @ ti , Ji } , where ti < ti,1 < ti,2 < . . . < ti , Ji < ti+1 . We may regard the subscript i as a shorthand for ( i , 0 ) , so the observed events are x = { ki , j @ ti , j : j = 0 } and the hypothesized unobserved ( missing ) events are z = { ki , j @ ti , j : j 6= 0 } . The hypothesized complete event stream x t z is thus indexed by pairs ` = 〈i , j〉 ordered lexicographically , where t ` ′ < t ` if ` ′ < ` . We write ` +1 for the index of the event immediately after ` , so 〈i , j〉+ 1 def= 〈i , j+ 1〉 when j < Ji and 〈i , j〉+ 1 def = 〈i+ 1 , 0〉 otherwise . Each event k ` @ t ` ( whether observed or not ) may be influenced by the history H ( t ` ) —the set of all observed and unobserved events that precede it , where we defineH ( t ) def= { k ` @ t ` : t ` < t } for any t ∈ [ 0 , T ] . We assume that the complete sequence Comp was first generated by a complete data model p , and then some of the events were censored ( marked as missing ) by a missingness mechanism pmiss : p ( Obs = x , Miss = z ) = p ( Comp = x t z ) · pmiss ( Miss = z | Comp = x t z ) ( 1 ) Furthermore , our complete data model ( such as a neural Hawkes process ) will take the factored form p ( Comp = x t z ) = ( I∏ i=0 Ji∏ j=0 p ( ki , j @ ti , j | H ( ti , j ) ) ) · p ( @ ≥T | H ( tI , JI ) ) ( 2 ) where p ( k ` @ t ` | H ( t ` ) ) is the probability density that the next event after H ( t ` ) occurs at time t ` and has type k ` , and p ( @ ≥T | H ( t ` ) ) is the probability that it occurs at some time ≥ T . In this paper , we will attempt to guess Miss by sampling z values from the posterior distribution p ( Miss = z | Obs = x ) ∝ p ( Comp = x t z ) · pmiss ( Miss = z | Comp = x t z ) ( 3 ) 1Our conventions of mathematical notation mainly follow those given by Mei & Eisner ( 2017 , section 2 ) . We may obviously drop the second factor of equation ( 3 ) if ( for the given x ) it is known to be a constant function of z . In this case , the events are said to be missing at random ( MAR ) . Otherwise , they are missing not at random ( MNAR ) Little & Rubin ( 1987 ) . It is often intractable to sample exactly from p ( z | x ) , because the first factor p ( xtz ) is complicated ( e.g . a neural net ) . The difficulty is that x and z can be interleaved with each other . As an alternative , we can use normalized importance sampling , drawing many z values from a proposal distribution q ( z | x ) and weighting them in proportion to p ( z|x ) q ( z|x ) . To make it easy to sample from q ( z | x ) , we adopt the following factored definition : q ( z | x ) = I∏ i=0 ( ( Ji∏ j=1 q ( ki , j @ ti , j | H ( ti , j ) , F ( ti , j ) ) ) · q ( @ ≥ ti+1 | H ( ti , Ji ) , F ( ti , Ji ) ) ) ( 4 ) This resembles equation ( 2 ) , but it conditions each proposed unobserved event not only on the history but also on the futureF ( ti , j ) def = { ki+1 @ ti+1 , . . . , kI+1 @ tI+1 } . This future consists of all the observed events that happen after ti , j , where in general F ( t ) def = { ki @ ti : t < ti } for any t ∈ [ 0 , T ] . Note the asymmetry with H ( t ) , which includes both observed and unobserved events . q ( z | x ) can be trained to approximate the target distribution p ( z | x ) , by making q ( · | H , F ) ≈ p ( · | H , F ) . We can sample z from q ( z | x ) in chronological order : for each 0 ≤ i ≤ I in turn , draw a sequence of Ji unobserved events that follow the observed event ki @ ti . This sequence ends ( thereby determining Ji ) if the next proposed event would have fallen after ti+1 and thus is preempted by the observed event ki+1 @ ti+1 . Specific p ( x t z ) and q ( z | x ) distributions will be introduced below .

Summary: The authors propose a particle smoothing approach with an approximate minimum Bayes risk decoder to impute missing events in the Neural Hawkes Process (NHP). The main goal is to address the missing events problem in continuous-time event analysis, which is an important problem in practice. The core idea is within the framework of particle smoothing.