0
$\begingroup$

This question may be a little abstract, but I would like to understand how to develop a mentality towards performing statistical simulations. For example: If I have a normal distribution, and I transform it into polar coordinates, what sort of simulations can I perform (using python) to check, and improve my understanding of the transformed function.

I see this question come up a lot in my assignments and in self study books. "Perform a simulation and confirm your results" How am I supposed to be approaching this sort a problem, in a general context? Any inputs are most welcome!

$\endgroup$
1
$\begingroup$

I can neither offer a general answer, nor one in Python, but here is an example: you are asked to find the distribution of $X^2$, where $X$ is $N(0,1)$. You have a hunch that $X^2$ is distributed as $\chi^2_1$ (which google would of course tell you right away, but let us assume that is not available). Before you enter any derivations, you want to use simulation to check your hunch. Here is how that could look like in R:

library(MASS)
truehist(rnorm(1e5)^2)
x <- seq(0.01,20,by=.1)
lines(x,dchisq(x,df=1),lwd=3,col="purple")
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.