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
0
votes
0 answers

How to find the first derivative of the Moment generating function (MGF) in R for Gamma distribution?

The moment generating function (MGF) for Gamma(2,1) for given t = 0.2 can be obtained using following r function. library(rmutil) gam_shape = 2 gam_scale = 1 t = 0.20 Mgf = function(x) exp(t * x) * dgamma(x, gam_shape, gam_scale) int =…
0
votes
0 answers

Partial Differentiation

I wanted to know command for differentiating a complex Function. I am having trouble formulating the function I want to partially differentiate with respect to Q and then get just optimal Q. fi,Xi, li, Yi ,Qfi and Qsi are the decision Variables. All…
Shuchita
  • 1
  • 4
0
votes
1 answer

How to use the auto differentiation feature to compute the derivative of a vector with respect to a vector

I am using tensor-flow. The question is: I have a vector x = (x_0, x_1) and a map: y = [x_0+x_1, x_0-x_1]. I want to use tensor-flow's auto differentiation feature to compute the derivative of dy/dx. How can I accomplish it? I search on the…
0
votes
2 answers

Calculate second derivative of anonymous function

I want to calculate the second derivative of an anonymous function in Matlab. I'm already aware of some formulas for this (Numerical Differentiation) but they seem not to work. I'm able to calculate the first derivative with : f = @(x) (x^3); h =…
Ulises
  • 21
  • 3
0
votes
1 answer

First and second order partial derivatives of function with two variables in MATLAB

I am trying to implement different numerical methods in MATLAB without the use of the built-in function, such as gradient or del2. This is my code so far: clear all close all x = [-1:0.1:1]; y = [-2:0.1:2]; vel = @(x,y)…
geggy
  • 13
  • 2
0
votes
1 answer

Trouble with derivation- how to fix "TypeError: 'Add' object is not callable"

Programming in python with numpy and sympy, and my attempts to use derivatives in my code are falling flat. I frequently get either "TypeError: 'Add' object is not callable" and, "ValueError: First variable cannot be a number: 1". This is for…
cbitt
  • 11
  • 1
  • 3
0
votes
1 answer

Why does my ARIMA model work (2,0,3), but not in the first difference (2,1,3)?

What to run an arima function in the first difference (2,1,3), but i keep getting an error message. However, if i run it without the differencing (2,3) it works. What am I doing wrong. Data=…
0
votes
1 answer

How can I derive symbolic function in MATLAB in terms of another symbolic function?

gr = 9.81; %gravity syms phi(t) m l theta=1/3*m*l^2; phidot=diff(phi,t); U=m*gr*l/2*cos(phi); T=1/2*theta*phidot^2+(1/2*phidot*l)^2*m; L=T-U; frst=diff(L,phidot); The code is shown above. As you can see that phi(t) is symbolic time dependent…
user10141041
0
votes
2 answers

Plotting derivatives of normal distribution / Gaussians in R

I'm trying to calculate derivatives of Gaussians in R and when I try to specify the mean and standard deviation, R seems to ignore this. For example, the following code works to plot a N(0,1) density and it's first and second derivative. st_norm <-…
user-2147482565
  • 453
  • 7
  • 16
0
votes
0 answers

Differentiation of mixture Gaussians in R

Is there any way that you can differentiate mixture Gaussians in R? To get the density of a mixture Gaussian distribution, I have used the following code: dnorm_mix <- function(x, weights, means, sds) { value <- 0 for (i in 1:length(weights))…
user-2147482565
  • 453
  • 7
  • 16
0
votes
1 answer

How to use Mathematica to solve the numerical differentiation and integration in my code?

I use the parameters to calculate the Φ in the final, but I don't know what happen, it shows a lot of information, but I can't understand. I am using this code to solve the problem. This code is borrowed by me. With the consent of others, then I…
0
votes
2 answers

Differentiation using sympy

I am trying to differentiate the function z. But it is giving me an error which says: raise TypeError("can't convert the expression to float") TypeError: can't convert expression to float I am not able to figure out my mistake. from sympy import…
0
votes
1 answer

Mathematica: Error fitting function to data using NIntegrate and ' (differentiation)

I've been trying to fit a function to a data set. IT works with functions without integrals (like NIntegrate) and differentiations ( ' ). I'm trying to get it to work using both integrals and differentiations: deltaData = {{1.00, 0}, {0.96, 0.3416},…
0
votes
2 answers

Calculating acceleration by numerical differentiation in Python

From stylus movement measurements I got two measurements: the time and the distance. So I have two arrays, first an array of timestamps (in milliseconds) and then an array of the same size of distance measurements. For example the two arrays could…
0
votes
2 answers

Calculating the coefficients of a differentiated polynomial using re.compile and searching in python

Testing the polynomial '2x^3+4x^2+8x-16' my code below outputs [6, 8] as the coefficients of the differentiated polynomial. However, the output should be [6, 8, 8]. Why is the function getNewCoefficients producing the wrong result? What would be a…
Nutcracko
  • 23
  • 1
  • 5