Single internal entry point for all Monte Carlo fallback paths. If x is already an empirical_dist, returns it unchanged. If x has a .cache environment (e.g. edist objects), caches the realization so that multiple method calls (e.g. cdf + density) share the same samples. Sample-size-aware: if the cached realization has fewer than n samples, re-realizes.

ensure_realized(x, n = 10000L)

Arguments

x

A distribution object.

n

Number of samples (default: 10000).

Value

An empirical_dist (or realized_dist).