• Starting today August 7th, 2024, in order to post in the Married Couples, Courting Couples, or Singles forums, you will not be allowed to post if you have your Marital status designated as private. Announcements will be made in the respective forums as well but please note that if yours is currently listed as Private, you will need to submit a ticket in the Support Area to have yours changed.

  • CF has always been a site that welcomes people from different backgrounds and beliefs to participate in discussion and even debate. That is the nature of its ministry. In view of recent events emotions are running very high. We need to remind people of some basic principles in debating on this site. We need to be civil when we express differences in opinion. No personal attacks. Avoid you, your statements. Don't characterize an entire political party with comparisons to Fascism or Communism or other extreme movements that committed atrocities. CF is not the place for broad brush or blanket statements about groups and political parties. Put the broad brushes and blankets away when you come to CF, better yet, put them in the incinerator. Debate had no place for them. We need to remember that people that commit acts of violence represent themselves or a small extreme faction.

Math problem: derivative of correlation coefficient

Sojourner<><

Incoherent Freedom Fighter
Mar 23, 2005
1,606
14
45
✟24,385.00
Faith
Non-Denom
Marital Status
Married
Politics
US-Others
Note to Mods: Sorry if this is in the wrong section. There doesn't seem to be any better place to post in on the forums but I really need help so I'm posting anyways.

I need to find the partial derivative with regard to x for a normal correlation coefficient function. The function is:



C(x,y) =
Sum[ (x - Avg(x)) * (y - Avg(y)) ]
Sqr[ Sum[ x - Avg(x) ]^2 ] * Sqr[ Sum[ y - Avg(y) ]^2 ]
What I have so far is:

Numerator
let u = Sum[ (x - Avg(x)) * (y - Avg(y)) ]​
partial derivative of numerator: sum rule, constant multiple, chain rule
du/dx = Sum[ (y - Avg(y)) * (x' - dAvg(x)/dx) ]​
denominator
let v = Sqr[ Sum[ x - Avg(x) ]^2 ] * Sqr[ Sum[ y - Avg(y) ]^2 ]​
partial derivative of denominator: constant multiple, chain rule, sum rule
dv/dx = (1/2) * Sqr[ Sum[ y - Avg(y) ]^2 ] * (Sum[ x - Avg(x) ]^2)^(-1/2) * 2* Sum[ x - Avg(x) ] * Sum[ x' - dAvg(x)/dx ]​
final partial derivative: quotient rule


dC/dx =
du/dx*v - u*dv/dx
v^2
 

lawtonfogle

My solace my terror, my terror my solace.
Apr 20, 2005
11,586
350
36
✟13,892.00
Faith
Christian
can't
see
what
is
going
own
....

I don't like the formatting, mind neatly (or as best as you can) doing the problem in paint and posting the image?
I have had basic college analysis (up to Taylor polynomials and such), intro to number theory, and linear algebra, so I don't know if I can help you or not.
 
Upvote 0

Sojourner<><

Incoherent Freedom Fighter
Mar 23, 2005
1,606
14
45
✟24,385.00
Faith
Non-Denom
Marital Status
Married
Politics
US-Others
can't
see
what
is
going
own
....

I don't like the formatting, mind neatly (or as best as you can) doing the problem in paint and posting the image?
I have had basic college analysis (up to Taylor polynomials and such), intro to number theory, and linear algebra, so I don't know if I can help you or not.

I wish I could but I don't have any sort of software that could use the right symbols.
 
Upvote 0

decoytdtc

Junior Member
Apr 26, 2008
261
6
✟22,911.00
Faith
Atheist
Marital Status
Single
Politics
US-Others
Unless I'm missing something here, you may be making this more complicated than it really is.

I would just use the quotient rule, splitting up the partials with the product rule. I don't think you need to expand the summations in this case, or you can just put a partial derivative initially and solve/expand later.

With sqrts on the bottom, the quotient rule should come out nicely.

Sum[(x - avg(x))(y - avg(y))]
Sqr[(x - Avg(x))^2)]*Sqr[(y - Avg(y))^2)]

EDIT: Wait, if I'm reading your work correctly, is c just a function of x? Not y? If that's the case, it's even simpler.
 
Upvote 0

Sojourner<><

Incoherent Freedom Fighter
Mar 23, 2005
1,606
14
45
✟24,385.00
Faith
Non-Denom
Marital Status
Married
Politics
US-Others
Unless I'm missing something here, you may be making this more complicated than it really is.

I would just use the quotient rule, splitting up the partials with the product rule. I don't think you need to expand the summations in this case, or you can just put a partial derivative initially and solve/expand later.

With sqrts on the bottom, the quotient rule should come out nicely.

Sum[(x - avg(x))(y - avg(y))]
Sqr[(x - Avg(x))^2)]*Sqr[(y - Avg(y))^2)]

