Dear all,
I want to build a spatio-temporal model to combine point and area data.
So far I used the code for a spatial model from Paula Moraga's paper: "A geostatistical model for combined analysis of point-level and area-level data using INLA and SPDE" (see below).
I have point data , measured at 240 monitoring stations per week over 5 years. I want to model the data as time series, hence I want to group it by Time:
weather_data<-weather_data %>% mutate(Time=(Year-min(Year))*52+Week)
A_points<-inla.spde.make.A(mesh, loc=as.matrix(weather_data[,c("Longitude","Latitude")]), group = weather_data$Time)
index_point<- inla.spde.make.index("field_point", n.spde=spde.nonstat$n.spde,
n.group = dim(A_points)[2]/spde.nonstat$n.spde)
Now I have to code the observation matrix for the area data. The data is given per state/block for each week over 5 years for several age groups. I checked which mesh vertices are in which block. But now I do not really understand how the grouping should work.
My spatial version is:
A_area<-inla.spde.make.A(mesh, loc=as.matrix(area_loc@coords[,1:2]), block=block, block.rescale="sum")
index_area<- inla.spde.make.index("field_area", n.spde=spde.nonstat$n.spde)
I would appreciate help a lot!
Thanks,
Corinna