derivative of a conditional function
Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
I have a $(N*M)$ mask named $h$ which is 1 everywhere except inside a circle. I write the function form of $h$ as below:
$h(x,y, r) =begincases
0 & text if (x-c_x)^2+(y-c_y)^2 leqslant r^2 \
1 & text if (x-c_x)^2+(y-c_y)^2 > r^2
endcases$
Consider function $f$ as below:
$f(x,y, r) = frac12sum_x=0^N sum_y=0^M left ( h(x,y,r) ,mathbft(x,y)-mathbft^'(x,y)right )^2$
where $mathbft$ and $mathbft^'$ are $(N*M*5)$ arrays which are given from measurements, I want to find the optimal $r$ such that $h mathbft$ is as colse as possible to $mathbft^'$ which is the reference array. Then I have to minimize $f$ with respect to parameter $r$. Can anyone help me how to find total and gradient of function $f$?
nonlinear-optimization
add a comment |Â
up vote
-1
down vote
favorite
I have a $(N*M)$ mask named $h$ which is 1 everywhere except inside a circle. I write the function form of $h$ as below:
$h(x,y, r) =begincases
0 & text if (x-c_x)^2+(y-c_y)^2 leqslant r^2 \
1 & text if (x-c_x)^2+(y-c_y)^2 > r^2
endcases$
Consider function $f$ as below:
$f(x,y, r) = frac12sum_x=0^N sum_y=0^M left ( h(x,y,r) ,mathbft(x,y)-mathbft^'(x,y)right )^2$
where $mathbft$ and $mathbft^'$ are $(N*M*5)$ arrays which are given from measurements, I want to find the optimal $r$ such that $h mathbft$ is as colse as possible to $mathbft^'$ which is the reference array. Then I have to minimize $f$ with respect to parameter $r$. Can anyone help me how to find total and gradient of function $f$?
nonlinear-optimization
Welcome to MSE. It will be more likely that you will get an answer if you show us that you made an effort. This should be added to the question rather than in the comments.
â José Carlos Santos
Aug 2 at 12:40
Instead of typing"f"
I suggest that you type$f$
.
â md2perpe
Aug 2 at 12:59
What is the sum taken over?
â md2perpe
Aug 2 at 12:59
Does $*$ denote ordinary multiplication? If so, I suggest just skipping it, perhaps replacing it with,
to make a small space between the factors.
â md2perpe
Aug 2 at 13:01
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have a $(N*M)$ mask named $h$ which is 1 everywhere except inside a circle. I write the function form of $h$ as below:
$h(x,y, r) =begincases
0 & text if (x-c_x)^2+(y-c_y)^2 leqslant r^2 \
1 & text if (x-c_x)^2+(y-c_y)^2 > r^2
endcases$
Consider function $f$ as below:
$f(x,y, r) = frac12sum_x=0^N sum_y=0^M left ( h(x,y,r) ,mathbft(x,y)-mathbft^'(x,y)right )^2$
where $mathbft$ and $mathbft^'$ are $(N*M*5)$ arrays which are given from measurements, I want to find the optimal $r$ such that $h mathbft$ is as colse as possible to $mathbft^'$ which is the reference array. Then I have to minimize $f$ with respect to parameter $r$. Can anyone help me how to find total and gradient of function $f$?
nonlinear-optimization
I have a $(N*M)$ mask named $h$ which is 1 everywhere except inside a circle. I write the function form of $h$ as below:
$h(x,y, r) =begincases
0 & text if (x-c_x)^2+(y-c_y)^2 leqslant r^2 \
1 & text if (x-c_x)^2+(y-c_y)^2 > r^2
endcases$
Consider function $f$ as below:
$f(x,y, r) = frac12sum_x=0^N sum_y=0^M left ( h(x,y,r) ,mathbft(x,y)-mathbft^'(x,y)right )^2$
where $mathbft$ and $mathbft^'$ are $(N*M*5)$ arrays which are given from measurements, I want to find the optimal $r$ such that $h mathbft$ is as colse as possible to $mathbft^'$ which is the reference array. Then I have to minimize $f$ with respect to parameter $r$. Can anyone help me how to find total and gradient of function $f$?
nonlinear-optimization
edited Aug 2 at 13:32
asked Aug 2 at 12:33
Negar
61
61
Welcome to MSE. It will be more likely that you will get an answer if you show us that you made an effort. This should be added to the question rather than in the comments.
â José Carlos Santos
Aug 2 at 12:40
Instead of typing"f"
I suggest that you type$f$
.
â md2perpe
Aug 2 at 12:59
What is the sum taken over?
â md2perpe
Aug 2 at 12:59
Does $*$ denote ordinary multiplication? If so, I suggest just skipping it, perhaps replacing it with,
to make a small space between the factors.
â md2perpe
Aug 2 at 13:01
add a comment |Â
Welcome to MSE. It will be more likely that you will get an answer if you show us that you made an effort. This should be added to the question rather than in the comments.
â José Carlos Santos
Aug 2 at 12:40
Instead of typing"f"
I suggest that you type$f$
.
â md2perpe
Aug 2 at 12:59
What is the sum taken over?
â md2perpe
Aug 2 at 12:59
Does $*$ denote ordinary multiplication? If so, I suggest just skipping it, perhaps replacing it with,
to make a small space between the factors.
â md2perpe
Aug 2 at 13:01
Welcome to MSE. It will be more likely that you will get an answer if you show us that you made an effort. This should be added to the question rather than in the comments.
â José Carlos Santos
Aug 2 at 12:40
Welcome to MSE. It will be more likely that you will get an answer if you show us that you made an effort. This should be added to the question rather than in the comments.
â José Carlos Santos
Aug 2 at 12:40
Instead of typing
"f"
I suggest that you type $f$
.â md2perpe
Aug 2 at 12:59
Instead of typing
"f"
I suggest that you type $f$
.â md2perpe
Aug 2 at 12:59
What is the sum taken over?
â md2perpe
Aug 2 at 12:59
What is the sum taken over?
â md2perpe
Aug 2 at 12:59
Does $*$ denote ordinary multiplication? If so, I suggest just skipping it, perhaps replacing it with
,
to make a small space between the factors.â md2perpe
Aug 2 at 13:01
Does $*$ denote ordinary multiplication? If so, I suggest just skipping it, perhaps replacing it with
,
to make a small space between the factors.â md2perpe
Aug 2 at 13:01
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f2870025%2fderivative-of-a-conditional-function%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
Welcome to MSE. It will be more likely that you will get an answer if you show us that you made an effort. This should be added to the question rather than in the comments.
â José Carlos Santos
Aug 2 at 12:40
Instead of typing
"f"
I suggest that you type$f$
.â md2perpe
Aug 2 at 12:59
What is the sum taken over?
â md2perpe
Aug 2 at 12:59
Does $*$ denote ordinary multiplication? If so, I suggest just skipping it, perhaps replacing it with
,
to make a small space between the factors.â md2perpe
Aug 2 at 13:01