Description
Generate an evenly spaced predictor grid, known straight-line targets and seeded normal response noise, then delegate ordinary least squares and predictions from its 12-significant-digit coefficients; retain numeric-overflow fit status rather than claiming parameter recovery, statistical significance, or real-data accuracy.
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 an evenly spaced predictor grid, known straight-line targets and seeded normal response noise, then delegate ordinary least squares and predictions from its 12-significant-digit coefficients; retain numeric-overflow fit status rather than claiming parameter recovery, statistical significance, or real-data accuracy.
When to use this tool
Use this generator to create reproducible linear regression noise benchmark 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 intercept, slope, noiseStandardDeviation, count, minimumX, maximumX 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 model, observations, fit. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
Build a regular x grid, evaluate intercept plus slope times x, and add Gaussian noise. Delegate ordinary least squares and return fitted predictions when all results remain finite, otherwise numeric-overflow status.1
Delegated operations used for this result: linear. Their calculation or parsing conventions apply to the corresponding result fields.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| intercept | Intercept | Required. Finite number. |
| slope | Slope | Required. Finite number. |
| noiseStandardDeviation | Noise Standard Deviation | Required. Finite number; minimum 0. |
| count | Requested count; the mechanics explain whether one draw expands into several returned records. | Required. Safe integer; minimum 2; maximum 1024. |
| minimumX | Minimum X | Required. Finite number. |
| maximumX | Maximum X | Required. Finite number. |
| 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 |
|---|---|---|
| model | Model | Required. Object; no unknown keys. |
| model.intercept | Intercept | Required. Finite number. |
| model.slope | Slope | Required. Finite number. |
| model.noiseStandardDeviation | Noise Standard Deviation | Required. Finite number; minimum 0. |
| observations | Observations | Required. Array of Object; no unknown keys.; minimum items 2; maximum items 1024. |
| observations[].x | X | Required. Finite number. |
| observations[].target | Target | Required. Finite number. |
| observations[].observed | Observed | Required. Finite number. |
| fit | Fit | Required. Object; no unknown keys. |
| fit.status | Named outcome; inspect null and error fields before interpreting associated values. | Required. Text; one of "finite", "numeric-overflow". |
| fit.result | Result | Required. Object; no unknown keys. or Null. |
| fit.predictions | Predictions | Required. Array of Finite number.; maximum items 1024. |
| 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": 4,
"minimumX": 0,
"maximumX": 3,
"intercept": 1,
"slope": 2,
"noiseStandardDeviation": 1,
"seed": 42
},
"output": {
"model": {
"intercept": 1,
"slope": 2,
"noiseStandardDeviation": 1
},
"observations": [
{
"x": 0,
"target": 1,
"observed": 0.043837770615851035
},
{
"x": 1,
"target": 3,
"observed": 2.7269738951173896
},
{
"x": 2,
"target": 5,
"observed": 3.1583728152164032
},
{
"x": 3,
"target": 7,
"observed": 5.859117929045976
}
],
"fit": {
"status": "finite",
"result": {
"intercept": 0.26548969319,
"rSquared": 0.939883837957,
"slope": 1.78772393954
},
"predictions": [
0.26548969319,
2.05321363273,
3.84093757227,
5.62866151181
]
},
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- The target and observed values are distinct and noiseStandardDeviation uses response units. Fit quality is in-sample on synthetic data; no validation split, uncertainty interval, or real-world prediction guarantee is supplied.
- 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 Polynomial Regression Benchmark Generator
Generate known ascending-coefficient polynomial targets on a bounded evenly spaced grid, add seeded normal noise, and delegate separate requested degree-1–6 normal-equation fits and predictions; reverse coefficients only at the highest-first evaluator boundary, retain singular/nonfinite fit outcomes, and make no exact-solver or stability guarantee.
- Random Ridge Regression Benchmark Generator
Reuse the random linear-noise dataset generator once, then fit separate supplied ridge penalties with an unpenalized intercept alongside its OLS baseline; preserve the ridge core's 10-significant-digit coefficients/predictions (predictions use unrounded internal coefficients), and report nonfinite fits without training-quality claims.