Questions tagged [derivative]

In calculus, a derivative is a measure of a function's rate of change as its input changes.

Loosely speaking, a derivative can be thought of as how much one quantity is changing in response to changes in some other quantity; for example, the derivative of the position of a moving object with respect to time is the object's instantaneous velocity.

The derivative of a function at a chosen input value describes the best linear approximation of the function near that input value. For a real-valued function of a single real variable, the derivative at a point equals the slope of the tangent line to the graph of the function at that point. In higher dimensions, the derivative of a function at a point is a linear transformation called the linearization.1 A closely related notion is the differential of a function.

The process of finding a derivative is called differentiation. The reverse process is called antidifferentiation. The fundamental theorem of calculus states that antidifferentiation is the same as integration. Differentiation and integration constitute the two fundamental operations in single-variable calculus.

enter image description here

685 questions
58
votes
1 answer

Explanation of dFdx

I am trying to understand the dFdx() and dFdy() functions in GLSL. I understand the following: The derivative is the rate of change The partial derivative of a function with two parameters is when you differentiate the function while keeping one of…
bwroga
  • 4,711
  • 2
  • 20
  • 25
17
votes
3 answers

scipy.misc.derivative for multiple argument function

It is straightforward to compute the partial derivatives of a function at a point with respect to the first argument using the SciPy function scipy.misc.derivative. Here is an example: def foo(x, y): return(x**2 + y**3) from scipy.misc import…
tchakravarty
  • 10,038
  • 10
  • 58
  • 107
17
votes
3 answers

How to calculate first derivative of time series

I would calculate the first derivative (dpH/dtime) of time series using two variables, time and pH. Are there any kind of functions to do this in R or should I compute an extra function to do this?
alexmulo
  • 681
  • 3
  • 11
  • 22
16
votes
2 answers

derivative of a function

I am using D to get derivatives of a function. However, R does not simplify the expression when returning the derivative. I need to figure out if a function has a derivative that can be expressed generically. Is there some way in R to simplify the…
user236215
  • 6,598
  • 17
  • 57
  • 83
16
votes
2 answers

What's the best way to calculate a numerical derivative in MATLAB?

(Note: This is intended to be a community Wiki.) Suppose I have a set of points xi = {x0,x1,x2,...xn} and corresponding function values fi = f(xi) = {f0,f1,f2,...,fn}, where f(x) is, in general, an unknown function. (In some situations, we might…
jvriesem
  • 1,643
  • 3
  • 14
  • 34
15
votes
5 answers

How to find derivative of a function using c

Is it possible to find derivative of a function using c program. I am using matlab in that it has an inbuilt function diff() which can be used for finding derivative of a function. f(x)=x^2 Is it possible to find the derivative of above function…
Eka
  • 10,884
  • 31
  • 98
  • 166
14
votes
6 answers

Compute the Jacobian matrix in Python

import numpy as np a = np.array([[1,2,3], [4,5,6], [7,8,9]]) b = np.array([[1,2,3]]).T c = a.dot(b) #function jacobian = a # as partial derivative of c w.r.t to b is a. I am reading about jacobian Matrix, trying to…
filtertips
  • 605
  • 1
  • 8
  • 21
14
votes
10 answers

Implement Relu derivative in python numpy

I'm trying to implement a function that computes the Relu derivative for each element in a matrix, and then return the result in a matrix. I'm using Python and Numpy. Based on other Cross Validation posts, the Relu derivative for x is 1 when x > 0,…
Bon
  • 2,841
  • 4
  • 19
  • 36
13
votes
1 answer

Stuck implementing simple neural network

I've been bashing my head against this brick wall for what seems like an eternity, and I just can't seem to wrap my head around it. I'm trying to implement an autoencoder using only numpy and matrix multiplication. No theano or keras tricks…
Oria Gruber
  • 1,423
  • 2
  • 19
  • 38
13
votes
5 answers

How to implement the Softmax derivative independently from any loss function?

For a neural networks library I implemented some activation functions and loss functions and their derivatives. They can be combined arbitrarily and the derivative at the output layers just becomes the product of the loss derivative and the…
danijar
  • 27,743
  • 34
  • 143
  • 257
12
votes
3 answers

Approximate a derivative for a continuous function throughout certain step intervals

I am looking to write a method in Java which finds a derivative for a continuous function. These are some assumptions which have been made for the method - The function is continuous from x = 0 to x = infinity. The derivative exists at every…
Axion004
  • 873
  • 1
  • 8
  • 33
12
votes
3 answers

Find all local Maxima and Minima when x and y values are given as numpy arrays

I have two arrays x and y as : x = np.array([6, 3, 5, 2, 1, 4, 9, 7, 8]) y = np.array([2, 1, 3, 5, 3, 9, 8, 10, 7]) I am finding index of local minima and maxima as follows: sortId = np.argsort(x) x = x[sortId] y = y[sortId] minm =…
prtkp
  • 417
  • 1
  • 4
  • 8
12
votes
2 answers

Is there a vectorized way to calculate the gradient in sympy?

How does one calculate the (symbolic) gradient of a multivariate function in sympy? Obviously I could calculate separately the derivative for each variable, but is there a vectorized operation that does this? For…
Bitwise
  • 7,043
  • 4
  • 30
  • 48
11
votes
1 answer

3D Perlin noise analytical derivative

I am currently implementing a 3D Perlin noise bump mapping using Shader Model 4 (DirectX 10 HLSL). Generating the noise itself is not a big problem (there are tons of tutorials and codes around) but what I have not found are analytical derivatives…
Karel Petranek
  • 14,540
  • 4
  • 39
  • 66
10
votes
10 answers

Compute a derivative using discrete methods

I am looking for a method to compute a derivative using a discrete and fast method. Since now I do not know the type of equation I have, I am looking for discrete methods analog to the ones that we can find for the integral such as, the Euler…
Ryan
  • 111
  • 1
  • 2
  • 8
1
2 3
45 46