Estimate the conditional expectation for a STAR process under a generic link function g.
expectation_gRcpp(g_a_j, g_a_jp1, mu, sigma, Jmax)
y_hat m x 1
vector of conditional expectations
Jmax x 1
vector of g(a(j))
Jmax x 1
vector of g(a(j + 1))
m x 1
vector of conditional expectations
m x 1
vector of conditional standard deviations
m x 1
vector of maximum integer values to consider