Gradient of a function with integral
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Let $mathbfx$ be a $ntimes 1$ vector. Let $mu(mathbfx)$ and $sigma(mathbfx)$ be scalar functions of $mathbfx$. What is the derivative of the following function w.r.to $mathbfx$ $$f(mathbfx)=int_-infty^0 exp(-frac(z-mu(mathbfx))^2sigma^2(mathbfx))dz$$
calculus real-analysis multivariable-calculus
add a comment |Â
up vote
0
down vote
favorite
Let $mathbfx$ be a $ntimes 1$ vector. Let $mu(mathbfx)$ and $sigma(mathbfx)$ be scalar functions of $mathbfx$. What is the derivative of the following function w.r.to $mathbfx$ $$f(mathbfx)=int_-infty^0 exp(-frac(z-mu(mathbfx))^2sigma^2(mathbfx))dz$$
calculus real-analysis multivariable-calculus
1
What have you done so far?
– Kavi Rama Murthy
Aug 3 at 11:45
I couldn't make any progress. This is not a homework problem if that's your concern. I need the gradient of this function for a non-convex optimization problem.
– dineshdileep
Aug 3 at 12:02
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Let $mathbfx$ be a $ntimes 1$ vector. Let $mu(mathbfx)$ and $sigma(mathbfx)$ be scalar functions of $mathbfx$. What is the derivative of the following function w.r.to $mathbfx$ $$f(mathbfx)=int_-infty^0 exp(-frac(z-mu(mathbfx))^2sigma^2(mathbfx))dz$$
calculus real-analysis multivariable-calculus
Let $mathbfx$ be a $ntimes 1$ vector. Let $mu(mathbfx)$ and $sigma(mathbfx)$ be scalar functions of $mathbfx$. What is the derivative of the following function w.r.to $mathbfx$ $$f(mathbfx)=int_-infty^0 exp(-frac(z-mu(mathbfx))^2sigma^2(mathbfx))dz$$
calculus real-analysis multivariable-calculus
asked Aug 3 at 11:36
dineshdileep
5,67711434
5,67711434
1
What have you done so far?
– Kavi Rama Murthy
Aug 3 at 11:45
I couldn't make any progress. This is not a homework problem if that's your concern. I need the gradient of this function for a non-convex optimization problem.
– dineshdileep
Aug 3 at 12:02
add a comment |Â
1
What have you done so far?
– Kavi Rama Murthy
Aug 3 at 11:45
I couldn't make any progress. This is not a homework problem if that's your concern. I need the gradient of this function for a non-convex optimization problem.
– dineshdileep
Aug 3 at 12:02
1
1
What have you done so far?
– Kavi Rama Murthy
Aug 3 at 11:45
What have you done so far?
– Kavi Rama Murthy
Aug 3 at 11:45
I couldn't make any progress. This is not a homework problem if that's your concern. I need the gradient of this function for a non-convex optimization problem.
– dineshdileep
Aug 3 at 12:02
I couldn't make any progress. This is not a homework problem if that's your concern. I need the gradient of this function for a non-convex optimization problem.
– dineshdileep
Aug 3 at 12:02
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
For simplicity, let the function in the exponential be $Gamma(z, vecx)$ and the function under the integral $f(z, vecx)$. The function in question is integrable for every $vecx$. $\$
The partial derivative with respect to $x_i$ of your function:
$$ partial_x_i = exp (Gamma(z, vecx) cdot partial_x_iGamma(z, vecx) = f(z, vecx) cdot partial_x_iGamma(z, vecx) $$
Since we're integrating on a different variable than any $x_i$, if the above is integrable over the same domain then you can switch derivatives and integrals, which means that the $i$-th component of the gradient:
$$nabla_i int_infty^0 f(z, vecx) dz = int_infty^0 f(z, vecx) cdot partial_x_iGamma(z, vecx) dz $$
I believe one can find the final expression from here. I'll fill in the final details as soon as I have a piece of paper to sketch the final result.
add a comment |Â
up vote
0
down vote
$$nabla_x f(x) = int_-infty^0nabla_x exp(-frac(z-mu(x))^2sigma(x)^2) dz \= int_-infty^0 exp(-frac(z-mu(x))^2sigma(x)^2) left[2frac(z-mu(x))nabla_x musigma(x)^2 +2 frac(z-mu(x))^2nabla_xsigmasigma(x)^3right]dz$$.
The first part, $propto nabla_xmu$, you may easily integrate by taking $nabla_xmu$ out of the integral and realizing
$$
2frac(z-mu(x))sigma(x)^2 = partial_z frac(z-mu(x))^2sigma(x)^2
$$
The second part has no closed form and may only be expressed in term of error-functions (as one may calculate by using the product rule und definition of $erf$):
$$
int x^2 exp(-x^2)dx = frac14(sqrtpierf(x)-2exp(-x^2)x) + C
$$
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
For simplicity, let the function in the exponential be $Gamma(z, vecx)$ and the function under the integral $f(z, vecx)$. The function in question is integrable for every $vecx$. $\$
The partial derivative with respect to $x_i$ of your function:
$$ partial_x_i = exp (Gamma(z, vecx) cdot partial_x_iGamma(z, vecx) = f(z, vecx) cdot partial_x_iGamma(z, vecx) $$
Since we're integrating on a different variable than any $x_i$, if the above is integrable over the same domain then you can switch derivatives and integrals, which means that the $i$-th component of the gradient:
$$nabla_i int_infty^0 f(z, vecx) dz = int_infty^0 f(z, vecx) cdot partial_x_iGamma(z, vecx) dz $$
I believe one can find the final expression from here. I'll fill in the final details as soon as I have a piece of paper to sketch the final result.
add a comment |Â
up vote
0
down vote
For simplicity, let the function in the exponential be $Gamma(z, vecx)$ and the function under the integral $f(z, vecx)$. The function in question is integrable for every $vecx$. $\$
The partial derivative with respect to $x_i$ of your function:
$$ partial_x_i = exp (Gamma(z, vecx) cdot partial_x_iGamma(z, vecx) = f(z, vecx) cdot partial_x_iGamma(z, vecx) $$
Since we're integrating on a different variable than any $x_i$, if the above is integrable over the same domain then you can switch derivatives and integrals, which means that the $i$-th component of the gradient:
$$nabla_i int_infty^0 f(z, vecx) dz = int_infty^0 f(z, vecx) cdot partial_x_iGamma(z, vecx) dz $$
I believe one can find the final expression from here. I'll fill in the final details as soon as I have a piece of paper to sketch the final result.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
For simplicity, let the function in the exponential be $Gamma(z, vecx)$ and the function under the integral $f(z, vecx)$. The function in question is integrable for every $vecx$. $\$
The partial derivative with respect to $x_i$ of your function:
$$ partial_x_i = exp (Gamma(z, vecx) cdot partial_x_iGamma(z, vecx) = f(z, vecx) cdot partial_x_iGamma(z, vecx) $$
Since we're integrating on a different variable than any $x_i$, if the above is integrable over the same domain then you can switch derivatives and integrals, which means that the $i$-th component of the gradient:
$$nabla_i int_infty^0 f(z, vecx) dz = int_infty^0 f(z, vecx) cdot partial_x_iGamma(z, vecx) dz $$
I believe one can find the final expression from here. I'll fill in the final details as soon as I have a piece of paper to sketch the final result.
For simplicity, let the function in the exponential be $Gamma(z, vecx)$ and the function under the integral $f(z, vecx)$. The function in question is integrable for every $vecx$. $\$
The partial derivative with respect to $x_i$ of your function:
$$ partial_x_i = exp (Gamma(z, vecx) cdot partial_x_iGamma(z, vecx) = f(z, vecx) cdot partial_x_iGamma(z, vecx) $$
Since we're integrating on a different variable than any $x_i$, if the above is integrable over the same domain then you can switch derivatives and integrals, which means that the $i$-th component of the gradient:
$$nabla_i int_infty^0 f(z, vecx) dz = int_infty^0 f(z, vecx) cdot partial_x_iGamma(z, vecx) dz $$
I believe one can find the final expression from here. I'll fill in the final details as soon as I have a piece of paper to sketch the final result.
answered Aug 3 at 13:33


Niki Di Giano
650211
650211
add a comment |Â
add a comment |Â
up vote
0
down vote
$$nabla_x f(x) = int_-infty^0nabla_x exp(-frac(z-mu(x))^2sigma(x)^2) dz \= int_-infty^0 exp(-frac(z-mu(x))^2sigma(x)^2) left[2frac(z-mu(x))nabla_x musigma(x)^2 +2 frac(z-mu(x))^2nabla_xsigmasigma(x)^3right]dz$$.
The first part, $propto nabla_xmu$, you may easily integrate by taking $nabla_xmu$ out of the integral and realizing
$$
2frac(z-mu(x))sigma(x)^2 = partial_z frac(z-mu(x))^2sigma(x)^2
$$
The second part has no closed form and may only be expressed in term of error-functions (as one may calculate by using the product rule und definition of $erf$):
$$
int x^2 exp(-x^2)dx = frac14(sqrtpierf(x)-2exp(-x^2)x) + C
$$
add a comment |Â
up vote
0
down vote
$$nabla_x f(x) = int_-infty^0nabla_x exp(-frac(z-mu(x))^2sigma(x)^2) dz \= int_-infty^0 exp(-frac(z-mu(x))^2sigma(x)^2) left[2frac(z-mu(x))nabla_x musigma(x)^2 +2 frac(z-mu(x))^2nabla_xsigmasigma(x)^3right]dz$$.
The first part, $propto nabla_xmu$, you may easily integrate by taking $nabla_xmu$ out of the integral and realizing
$$
2frac(z-mu(x))sigma(x)^2 = partial_z frac(z-mu(x))^2sigma(x)^2
$$
The second part has no closed form and may only be expressed in term of error-functions (as one may calculate by using the product rule und definition of $erf$):
$$
int x^2 exp(-x^2)dx = frac14(sqrtpierf(x)-2exp(-x^2)x) + C
$$
add a comment |Â
up vote
0
down vote
up vote
0
down vote
$$nabla_x f(x) = int_-infty^0nabla_x exp(-frac(z-mu(x))^2sigma(x)^2) dz \= int_-infty^0 exp(-frac(z-mu(x))^2sigma(x)^2) left[2frac(z-mu(x))nabla_x musigma(x)^2 +2 frac(z-mu(x))^2nabla_xsigmasigma(x)^3right]dz$$.
The first part, $propto nabla_xmu$, you may easily integrate by taking $nabla_xmu$ out of the integral and realizing
$$
2frac(z-mu(x))sigma(x)^2 = partial_z frac(z-mu(x))^2sigma(x)^2
$$
The second part has no closed form and may only be expressed in term of error-functions (as one may calculate by using the product rule und definition of $erf$):
$$
int x^2 exp(-x^2)dx = frac14(sqrtpierf(x)-2exp(-x^2)x) + C
$$
$$nabla_x f(x) = int_-infty^0nabla_x exp(-frac(z-mu(x))^2sigma(x)^2) dz \= int_-infty^0 exp(-frac(z-mu(x))^2sigma(x)^2) left[2frac(z-mu(x))nabla_x musigma(x)^2 +2 frac(z-mu(x))^2nabla_xsigmasigma(x)^3right]dz$$.
The first part, $propto nabla_xmu$, you may easily integrate by taking $nabla_xmu$ out of the integral and realizing
$$
2frac(z-mu(x))sigma(x)^2 = partial_z frac(z-mu(x))^2sigma(x)^2
$$
The second part has no closed form and may only be expressed in term of error-functions (as one may calculate by using the product rule und definition of $erf$):
$$
int x^2 exp(-x^2)dx = frac14(sqrtpierf(x)-2exp(-x^2)x) + C
$$
edited Aug 3 at 13:59
answered Aug 3 at 13:53
denklo
913
913
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2870975%2fgradient-of-a-function-with-integral%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
What have you done so far?
– Kavi Rama Murthy
Aug 3 at 11:45
I couldn't make any progress. This is not a homework problem if that's your concern. I need the gradient of this function for a non-convex optimization problem.
– dineshdileep
Aug 3 at 12:02