Learn R Programming

algebraic.dist (version 0.9.1)

ensure_realized: Memoized MC fallback materialization.

Description

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.

Usage

ensure_realized(x, n = 10000L)

Value

An empirical_dist (or realized_dist).

Arguments

x

A distribution object.

n

Number of samples (default: 10000).