This function calculates the posterior distribution of the latent variables and computes the expected values for different model configurations. It approximates expectations using methods like Gaussian-Legendre (GL), Monte Carlo (MC), or Trapezoidal (TI) methods.
Arguments
- serial
Integer, specifies the expected value to calculate (e.g., 1 to 6).
- model
Character, specifies the model type ("M0", "M1", "M2", etc.).
- method
Character, specifies the numerical method for approximation ("gl", "mc", or "ti").
- period
Numeric vector of length 2, defines the integration limits (e.g., `c(0, 1)`).
- par1
List, model parameters for each variable. Includes `delta_Lambda` and `delta_Lambda0`.
- gamma_par
Numeric vector, parameters for the gamma distribution, used for specific models (e.g., `c(2, 0.1)`).
- data
Matrix, observed data where rows represent samples and columns represent variables.
- n_samples
Integer, the number of random samples for Monte Carlo integration. Default is NULL.
- n_intervals
Integer, the number of intervals for Trapezoidal integration. Default is NULL.
- n_points
Integer, the number of points for Gaussian-Legendre integration. Default is NULL.
