Description
Generate labeled observations from explicitly weighted normal/exponential components via multinomial counts, separate visible component sampler seeds, and a seeded shuffle; preserve normal sampler 10-significant-digit rounding and inherited endpoint clipping, without fitting or classifying real data.
Synthetic statistical data separates a specified generating model from the values observed in a finite draw. A model parameter, a sample summary, and the result of a fitted analysis answer different questions; retaining them separately makes numerical and statistical checks easier to interpret.
Generate labeled observations from explicitly weighted normal/exponential components via multinomial counts, separate visible component sampler seeds, and a seeded shuffle; preserve normal sampler 10-significant-digit rounding and inherited endpoint clipping, without fitting or classifying real data.
When to use this tool
Use this generator to create reproducible mixture distribution experiment cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply count, components in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read countSamplerSeed, components, observations. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
Normalize nonnegative mixture weights by their largest value and draw component counts with a multinomial sampler. Derive separate component seeds, draw normal or exponential samples for each count, retain source-component labels, and shuffle observations.1
Delegated operations used for this result: normal box muller sampler; exponential sampler. Their calculation or parsing conventions apply to the corresponding result fields.2, 3
| Input field | Meaning and units | Accepted input |
|---|---|---|
| count | Requested count; the mechanics explain whether one draw expands into several returned records. | Required. Safe integer; minimum 1; maximum 2048. |
| components | Component loading vectors in component order, each aligned with the original feature columns. | Required. Array of Object; no unknown keys. or Object; no unknown keys.; minimum items 1; maximum items 16. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| countSamplerSeed | Count Sampler Seed | Required. Text; minimum UTF-16 length 1. |
| components | Component loading vectors in component order, each aligned with the original feature columns. | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 16. |
| components[].index | Index | Required. Safe integer; minimum 0; maximum 15. |
| components[].parameters | Parameters | Required. Object; no unknown keys. or Object; no unknown keys. |
| components[].probability | Probability | Required. Finite number; minimum 0; maximum 1. |
| components[].sampleCount | Sample Count | Required. Safe integer; minimum 0; maximum 2048. |
| components[].samplerSeed | Sampler Seed | Required. Text; minimum UTF-16 length 1. |
| observations | Observations | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 2048. |
| observations[].componentIndex | Component Index | Required. Safe integer; minimum 0; maximum 15. |
| observations[].value | Value | Required. Finite number. |
| randomness | Replay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional numeric replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"count": 5,
"components": [
{
"kind": "normal",
"weight": 1,
"mean": 0,
"standardDeviation": 1
},
{
"kind": "exponential",
"weight": 1,
"rate": 2
}
],
"seed": 42
},
"output": {
"countSamplerSeed": "mixture-counts:2581720956",
"components": [
{
"index": 0,
"parameters": {
"kind": "normal",
"weight": 1,
"mean": 0,
"standardDeviation": 1
},
"probability": 0.5,
"sampleCount": 3,
"samplerSeed": "mixture-component-0:1925393290"
},
{
"index": 1,
"parameters": {
"kind": "exponential",
"weight": 1,
"rate": 2
},
"probability": 0.5,
"sampleCount": 2,
"samplerSeed": "mixture-component-1:3661312704"
}
],
"observations": [
{
"componentIndex": 0,
"value": 0.2703889241
},
{
"componentIndex": 1,
"value": 0.37272969328403577
},
{
"componentIndex": 0,
"value": 0.8889417657
},
{
"componentIndex": 0,
"value": -0.3672253541
},
{
"componentIndex": 1,
"value": 0.04164995389125125
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- At least one weight must be positive. Zero-weight components receive zero samples. Generated labels are known construction labels, not clustering predictions; finite counts need not match exact mixture proportions.
- A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random Heavy-Tail Comparison Experiment Generator
Compare matched-size Cauchy and Pareto Type I samples with visible derived sampler seeds, observed extremes, medians, and linearly interpolated empirical quantiles; preserve Pareto sampler 10-significant-digit rounding and epsilon tail clipping, and do not report a finite Cauchy population mean or variance.
- Random Overdispersed Count Experiment Generator
Compare equal-size binomial and beta-binomial batches at the same beta-derived mean probability, using visible derived string-seeded sampler substreams; report observed population means/variances and theoretical variances, without claiming every realized batch is more dispersed or fitting real data.