check_gaussian_convergence | R Documentation |
Assesses the convergence of multivariate samples by monitoring the stability of the mean vector and covariance matrix over a sliding window. This is useful for checking if a set of parameter samples has stabilized.
check_gaussian_convergence(data, window_size = 300, tolerance = 0.01)
data |
Matrix or Data Frame. A matrix of samples where columns are parameters. |
window_size |
Integer. The size of the sliding window used to compute statistics. |
tolerance |
Numeric. The convergence threshold for the relative change in the mean and covariance. |
An object of class topolow_convergence
containing diagnostics about the
convergence of the multivariate samples. This list includes logical flags for
convergence (converged
, mean_converged
, cov_converged
) and the history
of the mean and covariance changes.
# Create sample data for the example
chain_data <- as.data.frame(matrix(rnorm(500 * 4), ncol = 4))
colnames(chain_data) <- c("param1", "param2", "param3", "param4")
# Run the convergence check
conv_results <- check_gaussian_convergence(chain_data)
print(conv_results)
# The plot method for this object can be used to create convergence plots.
# plot(conv_results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.