Sunteți pe pagina 1din 2

University of Science and Technology of Southern Philippines

C.M. Recto Avenue, Lapasan, Cagayan de Oro City 9000 Philippines

DEPARTMENT OF MATHEMATICAL SCIENCES

Midterm Examination
Simulation and Monte Carlo Methods
1st Semester SY 2018 – 2019

GENERAL DIRECTIONS: Do not write anything on this questionnaire. Use the exam booklet as
your answer sheet. Show your solutions whenever possible. No sharing of calculators.

Write down the answers clearly and briefly.

1. Without running it in Matlab, what is the output of the syntax A = reshape (1:15, 3,5)’.

2. Without running it in Matlab, what is the output of the syntax B = [ 1; 2; 3]’

3. The sum of t independent ____________, with same parameter ___, is a Gamma random variable with
parameters ____ and _____.

4. Write down the algorithm of generating random variable using inverse transform method (continuous
case)

5. A chi-square random variable with v degrees of freedom is a special case of the ________ distribution,
where λ = _____ and t = _______.

6. Write the procedure for Monte Carlo Assessment of Type I error.

7. Write a function which takes a variable x and returns the value of 2x. Make sure that your codes works
for variables which are scalars, vectors and matrices.
8. Write a function in Matlab which takes a variable x and y; and returns the outputs x 2− y 2 and
sin ⁡( x+ y). The range is [ 0, 2π ].

9. Generate a random sample that is uniformly distributed over the interval (0, 1). Plot the empirical
distribution function over the interval (-0.5, 1.5). Note: You can also use the function cdfplot that will do
this.

10. Generate a random sample of size 100 from a normal distribution with mean 10 and variance 2. Plot the
empirical cumulative distribution function. What is the value of the empirical distribution function evaluated
at a point less than the smallest observation in your random sample?

11. The code to illustrate acceptance-rejection method was already discussed (see example 4.4). Write down
the code that will show the figure next page.
12. Write a function that will generate chi-squre random variables with v degree of freedom by generating v
standard normals, squaring them and then adding them up. Generate some random variables and plot a
histogram.

13. An alternative method for generating beta random variables is described in Rubinstein (1981). Generate
1 1
two variates Y =u α and Y =u β . If Y 1 +Y 2 ≤ 1, then
1 1 2 2
Y1
X=
Y 1+Y 2
is from a Beta distribution.with paramenters α ∧β. Implement this algorithm.
14. The mcdata dataset contains 125 observations. We are interested in using these data to test the following
null and alternative hypothesis:
Ho: µ = 454
Ha: µ ≠ 454
Implement Monte Carlo simulation using a two-tail test.

15. As in problem 14, use Monte Carlo assessment of Type I error. Plot the estimated power as a function of
µ for larger values of M.
END.

GOD BLESS!

S-ar putea să vă placă și