HW6 - Stat 340 Homework - Tutorial 6 ANSWER Individual Work...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Stat 340 Homework - Tutorial 6 ANSWER Individual Work Using stratification we can break the function into strata 1 being (0, 0.2), and strata 2 being (0,2,1). Please use: a) Antithetic random variables on strata 2 b) Control variates on strata l. g(x) must be cubic. Determine the efficiency. To hand in: Your code in a notepad/word doc. As usual it should run. Grading (part of your participation grade): 0 — Nothing handed in, code does not compile, you have obviously handed in junk 1 - Your code compiles 2 - Your efliciency is more than 1 4 - Your efficiency is more than 5 6 - Your efliciency is more than 10 8 - Your efliciency is more than 20 Bonus +2 for the best efficiency in the course. Answer: 0:jf(m)da:=]f(m)dcc+jf(m)dcc 0 a 0 Lety 2: x/aandz = (x—a)/(1—a). 9=a0/f(ay)dy+(1—a)O/f((1—a)z+a)dz 1,0 0.5 0.0 _J_.. f(02'x) A035 -1.0 0.00 0.05 0.10 0.15 0.20 0.2’x 9(a)) is selected (see bolded line) to be g(x) = .9348 — 24.8807 * :1; + 88.7887 * 11:2 — 55.370 >o< x3. This particular g(x) was selected using regression although some students have used taylor’s approximation and various other techniques to get a "good" g(x). Integration of g(ac) from 0 to 1 results in —0.09603213333 = c. 9 H 1 1 a/f(ay)dy+(1—a.)/f((1——a)z+a)dz 0 0 1 1 0=a0/f(ay)-g($)dy+ac+(1~a)!f((1-a)z+a)dz gzaxm Miracmwifflf((1-a)u+a)+f((1—a)v+a) i=1 m .— #Define ’1? function f = functiantxi { #Deiine f fun-action f = iun:tion[x) { retumtsintlogtxlll 1- #Define 9 function g=iuntbi ants] { retumlfl.92i8-24.380?*x+88.?88?*x*2-55.2?20*x"21 } test. = 10003.! "small." test. set- n = lflfloflflfi'l'he real naming data set. ah I I l u=runifltest1 £_:m:=£(u] )- mean[1_:m:]finake sure estimates are alwaya close to -D.5 [the answer) [1.] 41.4921?” var_:m: '-' var[i_:m:JI.LDfl YVYYYYYY+++YYY+++YY #U? #u E1}: imctimIHJ { u=runiflnl £51.! = f {0. 23113-9“! .2*u] -I) .05603113233 retum(i_cv] am: = functi ontn] u=runi£[n] v=l-u f_am:.i = fl.5*i [U.3*u+0.2]+0. 5H“). $*v+fl .2] retum(i_anti] } #Scrat. Sise: #----------- £_:v = [lumen-Nee”. the :v on the strata i_ant.i = ANTI (testIZIQt-est- the ant-i on the strata v1 = 0.2"£*var[!_:v] #simpliiied notation (note: function already does a‘t) v2 = £*u.8*2*var{i_anti] #Correet for (mutim evals m = romd[n*v1;[91+v2]rollfidetermine sample :ise of strata J. k = n - mfidet-ermine sample size of strata 2 #Use the strata sises to invprwe our li.i'.1.1'iarn:e g----_-_--___-___-_........_._--.-___-_--__.__-_ £_:v=0.2*£'i?[m] £_ant.i=0 . 3*A‘HTI [k] >- mean[i_:v)+mean[f_ami) 1] -0.4232259 VYYYYYYYYYYVVY++++++YYYY+++++YYYYY I 3. >- v_e:bs = :(f_:v!sqrb[m] ,i_antilsqrt-[kf2]} )- var_st.ra'b = var[v_e5t.5] ). :- )- I Bf! = var_:melvar_strat EH 1] 519.5%??? ...
View Full Document

Page1 / 3

HW6 - Stat 340 Homework - Tutorial 6 ANSWER Individual Work...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online