Skip to main content
. Author manuscript; available in PMC: 2022 Apr 1.
Published in final edited form as: IEEE Trans Affect Comput. 2019 Mar 15;12(2):306–317. doi: 10.1109/taffc.2019.2905211

Fig. 3.

Fig. 3.

Excerpt of Pyro code that learns a linear regression mapping appraisals to emotion ratings, with graphical representation on the right. We use plate notation: There are N independent observations of outcomes and emotion ratings, and the parameters β are constant and shared across the observations. The compute_appraisal() function takes in a representation of an outcome and returns an apptaisal (l. 3). We then sample regression coefficients βi for each dimension i from a Normal distribution, given parameters μi, σi (l. 4). We compute the estimated emotion rating (l. 5), and then condition on having observed the emotion rating in the data (l. 6), in order to infer the values of μi, σi.