• 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

DoubtingThomas29

Senior Member
Mar 4, 2007
1,358
79
✟24,402.00
Faith
Atheist
Marital Status
Single
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.


Here is the way I see it, the average of x is x bar, meaning, you have your data, you added them all up and divided by the number that were there. That gives you a fixed number that isn't changing, it suppose to be zero when you take the derivative, there is no way you could make x bar a variable, X is the variable, little x is suppose to be vlaues of the variable. Here I'll do a calculation and put what I got up here, but I don't see why you would be wrong, becaue you just have to follow the rules for taking the derivative.
 
Upvote 0

DoubtingThomas29

Senior Member
Mar 4, 2007
1,358
79
✟24,402.00
Faith
Atheist
Marital Status
Single
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 ]
I think you are not far off really, I believe the sqr[Sum[Y - Avg(y)] would be in the top not the bottom because sqr(x)*c' = x^(-1/2) *c The c doesn't go to the bottom.

With the sum[x' - davg(x)/dx] I think you don't need the chain rule there.

Sum[x - Avg(x)]^2' = 2Sum[x - Avg(x)]dx

Because the derivative is distrubting over addition, and you are taking the derivative of directly a function of x, the squaring function of x, so you stop right there and add up all the x - avg(x), since they are all being multiplied by the derivate of x, which is one really.

[quote]
final partial derivative: quotient rule




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

v^2​
[/quote]

Alright you are going to have to ask your professor about this to be sure. But those are the only suggestions I would make. Good luck, and study for actuary exams, pass two or four of them, before you finish your education. Actuarys have a good job.
 
Upvote 0

graph

Newbie
Dec 16, 2006
6
0
✟15,116.00
Faith
Atheist
Marital Status
Married
Politics
US-Democrat
what do you get when you compute


d/dx [avg(x)]

this makes no sense to me.


what is your avg(x)?

is it ...writing it in LaTeX form...


\sum_{i=1}^n\frac{x_i}{n}

"the sum of the observations divided by the sample size"

?

Is x some function of another variable? like x=x(t)

is x a function from R to R^n

x:R->R^n

like x(t)={x_1(t),...,x_n(t)}

?
 
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 do you get when you compute


d/dx [avg(x)]

this makes no sense to me.


what is your avg(x)?

is it ...writing it in LaTeX form...


\sum_{i=1}^n\frac{x_i}{n}

"the sum of the observations divided by the sample size"

?

Is x some function of another variable? like x=x(t)

is x a function from R to R^n

x:R->R^n

like x(t)={x_1(t),...,x_n(t)}

?

Yes, X is a function.

OK, here's what I think the issue is...

For the purposes of my question in the OP only, I'm looking for the partial derivatives dC/dx (to keep things simple). In this case, the extent to which I am calculating the derivatives almost looks unneeded. For example, the derivative of n^2 equals 2nn', but in most cases n' = 1 so its usually just 2n.

IRL though what I really need is dC/dw, w being a variable within the function represented by X. So for example again, if n = f(w), the derivative of n^2 equals 2n(df(w)/dw). This is why I need to see the full partial derivative, even the the little bits that are equivalent to 1.

As far as it applies to the Avg of X, as w changes, the set of X changes and therefore the average would also change.

Does that answer your question?
 
Upvote 0

graph

Newbie
Dec 16, 2006
6
0
✟15,116.00
Faith
Atheist
Marital Status
Married
Politics
US-Democrat
Yes, X is a function.

OK, here's what I think the issue is...

For the purposes of my question in the OP only, I'm looking for the partial derivatives dC/dx (to keep things simple). In this case, the extent to which I am calculating the derivatives almost looks unneeded. For example, the derivative of n^2 equals 2nn', but in most cases n' = 1 so its usually just 2n.

IRL though what I really need is dC/dw, w being a variable within the function represented by X. So for example again, if n = f(w), the derivative of n^2 equals 2n(df(w)/dw). This is why I need to see the full partial derivative, even the the little bits that are equivalent to 1.

As far as it applies to the Avg of X, as w changes, the set of X changes and therefore the average would also change.

Does that answer your question?

I think we are getting closer.

since you are taking sums and averages I would think that X represents more than just one function. I would think that it represents a sequence of functions..otherwise what is there to sum over or take an average.

So do we have functions X1(w),X2(w),...,Xn(w)?

then avg(X(w))=sum{i=1 to n}Xi(w)/n

and d[avg(X(w))]/dw=sum{i=1 to n}[dXi(w)/dw]/n
 
Upvote 0

JonF

Sapere Aude!
Site Supporter
Dec 25, 2005
5,094
147
41
California
✟73,547.00
Faith
Calvinist
Marital Status
Married
Politics
US-Republican
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 ]​
Yoru way is an ugly way:

do a change of variables and z = x-av(x),

note that z is a funciton of x.

take the derivative (you will end up with a ordinary DE from the chain rule) and back substitute

also do you know in general what d(sum[f(x)])/dx is equal to, for unconditional convergent series (if this is a conditionally convergent series we may have deeper issues than you'd think with this question)

edit:
at one point you have your denominator as: Sqr[ Sum[ x - Avg(x) ]^2 ] and in another post it is Sqr[ Sum[ x - Avg(x)^2 ]]. If it is the second (and it probably is) this is still a simple question, instead of doing a substitution you simply need to remember the avg of a function over [a,b] is 1/(b-a)int{a,b}(f(x)dx) and your FTC
 
Upvote 0