Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

L3-06 · Derivatives and gradients

Calculate a derivative and interpret a gradient as local change.

Level 3 icon Level 3 · High-school bridge
Objective. Calculate a derivative and interpret a gradient as local change.
Before this lesson. L2-02
Hands-on lab. Variational circuits and gradients

Learn

A derivative describes the local rate of change of a function. Approximate it by a difference quotient over a small interval. The derivative is the limit as that interval approaches zero, when the limit exists. It is not generally a constant over a large interval.

A gradient collects partial derivatives for a function with several inputs. Each partial derivative varies one input while holding the other coordinates fixed. Optimization algorithms use this local information to choose a direction. The units of a derivative depend on the units of its output and input.

A derivative inside a fitted prediction function is not automatically a causal effect. Holding model coordinates fixed is a mathematical operation. A physical intervention can change other variables through causal mechanisms. To interpret a derivative causally, specify the causal model and the intervention that the derivative represents.

Practice

Solution

The partial derivatives are 2x and 6y. Substitute the point to obtain the gradient (4,-6). This vector gives local change in the two coordinate directions.

Check your understanding

Does a nonzero regression derivative by itself prove a causal effect?

Show the answer

B. No, it needs causal assumptions

A prediction function can reflect confounding or selection. A causal interpretation needs a justified model of interventions and mechanisms.

Sources

This lesson draws on Illowsky & Dean, 2023Peters et al., 2017.

Next: L3-07 · Expectation and variance

References
  1. Illowsky, B., & Dean, S. (2023). Introductory Statistics 2e. https://openstax.org/books/introductory-statistics-2e/pages/1-introduction
  2. Peters, J., Janzing, D., & Scholkopf, B. (2017). Elements of Causal Inference. https://mitpress.mit.edu/9780262037310/elements-of-causal-inference/