Question about Covariance and Joint PDF

Can anyone help me to construct an example of two continuous random variables X and Y whose covariance is positive, but there exist two non-decreasing functions f and g, such that the covariance of f(X) and g(Y) is negative?

I have trouble constructing bivariate joint pdf in general. How can I make sure that the joint pdf of X and Y integrates to 1, while at the same time the marginal pdf's of X and Y both integrate to 1?

Re: Question about Covariance and Joint PDF

Hey Crescent.

So basically you want Cov(X,Y) = E[XY] - E[X]E[Y] > 0 but Cov(f(X),g(Y)) = E[f(X)g(X)] - E[f(X)]E[g(X)] < 0

First consider the general situation where an increase in X results in an increase in Y. What about if you create a random variable where Y > X for all X?

Now for your f and g functions, all you have to do is apply a function using the above so that Y > X holds but f(X) < g(Y).

With regards to marginal probabilities, you might want to consider if you use the above template (i.e. something like Y > X) then how can you "scale" the PDF as the slices change as P(X = x) differs and for P(Y = y) changing as well.

Hint: Look at a symmetric PDF.

Re: Question about Covariance and Joint PDF

Thanks for your reply chiro. It is easy to contruct Y>X, Y increases in X, f(X)<g(Y), but how can you find non-decreasing f and g such that g(Y) decreases as f(X) increases?

Re: Question about Covariance and Joint PDF

Well you can always have increasing functions where one is bigger than the other.

As a simple example, consider a domain x >= 1 and the functions f(x) = x^2 and f(x) = x^3. Both are increasing, but one is bigger than the other.

A better one though for your example would be an exponential function that has a horizontal asymptote.

Consider two functions that are always increasing but have horizontal asymptotes of C and D where f(X) = C - B*e(-X) and g(Y) = D - Ae*(-Y).4

Both have a derivative greater than 0 when X and Y > 0 but one will always be greater (or less) than the other, depending on what values you use for the constants

Re: Question about Covariance and Joint PDF

Well, Chiro, I know it is easy to find two increasing funcitons f and g such that one is greater than the other. My concern was how I can find f and g such that f(X) increases as g(Y) decreases. That's the only way Cov(f(X), g(Y)) can be negative if I'm not mistaken. It is very easy to construct a counterexample that Y>X, f, g both increasing and f(X)<g(Y), Cov(X, Y)>0, but Cov(f(X), g(Y))>0. Consider X ~ N(0, 1), Y = X+2 so Y ~ N(2, 1), f(x) = 2x+3, g(y) = 2y. In this case, Cov(X, Y) = 1, Cov(f(X), g(Y)) = 4. I think I need another way to construct X and Y, letting Y = X+c does not seem to work in general I assume.