I have a formal model from which I'm deriving some parameters that I would like to estimate. I haven't done this kind of thing before, and I'd like to have some help to solve this issue in R. I observe $z_i$ (money) and four characteristics of population. I want to regress these characteristics on $z_i$. My regression model should be $$z_i = \frac{\beta N}{\gamma} \ \textbf{1}_{\{\text{type 1}\}} + (\tilde{\alpha} + \tilde{\beta}) \frac{\beta N}{\gamma} \ \textbf{1}_{\{\text{type 2}\}} + (1 - \tilde{\beta}) \frac{\beta N}{\gamma} \ \textbf{1}_{\{\text{type 3}\}} + (\tilde{\alpha}) \frac{\beta N}{\gamma} \ \textbf{1}_{\{\text{type 4}\}} + \epsilon_i$$ where $\epsilon \sim N(\mu, \sigma^2)$
I want the weighting parameters $\tilde{\alpha}$ and $\tilde{\beta}$ to be obtained from a OLS regression, and I want all my coefficients to sum to 1.
Parameters in the equation above are not identified, so I propose to solve this by re-parametrization:$$D_1 = \frac{\beta N}{\gamma} \quad D_2 = (\tilde{\alpha} + \tilde{\beta}) \frac{\beta N}{\gamma} \quad D_3 = (1 - \tilde{\beta}) \frac{\beta N}{\gamma} \quad D_4 = (\tilde{\alpha}) \frac{\beta N}{\gamma}$$
From this I can find $$\frac{D_2}{D_1} = \tilde{\alpha} + \tilde{\beta} \qquad \frac{D_3}{D_1} = 1 - \tilde{\beta} \qquad \frac{D_4}{D_1} = \tilde{\alpha}$$
I want to estimate the equation above in R to get $\tilde{\alpha}$ and $\tilde{\beta}$. How can I do that?
Thanks