More comlex regression models: Terminology and Software

#1
Hi,
I would like to couple two regression models and solve them simultaneously. That means: I have one regression equation:

\( \hat Y_i = \hat \alpha_0 + \hat \alpha_1 X_i \) with
\( Y_i \sim N(\hat Y_i, \sigma_1^2) \)

and \( \hat Y_i \) is again the predictor in a second regression model:

\( \hat Z_i = \hat \beta_0 + \hat \beta_1 \hat Y_i \) with
\( Z_i \sim N(\hat Z_i, \sigma_2^2) \)

The idea is that I want to propagate the uncertainties connected with \( \hat Y_i \) to the final confidence intervals for \( \hat Z_i \).

Does somebody know how such "coupled models" are named? And are there packages in R to solve them, or do you know other statistical software for that?

Many thanks in advance for any help!