# Thread: transformation problem

1. ## transformation problem

If , find the distribution of

2. ## Re: transformation problem

Originally Posted by Sambit
If , find the distribution of
Do you want me to just provide you with the answer?

3. ## Re: transformation problem

Hint: transformation is 1-1 in the support (1 <x <1). Apply Jacobian rule.

4. ## Re: transformation problem

Originally Posted by Dragan
Do you want me to just provide you with the answer?
I agree. Sambit just because you're a somewhat regular poster doesn't mean you're exempt from following the guidelines especially those pertaining to homework help. So please show a little work. Tell us what's giving you trouble. You've been here quite a few times and we're glad to help but REALLY try to do the problem first. You don't learn nearly as much when we give you hints along the way, you still learn if we don't just give you the answer. But if you can go through the entire process yourself (even if it takes longer) then you'll get more out of it.

5. ## Re: transformation problem

Actually I got stuck at the very beginning. Suppose I want to calculate the distribution of log X from the distribution of X. In such case, we write Y=log X and consequently X=exp(Y) and hence apply the transformation formula using Jacobian etc. But here, Y=3x^2 - 2x^3, so I am unable to write X=f(Y).

@ Dragan and Dason: I don't want direct answer, just the procedure or any help regarding that would be enough.

6. ## Re: transformation problem

Originally Posted by Sambit
@ Dragan and Dason: I don't want direct answer, just the procedure or any help regarding that would be enough.
Even so we would appreciate if you show a little work or at least tell us where you got stuck. I still propose that reading and following the guidelines that TheEcologist kindly wrote up is a good thing.

7. ## Re: transformation problem

Originally Posted by Sambit
I got stuck at the very beginning. Suppose I want to calculate the distribution of log X from the distribution of X. In such case, we write Y=log X and consequently X=exp(Y) and hence apply the transformation formula using Jacobian etc. But here, Y=3x^2 - 2x^3, and I am unable to write X=f(Y).
This is my problem, Dason.

......I know the distribution of X. But in order to get the distribution of Y, I need to substitute X in terms of Y in the given pdf, which I can't. Got the point?

8. ## Re: transformation problem

Originally Posted by Sambit
This is my problem, Dason.

......I know the distribution of X. But in order to get the distribution of Y, I need to substitute X in terms of Y in the given pdf, which I can't. Got the point?
Oh I understand what your problem is. I was just letting you know for future reference. Sometimes if I get stuck on a problem I like to actually simulate what's going on. I wrote up some R code to simulate from the distribution you gave and then I apply the transformation to see what it looks like the transformations density is.
Code:
# Density to sample from
func <- function(x){return(6*(x-x^2))}

# Function to do the sampling
sampfunc <- function(){
cont <- TRUE
x <- 0
while(cont){
x <- runif(1)
y <- runif(1,0,1.5)
if(y <= func(x)){
cont <- FALSE
}
}
return(x)
}

# Get a sample from your distribution
dat <- replicate(10000, sampfunc())

# Look at the sample
hist(dat)

# Make the specified transformation
trans <- -2*dat^3 + 3*dat^2

# interesting
hist(trans)
I'm assuming you're used R before? Maybe not... but anywho it's interesting.

If you do use R you might get a big hint from what the transformation looks like.

If not I can offer another hint. Do the functional form of the original density and the functional form of the transformation look related in any way? I'm not necessarily talking about a linear transformation or something like that but you should notice a connection. Also you should take note of Vinux's response in the 3rd post. It's quite useful...

Edit: I attached the histograms in case you don't have R.

9. ## Re: transformation problem

I just notice that the given pdf is derivative of Y. How does that help?

Regarding R, I know just some introductory calculations in R, like summarization of data, testing, drawing curves etc. As far as I understand, you first define a function. Can't understand the next step.

10. ## Re: transformation problem

The next step is a rejection sampling algorithm. I write it get a random sample from the density you provided. There are more efficient ways but this was the quickest thing that came to my mind.

11. ## Re: transformation problem

Originally Posted by Sambit

But here, Y=3x^2 - 2x^3, so I am unable to write X=f(Y).

Sambit, you should have said this in your original post. Anyway, try this

.

12. ## Re: transformation problem

Originally Posted by Dragan
Sambit, you should have said this in your original post. Anyway, try this

.
This is true. But there is a nice little trick that once you see makes the problem very simple. Sambit you already mentioned that the density is the derivative of the transformation. Let me phrase that in an equivalent but possibly more useful way.

If the density is the derivative of the transformation that means that the transformation is the integral of the density. What is the integral of a density? The transformation is the CDF of the density. So if F is the cdf and X is a random variable associated with the density then what you're looking at is Y = F(X). Do you know any results related to this?

13. ## Re: transformation problem

You are possibly talking about the fact that CDF of any continuous rv follows Uniform distribution...

14. ## Re: transformation problem

Originally Posted by Sambit
You are possibly talking about the fact that CDF of any continuous rv follows Uniform distribution...
Well that's close to what I'm talking about. If you apply the CDF of a continuous random variable (with positive probability on its support) to the random itself then you get a uniform r.v. Linky

15. ## Re: transformation problem

Originally Posted by Dason
... If you apply the CDF of a continuous random variable (with positive probability on its support) to the random itself then you get a uniform r.v.[/URL]
Well, if you put the result that I gave into the upper limit of an integral (using the original pdf and 0 at the lower limit), then one should be able to easily obtain the uniform cdf.