Learn R Programming

CCMnet (version 0.1.4)

CCM_theoretical_check: Compare MCMC Estimates with Theoretical Distributions

Description

This function compares the empirical MCMC distribution from sample_ccm with the theoretical distribution from the CCM model. It is used as a diagnostic tool to evaluate model adequacy.

Usage

CCM_theoretical_check(fit, n_sim = nrow(fit$mcmc_stats))

Value

A diagnostic plot comparing empirical and theoretical distributions.

Arguments

fit

An object returned by ccm_sample.

n_sim

The number of samples drawn from the theoretical distribution

Examples

Run this code
ccm_sample <- sample_ccm(
  network_stats = list("edges"),
  prob_distr = list("poisson"),
  prob_distr_params = list(list(350)),
  population = 50 
)
ccm_sample<- CCM_theoretical_check(ccm_sample, n_sim = 1000)
plot(ccm_sample, stats = "edges", type = "hist", include_theoretical = TRUE)

Run the code above in your browser using DataLab