Monte-Carlo methods

johnaqers

New member
Joined
Dec 24, 2017
Messages
2
I have a problem with my statistics task. It sounds like this: "Using the Monte Carlo method, plot the dependence of a on b for a from -5 to 5, where [FONT=MathJax_Math-italic]P[FONT=MathJax_Main]([FONT=MathJax_Math-italic]a[FONT=MathJax_Main]<[FONT=MathJax_Math-italic]x[FONT=MathJax_Main]−[/FONT][FONT=MathJax_Math-italic]y[/FONT][FONT=MathJax_Main]<[/FONT][FONT=MathJax_Math-italic]b[/FONT][FONT=MathJax_Main])[/FONT][FONT=MathJax_Main]=[/FONT][FONT=MathJax_Main]0.95[/FONT][/FONT][/FONT][/FONT][/FONT][/FONT], where [FONT=MathJax_Math-italic]x[FONT=MathJax_Main]∼[FONT=MathJax_Math-italic]N[FONT=MathJax_Main]([FONT=MathJax_Main]0[FONT=MathJax_Main],[/FONT][FONT=MathJax_Main]1[/FONT][FONT=MathJax_Main])[/FONT][/FONT][/FONT][/FONT][/FONT][/FONT], and y is a uniformly distributed random variable from -2 to 2." what should I do, where to start? until I have no ideas.

 
I have a problem with my statistics task. It sounds like this: "Using the Monte Carlo method, plot the dependence of a on b for a from -5 to 5, where [FONT=MathJax_Math-italic]P[FONT=MathJax_Main]([FONT=MathJax_Math-italic]a[FONT=MathJax_Main]<[FONT=MathJax_Math-italic]x[FONT=MathJax_Main]−[/FONT][FONT=MathJax_Math-italic]y[/FONT][FONT=MathJax_Main]<[/FONT][FONT=MathJax_Math-italic]b[/FONT][FONT=MathJax_Main])[/FONT][FONT=MathJax_Main]=[/FONT][FONT=MathJax_Main]0.95[/FONT][/FONT][/FONT][/FONT][/FONT][/FONT], where [FONT=MathJax_Math-italic]x[FONT=MathJax_Main]∼[FONT=MathJax_Math-italic]N[FONT=MathJax_Main]([FONT=MathJax_Main]0[FONT=MathJax_Main],[/FONT][FONT=MathJax_Main]1[/FONT][FONT=MathJax_Main])[/FONT][/FONT][/FONT][/FONT][/FONT][/FONT], and y is a uniformly distributed random variable from -2 to 2." what should I do, where to start? until I have no ideas.

You say you have no idea.

Do you know what does the Monte Carlo method do?

Is it a theoretical model based on physical laws?

Is it a graphical simulation method?

Or something else?

What is the output of this process?
 
I know, that Monte Carlo method is a numerical method for solving mathematical problems using the simulation of random variables. And if we need to calculate some unknown value m we try to think up such a random variable Xi, so that Mxi = m. I was previously advised to do the following:
1.Pick an x and y randomly according to their densities and then compute x−y. Do this N times.
2.Make a list x−y values.
3.Sort the list in ascending order.
4.Fix an a which is in [−5,5].
5.From count number of values more than b, call this k.
⋅⋅ If k/N>0.95: Count from smallest value till you get the k/N less more or less equal to 0.95. The value you find is the a
⋅⋅ If k/N<0.95:
No such a exists."
I tried to code it and I have a lot of questions.
First of all, I did the following:
I created two random variables:
x<-rnorm(10,mean=0,sd=1)
y<-runif(10,min=-2,max=2)
Then I calculated diff<-x-y. But the process of coding stopped at the 5thitem which
sounds like this: From count number of values more than a, call this k. What should I do here? I must take values from x−y, which are more than a? Then I should count k/Nand if it is more than 0.95 what is next? "Count from smallest value", but what smallest value? To be honest, I did not understand anything in the following answer. I have never used Monte-Carlo methods. After that, I wanted to do this task by myself. I picked randomly x,y, according to their densities and then calculated x-y. Then I tried to calculate a and b like that: a=m-1.96*(sd/N)1/2,b=m+1.96*(sd/N)1/2
But this is incorrect, because a should be from -5 to 5, and x-y has the unknown distribution.

 
Last edited:
Top