← All procedures

generators.saltelliDesign

This function gives the Saltelli design for the Sobol indices of a model with `d` inputs: `a`, `b` and the `d` matrices `ab`. The design has `n * (d + 2)` points for the model. `a` comes from `r.fork("A")`, and `b` comes from `r.fork("B")`. With `base` `"latin"`, each is a Latin hypercube.

CLI
Package
@procedures/generators · README
Path
["generators","saltelliDesign"]
CLI
mark generators saltelliDesign --n <number> --d <number> --r <object>
As data
{"$proc":["generators","saltelliDesign"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/generators/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["generators","saltelliDesign"], { n: 1, d: 1, r: {} });
console.log(JSON.stringify(result));

From the command line

$ mark generators saltelliDesign --n <number> --d <number> --r <object>

As data, in a program

{
  "$proc": ["generators", "saltelliDesign"],
  "input": { "n": 1, "d": 1, "r": {} }
}

Input

FieldTypeRequiredDefaultDescription
nnumberyes
dnumberyes
robjectyesThe input of random: the procedure makes the Random with random(seed) before the call.
base"latin" | "random"no

Output

FieldTypeRequiredDefaultDescription
anumber[][]yes
bnumber[][]yes
abnumber[][][]yes`ab[i]` is `a` with the column `i` of `b`.
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "n": {
        "type": "number"
      },
      "d": {
        "type": "number"
      },
      "r": {
        "type": "object",
        "properties": {
          "seed": {
            "type": [
              "string",
              "number"
            ]
          }
        },
        "required": [
          "seed"
        ],
        "additionalProperties": false,
        "x-procedures-construct": {
          "function": "random",
          "params": [
            "seed"
          ]
        },
        "description": "The input of random: the procedure makes the Random with random(seed) before the call."
      },
      "base": {
        "type": "string",
        "enum": [
          "latin",
          "random"
        ]
      }
    },
    "required": [
      "n",
      "d",
      "r"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "object",
    "properties": {
      "a": {
        "type": "array",
        "items": {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      },
      "b": {
        "type": "array",
        "items": {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      },
      "ab": {
        "type": "array",
        "items": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "description": "`ab[i]` is `a` with the column `i` of `b`."
      }
    },
    "required": [
      "a",
      "b",
      "ab"
    ],
    "additionalProperties": {}
  }
}