Understanding impact of contrast matrix specification for hierarchical GP regression model

I have attached code that generates time series data according a hierarchical GP regression model structure. The code then models the simulated data using a hierarchical GP regression model that is identical to the generative model. The only variable in this simulation is the choice of contrast matrix. Each unit (participant) in the simulation generates a waveform for each of two conditions. One can model these waveforms by using a 0/1 contrast matrix such that the waveform from each condition is modelled independently. Conversely, one can model the waveform of each condition as the sum of some intercept waveform and half some effect waveform (the difference between the two conditions).

My simulations appear to indicate that the choice of contrast matrix does not seem to matter. However, I am trying to understand why that is. Shouldn’t a 0/1 contrast matrix fail to account for within-subject variability, which would be accounted for my an intercept/effect representation?

To add, you all will notice that the hierarchical GP regression model accounts for heteroscedastic noise. The population noise functions and the population mean functions are both modelled as GPs within the context of the hierarchical model.

Please let me know if you would like anything at all about my question clarified. Any sort of insight would be greatly appreciated.

Thank you,

Ghislain

gp_regression.stan (7.1 KB)
comparing_contrast_analysis.R (27.5 KB)

1 Like

I saw that nobody has replied, but I’m afraid I’ve never hard of a contrast matrix (this just selects?). I’m definitely not enough of a GP expert to take this one on.

Is there a way you can isolate the question you’re trying to get at with simpler models? Questions with long attached programs are very challenging to answer, so tend to get ignored.