2018 Ex1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

MAS472/6004: Assessed Exercises 1

Richard Wilkinson
5 March 2018

This is the first set of assessed exercises for MAS6004/472.


• It is worth 5% of the module mark.
• The deadline for submission is 12pm (noon) on 27 March (extended due to the industrial action).
• All work should be submitted through MOLE.
• Requests for extensions will require a medical note.
• An integer mark will be awarded out of 5 for each piece of coursework.
• Solutions will be provided.
• Please use Rmarkdownhttp://rmarkdown.rstudio.com/authoring_quick_tour.html to produce your
solutions (pdf, html or word is acceptable as a submission format). This will ensure that your work is
reproducible, help you to avoid errors in your coding, and will ensure I can see all the steps you took in
producing your solution.
• Please use a filename of the form StudentNumber_Name.pdf. So if your student number is 12345 and
your name Aloysius, you would name your file 12345\_Aloysius.pdf.
Present your work in exam format: you must include all your working and present your solutions clearly, but
otherwise, no marks will be awarded for presentation or commentary.
Your submitted solutions must be entirely your own work: do not work with anyone else on your exercises.

Question 1
Z 4
x2 sin(x2 ) + cos(ex ) dx.

Let I=
1
• Estimate the integral via Monte Carlo, using N = 1000 Monte Carlo samples. Give a 95% confidence
interval for your estimate.
• By varying the number of Monte Carlo samples you use, investigate and then describe how the root
mean square error of your estimator scales with N .
• How large would N need to be to make the 95% confidence interval no wider than 10−2 ?

Question 2

Consider the sleep data in R. It contains information on 10 patients who underwent a trial to test two
soporific (sleep-inducing) drugs. On the first occasion they all took drug 1, which is labelled as group=1 in
the dataset. On the second occasion they took drug 2 (group=2 in the dataset). The amount of extra sleep
(in hours) was recorded for each drug.
1. Conduct a one-sample t-test to test whether the change in sleep was different from 0 for the drug 1
(group=1) data.
2. Repeat this test using Fisher’s one-sample randomisation test.
3. Conduct a two-sample t-test to test whether the sleep changed significantly when the patients took
drug 2 (group 2) rather than drug 1 (group 1 data).
4. Repeat this test using Fisher’s two-sample randomisation test.
Compare the results from each method, and describe the suitability of the method in each case.

You might also like