EDIT: Wait, if I'm reading your work correctly, is c just a function of x? Not y? If that's the case, it's even simpler.

My mistake, it's a function of two sets of data: x and y. What I need is the partial derivative with respect to x.
 
Upvote 0

lawtonfogle

My solace my terror, my terror my solace.
Apr 20, 2005
11,586
350
36
✟13,892.00
Faith
Christian
I wish I could but I don't have any sort of software that could use the right symbols.

Well, even microsoft word should support the basic symbols (then again, you almost need a phd to find the button to click to use them...)

But why not use something like paint?
 
Upvote 0

Sojourner<><

Incoherent Freedom Fighter
Mar 23, 2005
1,606
14
45
✟24,385.00
Faith
Non-Denom
Marital Status
Married
Politics
US-Others
The thing I'm most stuck on right now is the final portion of the partial derivative of the denominator:


Is the derivative of:
Sum[ x - Avg(x) ]^2​

equal to this:
2 * Sum[ x - Avg(x) ] * Sum[ x' - dAvg(x)/dx ]​

or this?
2 * Sum[ x*x' - Avg(x)*dAvg(x)/dx ]

Or am I wrong and its something completely different?

It don't think that the content of the summation is actually a nested function, so the chain rule shouldn't apply as in the first example, right? An equivalent statement would be like (x+y+z...)^2 and its derivative wrt x would just be 2(x + y + z ...) or 2(xx' + y + z...) in the case that x contains another nested function.... I think....
 
Upvote 0

decoytdtc

Junior Member
Apr 26, 2008
261
6
✟22,911.00
Faith
Atheist
Marital Status
Single
Politics
US-Others
The thing I'm most stuck on right now is the final portion of the partial derivative of the denominator:


Is the derivative of:
Sum[ x - Avg(x) ]^2​
equal to this:
2 * Sum[ x - Avg(x) ] * Sum[ x' - dAvg(x)/dx ]​
or this?
2 * Sum[ x*x' - Avg(x)*dAvg(x)/dx ]

Or am I wrong and its something completely different?

It don't think that the content of the summation is actually a nested function, so the chain rule shouldn't apply as in the first example, right? An equivalent statement would be like (x+y+z...)^2 and its derivative wrt x would just be 2(x + y + z ...) or 2(xx' + y + z...) in the case that x contains another nested function.... I think....
If you have a finite index for your summation, you can just expand it out as a series.

If not, you can treat it like a chain rule as you did in your first reasoning

2 * Sum[ x - Avg(x) ] * Sum[ x' - dAvg(x)/dx ]

However, I believe the sum of the derivative of the "inside" of the chain rule will just be the sum of n(i), because x' with respect to x is just 1 and dAvg(x)/dx is 0 because it's the derivative of a constant.

On another note, can you send me a link to where you're getting your original correlation coefficient? I'm used to seeing it in terms of standard deviation.

EDIT: Also, do you have Maple or another math program?
 
Upvote 0

Sojourner<><

Incoherent Freedom Fighter
Mar 23, 2005
1,606
14
45
✟24,385.00
Faith
Non-Denom
Marital Status
Married
Politics
US-Others
If you have a finite index for your summation, you can just expand it out as a series.

If not, you can treat it like a chain rule as you did in your first reasoning

2 * Sum[ x - Avg(x) ] * Sum[ x' - dAvg(x)/dx ]

However, I believe the sum of the derivative of the "inside" of the chain rule will just be the sum of n(i), because x' with respect to x is just 1 and dAvg(x)/dx is 0 because it's the derivative of a constant.

On another note, can you send me a link to where you're getting your original correlation coefficient? I'm used to seeing it in terms of standard deviation.

EDIT: Also, do you have Maple or another math program?

I wish it were that simple but the value of x is composed of several more differentiable functions, so I definately need to figure out where it all fits in.

The definition of the coefficient that I'm using does use the standard deviations of x and y, but in order to get the function to return a value between 1 and -1, I've had to use a modified stdev. (see attached image)

note that E(X) is not the sum of the set, but rather the expected value or mean of the set.

I wish I had maple but it's way too expensive...
 

Attachments

  • Image2.jpg
    Image2.jpg
    6.8 KB · Views: 67
  • Image3.jpg
    Image3.jpg
    6.7 KB · Views: 102
Upvote 0

decoytdtc

Junior Member
Apr 26, 2008
261
6
✟22,911.00
Faith
Atheist
Marital Status
Single
Politics
US-Others
I wish it were that simple but the value of x is composed of several more differentiable functions, so I definately need to figure out where it all fits in.

The definition of the coefficient that I'm using does use the standard deviations of x and y, but in order to get the function to return a value between 1 and -1, I've had to use a modified stdev. (see attached image)

note that E(X) is not the sum of the set, but rather the expected value or mean of the set.

I wish I had maple but it's way too expensive...
Well, either way, I'm pretty sure then this is right track

2 * Sum[ x - Avg(x) ] * Sum[ x' - dAvg(x)/dx ]

You just can't make the assumptions I just did about Sum[ x' - dAvg(x)/dx ] this part

EDIT: So looking back on the whole picture, I guess don't forget to hold y constant for the denom... just because when you're doing a the derivative you might drop a term
 
Upvote 0

Sojourner<><

Incoherent Freedom Fighter
Mar 23, 2005
1,606
14
45
✟24,385.00
Faith
Non-Denom
Marital Status
Married
Politics
US-Others
Well, either way, I'm pretty sure then this is right track

2 * Sum[ x - Avg(x) ] * Sum[ x' - dAvg(x)/dx ]

You just can't make the assumptions I just did about Sum[ x' - dAvg(x)/dx ] this part

EDIT: So looking back on the whole picture, I guess don't forget to hold y constant for the denom... just because when you're doing a the derivative you might drop a term

Yeah... oh man, what a headache...
 
Upvote 0

Sojourner<><

Incoherent Freedom Fighter
Mar 23, 2005
1,606
14
45
✟24,385.00
Faith
Non-Denom
Marital Status
Married
Politics
US-Others
What exactly are you summing over?

From what you have written you are summing over x and differentiating w.r.t. x ... that doesn't seem right.


what exactly is x?

What is your ultimate goal here?

X represents the output pattern of a neural network. The goal is to make incremental adjustments to its weight variables through gradient ascent. But in order to do that I need to find the partial derivatives of the final correlatoin wrt each weight.
 
Upvote 0

DoubtingThomas29

Senior Member
Mar 4, 2007
1,358
79
✟24,402.00
Faith
Atheist
Marital Status
Single
I have a Master's in mathematical statistics, I haven't looked at what you wrote too closely, but the average of x that is x with a bar over it, that is an exact number, a constant, so the derivative of that would be zero. The x is the variable, and y would be treated as a constant in the partial derivative.

If you think this is hard, wait until you take a design of experiments class, where you have to prove all these different theroems, with correlations in them. You won't even know what you are proving, because, it is so hard to understand what the definitions have to do with statistical analysis. This is if you go into the theory of statistics, not the applied side of statistics.

I'll look at your formula tomorrow to see if anything is wrong, and I'll write one out for you too.

Remember d(avg x)/dx = 0.
 
Upvote 0

Corey

Veteran
Mar 7, 2002
2,874
156
50
Illinois
Visit site
✟26,487.00
Faith
Deist
Marital Status
Married
Politics
US-Democrat
X represents the output pattern of a neural network. The goal is to make incremental adjustments to its weight variables through gradient ascent. But in order to do that I need to find the partial derivatives of the final correlatoin wrt each weight.

Are you looking for the partial correlation coefficients then?
 
Upvote 0

Sojourner<><

Incoherent Freedom Fighter
Mar 23, 2005
1,606
14
45
✟24,385.00
Faith
Non-Denom
Marital Status
Married
Politics
US-Others
Remember d(avg x)/dx = 0.

Thanks alot for the help. I really need it.

Anyways, the thing you have to know about the Avg is that it's only constant while calculating the coefficient. The set X is the result of feeding input data through an array of weight variables and an activation function. The input values are a constant set during training, but the weight values are not, so any change there would affect the value of the average of the entire set.
 
Upvote 0

Sojourner<><

Incoherent Freedom Fighter
Mar 23, 2005
1,606
14
45
✟24,385.00
Faith
Non-Denom
Marital Status
Married
Politics
US-Others
I have a Master's in mathematical statistics, I haven't looked at what you wrote too closely, but the average of x that is x with a bar over it, that is an exact number, a constant, so the derivative of that would be zero. The x is the variable, and y would be treated as a constant in the partial derivative.

If you think this is hard, wait until you take a design of experiments class, where you have to prove all these different theroems, with correlations in them. You won't even know what you are proving, because, it is so hard to understand what the definitions have to do with statistical analysis. This is if you go into the theory of statistics, not the applied side of statistics.

I'll look at your formula tomorrow to see if anything is wrong, and I'll write one out for you too.

Remember d(avg x)/dx = 0.

Yeah, it's already beginning to feel that way...

any help would be appreciated.
 
Upvote 0