SUBROUTINE HNRM1(NT,X,Y,H,HPRI,HBPRI,BETA) C This routine simulates one draw from the coefficient posterior C distribution arising from a regression model with a single regressor, C known heteroscedasticity, and a normal prior for the coefficient. C Inputs: C NT Number of observations C X NTx1 regressor vector C Y NTx1 vector of dependent variables C H NTx1 vector of disturbance precisions C HPRI Prior precision of coefficient C HBPRI [Prior precision]x[Prior mean] C Output: C BETA Draw from posterior distribution IMPLICIT REAL*8 (A-H,O-Z) DIMENSION X(NT),Y(NT),H(NT) AA=HPRI BB=HBPRI DO 10 IT=1,NT CC=H(IT)*X(IT) AA=AA+CC*X(IT) 10 BB=BB+CC*Y(IT) HPOST=AA VPOST=1.0D0/AA BPOST=VPOST*BB BETA=BPOST+DSQRT(VPOST)*DRNNOF() RETURN END