{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "sample",
              "annotation": "array_like (n, d)",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Scaled sample."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Sample scaling from unit hypercube to different bounds."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "sample",
              "annotation": "array_like (n, d)",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Sample to scale."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "l_bounds, u_bounds",
              "annotation": "array_like (d,)",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Lower and upper bounds (resp. "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "a"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", "
                    },
                    {
                      "__type": "InlineMath",
                      "__tag": 4057,
                      "value": "b"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ") of transformed data. If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "reverse"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is True, range of the original data to transform to the unit hypercube."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "reverse",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Reverse the transformation from different bounds to the unit hypercube. Default is False."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "To convert a sample from "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "[0, 1)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " to "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "[a, b), b>a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", with "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "a"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " the lower bounds and "
            },
            {
              "__type": "InlineMath",
              "__tag": 4057,
              "value": "b"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " the upper bounds. The following transformation is used:"
            }
          ]
        },
        {
          "__type": "Math",
          "__tag": 4058,
          "value": "(b - a) \\cdot \\text{sample} + a"
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/scipy/stats/_qmc.py",
  "item_line": 88,
  "item_type": "function",
  "aliases": [
    "scipy.stats._qmc.scale"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "Transform 3 samples in the unit hypercube to bounds:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from scipy.stats import qmc\nl_bounds = [-2, 0]\nu_bounds = [6, 5]\nsample = [[0.5 , 0.75],\n          [0.5 , 0.5],\n          [0.75, 0.25]]\nsample_scaled = qmc.scale(sample, l_bounds, u_bounds)\nsample_scaled\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nAnd convert back to the unit hypercube:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "sample_ = qmc.scale(sample_scaled, l_bounds, u_bounds, reverse=True)\nsample_\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "sample",
        "annotation": "npt.ArrayLike",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "l_bounds",
        "annotation": "npt.ArrayLike",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "u_bounds",
        "annotation": "npt.ArrayLike",
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "reverse",
        "annotation": "bool",
        "kind": "KEYWORD_ONLY",
        "default": "False"
      }
    ],
    "return_annotation": "np.ndarray",
    "target_name": "scale"
  },
  "references": null,
  "qa": "scipy.stats._qmc:scale",
  "arbitrary": [],
  "local_refs": [
    "l_bounds",
    "reverse",
    "sample",
    "u_bounds"
  ]
}