inlabru-org / inlabru

inlabru
https://inlabru-org.github.io/inlabru/
73 stars 21 forks source link

Modelling time series data #160

Closed coedekoven closed 1 year ago

coedekoven commented 1 year ago

Hi Finn,

I am trying to modelling the time series data using inlabru; more specifically I have start times of cetacean vocalizations obtained from single hydrophone recordings as well as start times of military sonar pings from the same recording device. I am trying to identify potential effects of military sonar on acoustic detections of cetacean vocalizations. As I have the start times of both types of detections, I think it would be beneficial to model this process using lgcp() (rather than bru() - which I believe is the equivalent of glm()). I have been working through your workshop materials and practicals, however, two quite fundamental questions remain:

  1. what would be a suitable correlation structure for a time series? Would you go with matern where distances are measured in seconds or minutes (whatever the time unit will be)? Do you have to worry about that the flow of time is in one direction, i.e. future events don't have an effect on current or past events?

  2. how do you set up a covariate which is essentially a point process itself for a time series? Is it using the fields function?

Looking forward to hearing from you. Cheers, Cornelia

finnlindgren commented 1 year ago

lgcp() is just a simple wrapper function for single-likelihood models; It essentially does bru(components, like(formula, family="cp", ...)) ("cp" for Cox process), so you can just as well use bru() directly; makes it easier if you want to expand to multilikelihood models (like include marks for the points).

For a time-stationary Poisson point process, the direction of time doesn't matter. It's only when things like self-excitation (Hawkes processes) come in where that makes a difference (we're working on getting a Hawkes processes likelihood implementation aimed at earthquake modelling into the package; current research project). So I'd a general Matern spde, preferably with inla.mesh.1d(..., degree=2) so that the function is more smooth than for degree=1.

For the covariate question I'd need to see more details of what model structure you're referring to. If the response is a point process, you need to have the covariates available at every time, regardless of whether there is a point there or not, so I'm not sure what you mean by "a covariate which is essentially a point process itself".