# Appropriate technique to extract the response function of a time series to two (or more) irregularly recurring stimuli

Say I poll a teenager every day about his overall happiness. Perhaps this has some long term trend, perhaps it has some short term trend. For sure, it is a noisy variable. Over the relevant time period, the teenager experiences two kinds of stimuli at known, but irregularly spaced, times: he has to take statistics exams and he gets to go to school dances.

I would hypothesize that the lead up to an exam should have a continuous impact on his happiness. Then, perhaps, there is a jump in happiness at the instant of the exam. And then there is a continuous impact after the exam. (I would expect the lead-in and exit patterns to be reasonably well contained to the time period around the "exam event").

And I would hypothesize that there is an analogous (but different in detail) kind of pattern around school dances.

So after a year or two, I'll have:

• Happiness measurements at each time
• A list of times at which exams are administered
• A list of times at which dances occurred
• Some beliefs about the continuity and localization of the expected response of happiness to the given types of stimuli as described above.

What would be an appropriate statistical technique to estimate the "shape" of the happiness response function in the vicinity of an exam and, separately, in the vicinity of a dance?

I am willing to assume that the observed impact on happiness of exams and dances should be the sum of the impacts that would be observed in the presence of each separately. However, in practice, I expect that a substantial portion of my observations will be simultaneously impacted by more than one stimulus. (I.e. dances and exams are not sufficiently separated in time to guarantee that any given happiness measurement is impacted by only a single event.)

## 1 Answer

This may be overly simplistic for what you’re looking for, but you could settle on a set “vicinity” (say, from a week before to a week after) for the exam/dance, and look at the distribution of happiness measurements (I assume something akin to a Likert scale?) in that vicinity for each. Then you’d be able to look at the normality/mean/variance/etc. for the exam vicinity and for the dance vicinity (both perhaps right-skewed under your assumption of a brief spike in happiness right before and then a slow tapering off afterwards) and make comparisons between them as you see fit. I personally wouldn’t try to parse out the effect of exams from that of dances since the assumption of a strictly independent relationship between the two (together with many other factors…) seems unlikely with regard to happiness, but defining the distributions as above would account for this somewhat since exams that are closer to dances would presumably have higher happiness measures, those that are farther apart would have lower ones, and vice versa. If you wanted to compare the happiness measures before to those after you could do the same, just subsetting the data by when they occurred (say, comparing measures in the week before to those in the week after).