Skip to content

Main content

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.

Loading tool…

Description

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.

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 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.

When to use this tool

Use this generator to create reproducible polynomial regression 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

  1. Supply coefficients, count, minimumX, maximumX, noiseStandardDeviation, fittingDegrees in the field shapes below. Set seed when you need an explicit replay.
  2. 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.
  3. Read model, observations, fits. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.

Evaluate the supplied polynomial on a regular predictor grid, add Gaussian noise, and fit every distinct requested degree to the same observations. Return each fit's predictions and distinguish finite, singular, and numeric-overflow statuses.1

Delegated operations used for this result: evaluate polynomial; polynomial. Their calculation or parsing conventions apply to the corresponding result fields.2, 3

Input fieldMeaning and unitsAccepted input
coefficientsGenerating coefficients in ascending powers c0..cd.Required. Array of Finite number.; minimum items 1; maximum items 7.
countRequested count; the mechanics explain whether one draw expands into several returned records.Required. Safe integer; minimum 2; maximum 1024.
minimumXMinimum XRequired. Finite number.
maximumXMaximum XRequired. Finite number.
noiseStandardDeviationNoise Standard DeviationRequired. Finite number; minimum 0.
fittingDegreesFitting DegreesRequired. Array of Safe integer; minimum 1; maximum 6.; minimum items 1; maximum items 6.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
modelModelRequired. Object; no unknown keys.
model.coefficientsAscendingGenerating coefficients in ascending powers c0..cd.Required. Array of Finite number.; minimum items 1; maximum items 7.
model.noiseStandardDeviationNoise Standard DeviationRequired. Finite number; minimum 0.
observationsObservationsRequired. Array of Object; no unknown keys.; minimum items 2; maximum items 1024.
observations[].xXRequired. Finite number.
observations[].targetTargetRequired. Finite number.
observations[].observedObservedRequired. Finite number.
fitsFitsRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 6.
fits[].degreeDegreeRequired. Safe integer; minimum 1; maximum 6.
fits[].statusNamed outcome; inspect null and error fields before interpreting associated values.Required. Text; one of "finite", "singular", "numeric-overflow".
fits[].resultResultRequired. Object; no unknown keys. or Null.
fits[].predictionsPredictionsRequired. Array of Finite number.; maximum items 1024.
randomnessReplay 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.seedOptional numeric replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. 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.

json
{
  "input": {
    "coefficients": [
      0,
      0,
      1
    ],
    "count": 3,
    "minimumX": -1,
    "maximumX": 1,
    "noiseStandardDeviation": 0,
    "fittingDegrees": [
      1,
      2
    ],
    "seed": 42
  },
  "output": {
    "model": {
      "coefficientsAscending": [
        0,
        0,
        1
      ],
      "noiseStandardDeviation": 0
    },
    "observations": [
      {
        "x": -1,
        "target": 1,
        "observed": 1
      },
      {
        "x": 0,
        "target": 0,
        "observed": 0
      },
      {
        "x": 1,
        "target": 1,
        "observed": 1
      }
    ],
    "fits": [
      {
        "degree": 1,
        "status": "finite",
        "result": {
          "coefficients": [
            0.6666666666666666,
            0
          ],
          "rSquared": 0
        },
        "predictions": [
          0.6666666666666666,
          0.6666666666666666,
          0.6666666666666666
        ]
      },
      {
        "degree": 2,
        "status": "finite",
        "result": {
          "coefficients": [
            0,
            0,
            1
          ],
          "rSquared": 1
        },
        "predictions": [
          1,
          0,
          1
        ]
      }
    ],
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • Input coefficients are ascending in power, while delegated evaluation reverses them internally. Each fit degree must be below count. In-sample fit quality is not cross-validation or evidence for a real generating model.
  • 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

  1. Tool behavior and example: Random Polynomial Regression Benchmark Generator — tool.io

  2. Calculation or validation: algebra/evaluate-polynomial — tool.io

  3. Calculation or validation: regression/polynomial — tool.io

Similar or alternative tools

  • Random Linear Regression Noise Benchmark Generator

    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.

  • 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.