{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Users should ensure that inputs "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xdata"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "ydata"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", and the output of "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "f"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "float64"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", or else the optimization may return incorrect results."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "With "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "method='lm'"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", the algorithm uses the Levenberg-Marquardt algorithm through "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "leastsq",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.optimize._minpack_py:leastsq"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". Note that this algorithm can only deal with unconstrained problems."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Box constraints can be handled by methods 'trf' and 'dogbox'. Refer to the docstring of "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "least_squares",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.optimize._lsq.least_squares:least_squares"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for more information."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Parameters to be fitted must have similar scale. Differences of multiple orders of magnitude can lead to incorrect results. For the 'trf' and 'dogbox' methods, the "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "x_scale",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " keyword argument can be used to scale the parameters."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "curve_fit",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.optimize._minpack_py:curve_fit"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is for local optimization of parameters to minimize the sum of squares of residuals. For global optimization, other choices of objective function, and other advanced features, consider using SciPy's "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "tutorial_optimize_global",
              "domain": null,
              "role": "ref",
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " tools or the "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "LMFIT"
                }
              ],
              "url": "https://lmfit.github.io/lmfit-py/index.html",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " package."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "",
              "annotation": "ValueError",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "if either "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "ydata"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " or "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "xdata"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " contain NaNs, or if incompatible options are used."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "",
              "annotation": "RuntimeError",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "if the least-squares minimization fails."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "",
              "annotation": "OptimizeWarning",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "if covariance of the parameters can not be estimated."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "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": "popt",
              "annotation": "array",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Optimal values for the parameters so that the sum of the squared residuals of "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "f(xdata, *popt) - ydata"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is minimized."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "pcov",
              "annotation": "2-D array",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The estimated approximate covariance of popt. The diagonals provide the variance of the parameter estimate. To compute one standard deviation errors on the parameters, use "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "perr = np.sqrt(np.diag(pcov))"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Note that the relationship between "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "cov",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and parameter error estimates is derived based on a linear approximation to the model function around the optimum "
                    },
                    {
                      "__type": "FootnoteReference",
                      "__tag": 4066,
                      "label": "1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". When this approximation becomes inaccurate, "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "cov",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " may not provide an accurate measure of uncertainty."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "How the "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "sigma"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " parameter affects the estimated covariance depends on "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "absolute_sigma"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " argument, as described above."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If the Jacobian matrix at the solution doesn't have a full rank, then 'lm' method returns a matrix filled with "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "np.inf"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", on the other hand 'trf'  and 'dogbox' methods use Moore-Penrose pseudoinverse to compute the covariance matrix. Covariance matrices with large condition numbers (e.g. computed with "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "numpy.linalg.cond",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "numpy",
                        "version": "*",
                        "kind": "api",
                        "path": "numpy.linalg:cond"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ") may indicate that results are unreliable."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "infodict",
              "annotation": "dict (returned only if `full_output` is True)",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "a dictionary of optional outputs with the keys:"
                    }
                  ]
                },
                {
                  "__type": "DefList",
                  "__tag": 4033,
                  "children": [
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "InlineCode",
                            "__tag": 4051,
                            "value": "nfev"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "The number of function calls. Methods 'trf' and 'dogbox' do not     count function calls for numerical Jacobian approximation,     as opposed to 'lm' method."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "InlineCode",
                            "__tag": 4051,
                            "value": "fvec"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "The residual values evaluated at the solution, for a 1-D "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "sigma"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "     this is "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "(f(x, *popt) - ydata)/sigma"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "InlineCode",
                            "__tag": 4051,
                            "value": "fjac"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "A permutation of the R matrix of a QR     factorization of the final approximate     Jacobian matrix, stored column wise.     Together with ipvt, the covariance of the     estimate can be approximated.     Method 'lm' only provides this information."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "InlineCode",
                            "__tag": 4051,
                            "value": "ipvt"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "An integer array of length N which defines     a permutation matrix, p, such that     fjac*p = q*r, where r is upper triangular     with diagonal elements of nonincreasing     magnitude. Column j of p is column ipvt(j)     of the identity matrix.     Method 'lm' only provides this information."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "InlineCode",
                            "__tag": 4051,
                            "value": "qtf"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "The vector (transpose(q) * fvec).     Method 'lm' only provides this information."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionadded",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionadded 1.9"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "mesg",
              "annotation": "str (returned only if `full_output` is True)",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "A string message giving information about the solution."
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionadded",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionadded 1.9"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "ier",
              "annotation": "int (returned only if `full_output` is True)",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "An integer flag. If it is equal to 1, 2, 3 or 4, the solution was found. Otherwise, the solution was not found. In either case, the optional output variable "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "mesg",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "mesg"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " gives more information."
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionadded",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionadded 1.9"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Use non-linear least squares to fit a function, f, to data."
            }
          ]
        }
      ],
      "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": "f",
              "annotation": "callable",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The model function, f(x, ...). It must take the independent variable as the first argument and the parameters to fit as separate remaining arguments."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "xdata",
              "annotation": "array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The independent variable where the data is measured. Should usually be an M-length sequence or an (k,M)-shaped array for functions with k predictors, and each element should be float convertible if it is an array like object."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "ydata",
              "annotation": "array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The dependent data, a length M array - nominally "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "f(xdata, ...)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "p0",
              "annotation": "array_like, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Initial guess for the parameters (length N). If None, then the initial values will all be 1 (if the number of parameters for the function can be determined using introspection, otherwise a ValueError is raised)."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "sigma",
              "annotation": "None or scalar or M-length sequence or MxM array, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Determines the uncertainty in "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "ydata"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". If we define residuals as "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "r = ydata - f(xdata, *popt)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", then the interpretation of "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "sigma"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " depends on its number of dimensions:"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "A scalar or 1-D "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "sigma"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " should contain values of standard deviations of   errors in "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "ydata"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ". In this case, the optimized function is   "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "chisq = sum((r / sigma) ** 2)"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "A 2-D "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "sigma"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " should contain the covariance matrix of   errors in "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "ydata"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ". In this case, the optimized function is   "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "chisq = r.T @ inv(sigma) @ r"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "."
                            }
                          ]
                        },
                        {
                          "__type": "Admonition",
                          "__tag": 4056,
                          "kind": "versionadded",
                          "base_type": "neutral",
                          "children": [
                            {
                              "__type": "AdmonitionTitle",
                              "__tag": 4055,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "versionadded 0.19"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "None (default) is equivalent of 1-D "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "sigma"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " filled with ones."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "absolute_sigma",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If True, "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "sigma"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is used in an absolute sense and the estimated parameter covariance "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "pcov",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "pcov"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " reflects these absolute values."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If False (default), only the relative magnitudes of the "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "sigma"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " values matter. The returned parameter covariance matrix "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "pcov",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "pcov"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is based on scaling "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "sigma"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " by a constant factor. This constant is set by demanding that the reduced "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "chisq",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for the optimal parameters "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "popt",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "popt"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " when using the "
                    },
                    {
                      "__type": "Emphasis",
                      "__tag": 4047,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "scaled"
                        }
                      ]
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "sigma"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " equals unity. In other words, "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "sigma"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is scaled to match the sample variance of the residuals after the fit. Default is False. Mathematically, "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "pcov(absolute_sigma=False) = pcov(absolute_sigma=True) * chisq(popt)/(M-N)"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "check_finite",
              "annotation": "bool, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If True, check that the input arrays do not contain nans of infs, and raise a ValueError if they do. Setting this parameter to False may silently produce nonsensical results if the input arrays do contain nans. Default is True if "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "nan_policy"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is not specified explicitly and False otherwise."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "bounds",
              "annotation": "2-tuple of array_like or `Bounds`, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Lower and upper bounds on parameters. Defaults to no bounds. There are two ways to specify the bounds:"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "Instance of "
                            },
                            {
                              "__type": "CrossRef",
                              "__tag": 4002,
                              "value": "Bounds",
                              "reference": {
                                "__type": "LocalRef",
                                "__tag": 4022,
                                "kind": "module",
                                "path": "scipy.optimize._constraints:Bounds"
                              },
                              "kind": "module"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " class."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "2-tuple of array_like: Each element of the tuple must be either   an array with the length equal to the number of parameters, or a   scalar (in which case the bound is taken to be the same for all   parameters). Use "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "np.inf"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " with an appropriate sign to disable   bounds on all or some parameters."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "method",
              "annotation": "{'lm', 'trf', 'dogbox'}, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Method to use for optimization. See "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "least_squares",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "scipy.optimize._lsq.least_squares:least_squares"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for more details. Default is 'lm' for unconstrained problems and 'trf' if "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "bounds"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " are provided. The method 'lm' won't work when the number of observations is less than the number of variables, use 'trf' or 'dogbox' in this case."
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionadded",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionadded 0.17"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "jac",
              "annotation": "callable, string or None, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Function with signature "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "jac(x, ...)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " which computes the Jacobian matrix of the model function with respect to parameters as a dense array_like structure. It will be scaled according to provided "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "sigma"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". If None (default), the Jacobian will be estimated numerically. String keywords for 'trf' and 'dogbox' methods can be used to select a finite difference scheme, see "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "least_squares",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "scipy.optimize._lsq.least_squares:least_squares"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionadded",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionadded 0.18"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "full_output",
              "annotation": "boolean, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If True, this function returns additional information: "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "infodict",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "infodict"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "mesg",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "mesg"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", and "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "ier",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "ier"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionadded",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionadded 1.9"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "nan_policy",
              "annotation": "{'raise', 'omit', None}, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Defines how to handle when input contains nan. The following options are available (default is None):"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'raise': throws an error"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "'omit': performs the calculations ignoring nan values"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "None: no special handling of NaNs is performed   (except what is done by check_finite); the behavior when NaNs   are present is implementation-dependent and may change."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Note that if this value is specified explicitly (not None), "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "check_finite"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " will be set as False."
                    }
                  ]
                },
                {
                  "__type": "Admonition",
                  "__tag": 4056,
                  "kind": "versionadded",
                  "base_type": "neutral",
                  "children": [
                    {
                      "__type": "AdmonitionTitle",
                      "__tag": 4055,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "versionadded 1.11"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "**kwargs",
              "annotation": "",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Keyword arguments passed to "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "leastsq",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "scipy.optimize._minpack_py:leastsq"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "method='lm'"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " or "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "least_squares",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "scipy.optimize._lsq.least_squares:least_squares"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " otherwise."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Assumes "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "ydata = f(xdata, *params) + eps"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "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/optimize/_minpack_py.py",
  "item_line": 590,
  "item_type": "function",
  "aliases": [
    "scipy.optimize.curve_fit"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.optimize import curve_fit\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "def func(x, a, b, c):\n    return a * np.exp(-b * x) + c\n",
        "execution_status": "success"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nDefine the data to be fit with some noise:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "xdata = np.linspace(0, 4, 50)\ny = func(xdata, 2.5, 1.3, 0.5)\nrng = np.random.default_rng()\ny_noise = 0.2 * rng.normal(size=xdata.size)\nydata = y + y_noise\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.plot(xdata, ydata, 'b-', label='data')\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nFit for the parameters a, b, c of the function `func`:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "popt, pcov = curve_fit(func, xdata, ydata)\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "popt\nplt.plot(xdata, func(xdata, *popt), 'r-',\n         label='fit: a=%5.3f, b=%5.3f, c=%5.3f' % tuple(popt))\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nConstrain the optimization to the region of ``0 <= a <= 3``,\n``0 <= b <= 1`` and ``0 <= c <= 0.5``:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "popt, pcov = curve_fit(func, xdata, ydata, bounds=(0, [3., 1., 0.5]))\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "popt\nplt.plot(xdata, func(xdata, *popt), 'g--',\n         label='fit: a=%5.3f, b=%5.3f, c=%5.3f' % tuple(popt))\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.xlabel('x')\nplt.ylabel('y')\nplt.legend()\n",
        "execution_status": "failure"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.show()\n",
        "execution_status": "success"
      },
      {
        "__type": "Figure",
        "__tag": 4024,
        "value": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "scipy",
          "version": "1.17.1",
          "kind": "assets",
          "path": "fig-3690c85f223b414a.png"
        }
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nFor reliable results, the model `func` should not be overparametrized;\nredundant parameters can cause unreliable covariance matrices and, in some\ncases, poorer quality fits. As a quick check of whether the model may be\noverparameterized, calculate the condition number of the covariance matrix:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.linalg.cond(pcov)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nThe value is small, so it does not raise much concern. If, however, we were\nto add a fourth parameter ``d`` to `func` with the same effect as ``a``:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "def func2(x, a, b, c, d):\n    return a * d * np.exp(-b * x) + c  # a and d are redundant\npopt, pcov = curve_fit(func2, xdata, ydata)\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.linalg.cond(pcov)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nSuch a large value is cause for concern. The diagonal elements of the\ncovariance matrix, which is related to uncertainty of the fit, gives more\ninformation:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "np.diag(pcov)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nNote that the first and last terms are much larger than the other elements,\nsuggesting that the optimal values of these parameters are ambiguous and\nthat only one of these parameters is needed in the model.\n\nIf the optimal parameters of `f` differ by multiple orders of magnitude, the\nresulting fit can be inaccurate. Sometimes, `curve_fit` can fail to find any\nresults:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ydata = func(xdata, 500000, 0.01, 15)\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "try:\n    popt, pcov = curve_fit(func, xdata, ydata, method = 'trf')\nexcept RuntimeError as e:\n    print(e)\n",
        "execution_status": "failure"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nIf parameter scale is roughly known beforehand, it can be defined in\n`x_scale` argument:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "popt, pcov = curve_fit(func, xdata, ydata, method = 'trf',\n                       x_scale = [1000, 1, 1])\n",
        "execution_status": "success"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "popt\n",
        "execution_status": "failure"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "least_squares",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.optimize._lsq.least_squares:least_squares"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Minimize the sum of squares of nonlinear functions."
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "scipy.stats.linregress",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.stats._stats_py:linregress"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Calculate a linear least squares regression for two sets of measurements."
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "f",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "xdata",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "ydata",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "p0",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "sigma",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "absolute_sigma",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "False"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "check_finite",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "bounds",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "(-inf, inf)"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "method",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "jac",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "full_output",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "False"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "nan_policy",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "kwargs",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "VAR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "curve_fit"
  },
  "references": [
    ".. [1] K. Vugrin et al. Confidence region estimation techniques for nonlinear",
    "       regression in groundwater flow: Three case studies. Water Resources",
    "       Research, Vol. 43, W03423, :doi:`10.1029/2005WR004804`"
  ],
  "qa": "scipy.optimize._minpack_py:curve_fit",
  "arbitrary": [],
  "local_refs": [
    "**kwargs",
    "absolute_sigma",
    "bounds",
    "check_finite",
    "f",
    "full_output",
    "ier",
    "infodict",
    "jac",
    "mesg",
    "method",
    "nan_policy",
    "p0",
    "pcov",
    "popt",
    "sigma",
    "xdata",
    "ydata"
  ]
}