Data Fusion model using STAN


I came across a wonderful chapter on data fusion model using STAN.
Fusion Modeling

The chapter describes two types of data fusion problems, and the authors provide some STAN codes. HOWEVER, they only provide the STAN code for the first type of classic data fusion problem.

May I ask someone here to provide some help on the STAN code for the second type, mixed levels of data aggregation? What I get stuck on is the part where there is a summation constraint for the missing (and imputed) variables. I do not know where in STAN for that summation constraint to appear.

Any help would be much appreciated! Thanks.

I read the referenced link provided and found it difficult to understand as he is not clear enough about data imputation and fusion.
About data imputation or missing data, the Stan user manual is a very good source, and I would recommend it first.
Data fusion for normal distributed data is handled here:

In case you have missing data in all sensors. => Use data imputation
In case you have missing data in some sensors. => Use data fusion in known sensors or provide the known sensor.

Thanks. But the user manual did not help me.

To me, the challenge is how to set up Stan for this likelihood in the mixed levels of data aggregation problem: