Questions tagged [differentiation]

The process of finding a derivative.

In calculus, a branch of mathematics, the derivative is a measure of how a function changes 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.

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.

236 questions
3
votes
1 answer

Partial Derivative using Autograd

I have a function that takes in a multivariate argument x. Here x = [x1,x2,x3]. Let's say my function looks like: f(x,T) = np.dot(x,T) + np.exp(np.dot(x,T) where T is a constant. I am interested in finding df/dx1, df/dx2 and df/dx3 functions. I have…
3
votes
2 answers

`numpy.diff` and `scipy.fftpack.diff` giving different results when differentiating

I am trying to compute the derivative of some data and I was trying to compare the output of a finite difference and a spectral method output. But the results are very different and I can't figure out exactly why. Consider the example code…
TomCho
  • 3,204
  • 6
  • 32
  • 83
3
votes
2 answers

Find the 'shape' of a list of numbers (straight-line/concave/convex, how many humps)

This is a bit hard to explain. I have a list of integers. So, for example, [1, 2, 4, 5, 8, 7, 6, 4, 1] - which, when plotted against element number, would resemble a convex graph. How do I somehow extract this 'shape' characteristic from the list?…
3
votes
1 answer

How to explicitly write the derivatives of a symbolic function?

I have u = function('u',x) and I'm interested in what happens when powers of some scalar a are eigenvalues of the differentiation operator (i.e. D^n u = a^n*u). For n=1,2 elementary function examples exist (De^(a*x) = a*e^(a*x), sin and cos for a=i…
3
votes
3 answers

Maxima - differentiating a piecewise function

Suppose you have a function defined by intervals, such as f(x):=block(if x<0 then x^2 else x^3); When we differentiate it with diff(f(x),x); we get d/dx (if x<0 then x^2 else x^3) whereas I'd like to get (if x<0 then 2*x else 3*x^2) Is there a…
mmj
  • 5,514
  • 2
  • 44
  • 51
3
votes
3 answers

matlab for automatic differentiation

if someone of you could help me out or point me in the right direction that would be wonderfull. I have the following formula which has 8 parameters that differ for each subject. The equation describes a growth pattern with t being time and y being…
3
votes
1 answer

Avoid sorting args in Python module Sympy

I am currently developing a differential operator for sympy that can be placed in matricial form. In this case the order of the args list when creating a Mul object is very important to guarantee that the differentiation is performed where it is…
Saullo G. P. Castro
  • 56,802
  • 26
  • 179
  • 234
3
votes
2 answers

Why derivative of a function is used to calculate Local Minimum instead of the actual function?

In Machine learning regression problem, why the local minimum is computed for a derivative function instead of the actual function? Example: http://en.wikipedia.org/wiki/Gradient_descent The gradient descent algorithm is applied to find a local…
2
votes
0 answers

Using gradef with complex quantities in Maxima

I'm using gradef to declare the gradients of certain complex variables (that depend on an independent variable, say, t) in terms of other complex variables dependent on the same independent variable. But I'm running into some issues while applying…
2
votes
3 answers

Julia symbolic differentiation

Though I've looked through several pages documenting various differentiation tools in Julia, I have yet to find the following simple functionality. I want to define a function which is differentiable by hand, e.g, f(x) = 2x.^3, then call a symbolic…
Frank Seidl
  • 148
  • 7
2
votes
2 answers

How does automatic differentiation with respect to the input work?

I've been trying to understand how automatic differentiation (autodiff) works. There are several implementations of this that can be found in Tensorflow, PyTorch and other programs. There are three aspects of automatic differentiation that currently…
2
votes
1 answer

Tracking velocity of object that inconsistently reports its position

My code tracks an object that exists in virtual 3D space. I have no direct access to the object's position, but it reports its coordinates, every so often. The exact frequency with which the updates occur is not exactly known or reliable, but I know…
Gerardo Marset
  • 803
  • 1
  • 10
  • 23
2
votes
1 answer

Numerical differentiation with python

I have such a task: You need to write a function with the following signature: def derForward(f, I, h) This function should get as input function and segment as Python list of two elements --- ends of the segment. In the function you are asked…
evggenn
  • 23
  • 4
2
votes
1 answer

Pytorch sum jacobian over inputs instead of outputs

Suppose I have a tensor Y that is (directly or indirectly) computed from a tensor X. Normally when I apply torch.autograd.grad(Y, X, grad_outputs=torch.ones_like(Y)), I get a gradient mask that is of the same shape as X. This mask is actually a…
Jonas De Schouwer
  • 755
  • 1
  • 9
  • 15
2
votes
1 answer

How to do numeric differentiation using Boost Units?

I would like to perform a numeric differentiation in C++. For type safety, I'd like to use boost::units to avoid mixing units but also boost::units::absolute to avoid mixing relative and absolute units. A minimal example is to calculate the velocity…
user2968115
  • 135
  • 9
1 2
3
15 16