Let X, Y two time series and $F_{i, \beta_i}$ the marginal distribution of residual of each time series and beta is vector of their parameter. I studied the dependence between this two series using copula it's a long study but if you want I can put it here.
For simplicity, I assume that
$X_t=\rho_1X_{t-1}+\varepsilon_{t,1}$ and $Y_t=\rho_2Y_{t-1}+\varepsilon_{t,2}$
or $\varepsilon_{t,1} \sim F_{1,\beta_1}$ and $\varepsilon_{t,3} \sim F_{2,\beta_2}$
in the last step in my study I need to calculate the conditional expectation to obtain forecasting value from my model based on copula.
When I was reading some articles I found that formula to calculate Conditional expectation
\begin{align*}
\widehat{X_{T+1,1}}&=E[X_{T+1,1}|, X_{T+1,2}=x_2]\\
&=\int_{0}^{1} xc_{\theta}\{F_{1,\beta_1}(x- \rho_1X_{T}),
F_{2,\beta_2}(Y_{T+1}-\rho_2Y_{T})\}\\~~&\times f_{1,\beta_1}(x_1- \rho_2X_{T})
\end{align*}
but really I can't get the idea on how can I calculate this in r I will be thankful for any information
Edit:
the data is two time series from 1961 to 2018
the first time series is growth rate annual and the second is annual electricity consumption I used copula to obtain the dependence between these two series and construct the model based on copula by these step:
1. Investigate each univariate time series separately, including the assessment of stationarity, time series model identification, and estimation of model parameters.
2. Compute model residuals from the fitted univariate time series model.\
3. Apply copulas to the model residuals obtained from step 2.
4. Reconstructed time series using the copula
5.forecasting based on this model(I have problem in this step)
I can send the data (excel file)to any one give me his email
Thank you for your time everyone.