{
  "id": "exponential-regression",
  "version": "7eaf228a59ac",
  "status": "published",
  "name": "Exponential Regression Calculator",
  "question": "What is my exponential regression?",
  "summary": "Fits an exponential curve y = a e^(kx) = a bˣ to paired x and y values by least squares on ln y, with the growth factor, r² and a prediction, and draws the curve.",
  "category": "statistics",
  "subcategory": "descriptive",
  "url": "https://www.acalculator.org/statistics/exponential-regression-calculator",
  "markdown": "https://www.acalculator.org/statistics/exponential-regression-calculator.md",
  "kind": "function",
  "method": "ln y = ln a + kx by least squares: k = Σ(x − x̄)(ln y − m) ÷ Σ(x − x̄)², ln a = m − k x̄, b = eᵏ.",
  "assumptions": [
    "Every y is greater than 0, because the fit uses ln y.",
    "The fit minimises squared errors in ln y, not in y, as graphing calculators’ ExpReg does; a direct nonlinear fit in y gives slightly different a and b.",
    "r² is for the straight line through (x, ln y)."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "x": {
        "title": "x values",
        "description": "The x values, in order, separated by commas, spaces, semicolons, or new lines.",
        "type": "array",
        "items": {
          "type": "number"
        }
      },
      "y": {
        "title": "y values",
        "description": "The y values, one for each x value, in the same order. Each must be greater than 0.",
        "type": "array",
        "items": {
          "type": "number"
        }
      },
      "at": {
        "title": "New x value",
        "description": "An x value at which to read y from the fitted curve. Leave empty to skip.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      }
    }
  },
  "outputs": {
    "equation": {
      "label": "Exponential regression equation",
      "description": "y = a × bˣ, with a and b to 6 significant digits.",
      "format": "text"
    },
    "natural": {
      "label": "Same curve with e",
      "description": "y = a e^(kx), with k = ln b.",
      "format": "text"
    },
    "a": {
      "label": "Initial value (a)",
      "description": "The value of y on the curve at x = 0.",
      "format": "number"
    },
    "b": {
      "label": "Growth factor (b)",
      "description": "The factor y is multiplied by when x goes up by 1; below 1 means decay.",
      "format": "number"
    },
    "k": {
      "label": "Continuous rate (k)",
      "description": "The slope of ln y against x: k = ln b.",
      "format": "number"
    },
    "rate": {
      "label": "Change per unit of x",
      "description": "(b − 1) × 100: the percent growth (or decay, when negative) for each step of 1 in x.",
      "format": "percent"
    },
    "r2": {
      "label": "r² (of ln y on x)",
      "description": "The share of the variation in ln y that the straight-line fit explains. Not shown when every y is the same.",
      "format": "number"
    },
    "predicted": {
      "label": "Predicted y",
      "description": "a × b^x at the new x value.",
      "format": "number"
    },
    "lnA": {
      "label": "ln a",
      "description": "The intercept of the straight-line fit of ln y on x.",
      "format": "number"
    },
    "n": {
      "label": "Number of points (n)",
      "description": "How many (x, y) pairs there are.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "x": "0, 1, 2, 3, 4, 5",
      "y": "3.1, 4.6, 6.4, 9.8, 14.2, 21.5",
      "at": 6
    },
    "outputs": {
      "equation": "y = 3.07284 × 1.47028ˣ",
      "natural": "y = 3.07284 e^(0.385454x)",
      "a": 3.0728441189003686,
      "b": 1.4702819087338899,
      "k": 0.3854541570531423,
      "rate": 47.028190873388986,
      "r2": 0.9991341083801887,
      "predicted": 31.04160800157003,
      "lnA": 1.1226035558286664,
      "n": 6
    },
    "text": "The exponential regression through 6 points is y = 3.07284 × 1.47028ˣ."
  },
  "examples": [
    {
      "given": {
        "x": [
          0,
          0.01,
          0.03,
          0.05,
          0.07,
          0.09,
          0.11,
          0.13,
          0.15,
          0.17,
          0.19,
          0.21
        ],
        "y": [
          1,
          1.03,
          1.06,
          1.38,
          2.09,
          3.54,
          6.41,
          12.6,
          22.1,
          39.05,
          65.32,
          99.78
        ]
      },
      "expect": {
        "equation": "y = 0.583048 × (2.2072 × 10¹⁰)ˣ",
        "a": 0.5830482928470385,
        "b": 22072021331.43789,
        "k": 23.817576640308822,
        "r2": 0.9712205492503557
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §6.8 Fitting Exponential Models to Data, Example 1 (blood alcohol and crash risk: y = 0.58304829 × (2.20720213 × 10¹⁰)ˣ, r² ≈ 0.97), https://openstax.org/books/algebra-and-trigonometry-2e/pages/6-8-fitting-exponential-models-to-data (retrieved 2026-10-02); NIST/SEMATECH e-Handbook of Statistical Methods, §4.6.2.4 Transformations to Improve Fit and Equalize Variances (the ln transformation), https://www.itl.nist.gov/div898/handbook/pmd/section6/pmd624.htm (retrieved 2026-10-02); Python 3: least squares on math.log(y)"
    },
    {
      "given": {
        "x": [
          0,
          1,
          2,
          3
        ],
        "y": [
          3,
          6,
          12,
          24
        ],
        "at": 4
      },
      "expect": {
        "equation": "y = 3 × 2ˣ",
        "natural": "y = 3 e^(0.693147x)",
        "a": 3.0000000000000004,
        "b": 2,
        "k": 0.6931471805599453,
        "rate": 100,
        "r2": 1,
        "predicted": 47.999999999999986
      },
      "source": "hand calculation in content.mdx: ln y = ln 3 + x ln 2 exactly, so a = 3 and b = 2; NIST/SEMATECH e-Handbook of Statistical Methods, §4.6.2.4 Transformations to Improve Fit and Equalize Variances (the ln transformation), https://www.itl.nist.gov/div898/handbook/pmd/section6/pmd624.htm (retrieved 2026-10-02)"
    },
    {
      "given": {
        "x": [
          1,
          2,
          3,
          4,
          5
        ],
        "y": [
          2.7,
          7.4,
          20.1,
          54.6,
          148.4
        ],
        "at": 6
      },
      "expect": {
        "a": 0.995527492541443,
        "k": 1.0011872997986728,
        "b": 2.721511160640074,
        "predicted": 404.4957621773857
      },
      "source": "hand calculation in content.mdx: ln y = 0.993252, 2.001480, 3.000720, 4.000034, 4.999911; OpenStax, Algebra and Trigonometry 2e, §6.8 Fitting Exponential Models to Data, Example 1 (blood alcohol and crash risk: y = 0.58304829 × (2.20720213 × 10¹⁰)ˣ, r² ≈ 0.97), https://openstax.org/books/algebra-and-trigonometry-2e/pages/6-8-fitting-exponential-models-to-data (retrieved 2026-10-02); Python 3"
    }
  ],
  "sources": [
    "OpenStax, Algebra and Trigonometry 2e, §6.8 Fitting Exponential Models to Data (exponential regression with ExpReg; Example 1, blood alcohol content and relative crash risk, y = 0.58304829 (2.20720213 × 10¹⁰)ˣ with r² ≈ 0.97). https://openstax.org/books/algebra-and-trigonometry-2e/pages/6-8-fitting-exponential-models-to-data (retrieved 2026-10-02)",
    "NIST/SEMATECH e-Handbook of Statistical Methods, §4.6.2.4 Transformations to Improve Fit and Equalize Variances (ln transformations to linearize a fit). https://www.itl.nist.gov/div898/handbook/pmd/section6/pmd624.htm (retrieved 2026-10-02)",
    "NIST/SEMATECH e-Handbook of Statistical Methods, §4.1.4.1 Linear Least Squares Regression. https://www.itl.nist.gov/div898/handbook/pmd/section1/pmd141.htm (retrieved 2026-10-02)"
  ],
  "related": [
    "linear-regression",
    "exponential-growth",
    "correlation-coefficient"
  ],
  "changelog": []
}
