rStats.js v1.3.0
    Preparing search index...

    Function rcauchy

    • Random numbers from the Cauchy distribution. Equivalent to R's rcauchy().

      Parameters

      • n: number

        Number of values to generate (fractions are truncated, as in R).

      • options: { location?: number; scale?: number } = {}
        • Optionallocation?: number

          Location. Default 0.

        • Optionalscale?: number

          Scale. Default 1.

      Returns number[]

      An array of n values; NaN for invalid parameters.

      setSeed(1);
      rcauchy(2, { location: 0, scale: 1 }); // [1.10252, 2.353831]