I am modelling an option value model of retirement, see for instance Stock and Wise (1990). I am however not sure to which class of problems this model falls into and hence which optimization method I should consider to solve for the issue. To clarify what I mean, I will first describe the model:
The objective is to find probabilities of retiring in a specific year, and the parameters $\rho$, $\gamma$, $k$, $\beta$ in: \begin{eqnarray} Pr[\text{retire}_t] & = & Pr[ g_t( r^{*}_t ) / K_t( r^{*}_t ) < - v_t ], \\ v_{s} & = & \rho v_{s-1} + \epsilon_t \\ g_t(r_t) & = & \sum^{r-1}_{s=t} \beta^{s-t} \pi(s|t) E_t(Y_s^{\gamma}) + \sum^{S}_{s=r} \beta^{s-t} \pi(s|t) E_t( [k B_s(r)]^{\gamma} ) \\ & - & \sum^{S}_{s=r} \beta^{s-t} \pi(s|t) E_t( [ k B_s(t)]^{\gamma} ), \\ K_t( r_t ) & = & \sum^{r-1}_{s=t} \beta^{s-t} \pi(s|t) \rho^{s-t}, \\ v_t & = & (\omega_t - \xi_t ) \end{eqnarray} Here $Y_s$ are future wages and $B_s(t)$ are retirement incomes with $\pi(s|t)$ the probability that a person will live in year s given that she or he lives in year $t$. $r^{*}_t$ is the year in which the value of future stream of income is maximized. The value of future stream of income if retirement is at age $r$ is given by: \begin{eqnarray} V_t(r) & = & \sum^{r-t}_{s=t} \beta^{s-t} U_w(Y_s) + \sum^{S}_{s=r} \beta^{s-t} U_r[B_s(r)], \\ U_w(Y_s) & = & Y_s^{\gamma} + \omega_s, \\ U_r(B_s) & = & [ k B_s(r)]^{\gamma} + \xi_s, \\ \omega_s & = & \rho \omega_{s-1} + \epsilon_{\omega,s} \\ \xi_s & = & \rho \xi_{s-1} + \epsilon_{\xi, s} \end{eqnarray}
Usually one could solve such issues by considering it as a dynamic factor model or with maximum likelihood. However the summation $\sum$ makes it tricky as the 'optimal' date of retirment $r$ is a parameter itself.
So in short, how would you classify this problem and which optimization techniques do you recommend? Do you perhaps know packages or know where I can find a code to solve for this?