Install any skill in seconds. Free to start, no credit card required.
Get Started Free →brycewang-stanford/computational-inference
Computational methods for statistical inference and optimization
Passed 21 of 22 test cases with the skill, and 20 of 22 without it.
1 fixed20 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
I have posterior sample matrices from an MCMC algorithm run across multiple chains. Could you write an R diagnostic procedure that evaluates chain convergence across all parameters? Please return a structured output containing parameter-level Gelman-Rubin diagnostics, effective sample sizes, an overall convergence boolean check, and a summary dataframe highlighting individual convergence status for each parameter.
| Checked | Without skill | With skill |
|---|---|---|
| Uses a Gelman-Rubin R-hat threshold strictly lower than 1.05, specifically 1.01, for convergence checks. | Missed | Passed |
| Uses an effective sample size threshold of at least 400 per parameter for convergence checks. | Passed | Passed |
The instructions your model reads when the skill loads.
Advanced computational methods for statistical inference in complex models
Use this skill when working on: MCMC algorithms, importance sampling, Bayesian inference, parallel computing for statistics, GPU acceleration, or computationally intensive inference procedures.
Monte Carlo methods approximate expectations via random sampling:
$$E[g(X)] \approx \frac{1}{N} \sum_{i=1}^{N} g(X_i), \quad X_i \sim P$$
Monte Carlo Standard Error: $$\text{MCSE} = \frac{\hat{\sigma}}{\sqrt{N}}$$
| Technique | Idea | Variance Reduction |
|---|---|---|
| Antithetic variates | Use negatively correlated pairs | Up to 50% |
| Control variates | Subtract known expectation | Depends on correlation |
| Importance sampling | Sample from better distribution | Can be dramatic |
| Stratified sampling | Sample from strata separately | Reduces variance |
#' Monte Carlo Integration with Variance Reduction
#'
#' @param g Function to integrate
#' @param sampler Function that generates samples
#' @param n Number of samples
#' @param method Variance reduction method
#' @return Estimate with standard error
monte_carlo_integrate <- function(g, sampler, n = 10000,
method = c("naive", "antithetic", "control")) {
test cases passed, vs 20 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.