STA510. Solutions to exercises. 3, fall 2012

Similar documents
ECON Fundamentals of Probability

Homework set 5 - Solutions

Qualifying Exam CS 661: System Simulation Summer 2013 Prof. Marvin K. Nakayama

Variance reduction. Michel Bierlaire. Transport and Mobility Laboratory. Variance reduction p. 1/18

Chapter 5. Statistical Models in Simulations 5.1. Prof. Dr. Mesut Güneş Ch. 5 Statistical Models in Simulations

ECON 5350 Class Notes Review of Probability and Distribution Theory

Random Vectors and Multivariate Normal Distributions

15 Discrete Distributions

Variance reduction techniques

Probability and Distributions

Computer Science, Informatik 4 Communication and Distributed Systems. Simulation. Discrete-Event System Simulation. Dr.

IE 581 Introduction to Stochastic Simulation

ACM 116: Lectures 3 4

Chapter 5 continued. Chapter 5 sections

System Simulation Part II: Mathematical and Statistical Models Chapter 5: Statistical Models

Random Variables. Random variables. A numerically valued map X of an outcome ω from a sample space Ω to the real line R

Chapter 6: Large Random Samples Sections

Chapter 4. Continuous Random Variables

Variance reduction techniques

BIOS 2083 Linear Models Abdus S. Wahed. Chapter 2 84

Preliminary Statistics Lecture 3: Probability Models and Distributions (Outline) prelimsoas.webs.com

The Multivariate Normal Distribution. In this case according to our theorem

Optimization and Simulation

MA/ST 810 Mathematical-Statistical Modeling and Analysis of Complex Systems

Statistical Methods in Particle Physics

Lecture 11. Multivariate Normal theory

Lecture Note 1: Probability Theory and Statistics

STA 2201/442 Assignment 2

Random Vectors 1. STA442/2101 Fall See last slide for copyright information. 1 / 30

Lecture 19. Condence Interval

ISyE 6644 Fall 2014 Test #2 Solutions (revised 11/7/16)

MATH c UNIVERSITY OF LEEDS Examination for the Module MATH2715 (January 2015) STATISTICAL METHODS. Time allowed: 2 hours

01 Probability Theory and Statistics Review

Probability Theory and Statistics. Peter Jochumzen

3. Probability and Statistics

Summary of Chapter 7 (Sections ) and Chapter 8 (Section 8.1)

LECTURE 1. Introduction to Econometrics

In this course we: do distribution theory when ǫ i N(0, σ 2 ) discuss what if the errors, ǫ i are not normal? omit proofs.

Simulating events: the Poisson process

Ch. 5 Joint Probability Distributions and Random Samples

STAT Chapter 5 Continuous Distributions

Complexity of two and multi-stage stochastic programming problems

Brandon C. Kelly (Harvard Smithsonian Center for Astrophysics)

Semester , Example Exam 1

ECE353: Probability and Random Processes. Lecture 18 - Stochastic Processes

2WB05 Simulation Lecture 7: Output analysis

Intelligent Data Analysis. Principal Component Analysis. School of Computer Science University of Birmingham

Random Variables and Their Distributions

Gaussian vectors and central limit theorem

This does not cover everything on the final. Look at the posted practice problems for other topics.

Asymptotic Statistics-III. Changliang Zou

Preliminary Statistics. Lecture 3: Probability Models and Distributions

ENGG2430A-Homework 2

n px p x (1 p) n x. p x n(n 1)... (n x + 1) x!

Exercises and Answers to Chapter 1

The Multivariate Normal Distribution 1

8 - Continuous random vectors

14.30 Introduction to Statistical Methods in Economics Spring 2009

Covariance. Lecture 20: Covariance / Correlation & General Bivariate Normal. Covariance, cont. Properties of Covariance

BASICS OF PROBABILITY

UC Berkeley Department of Electrical Engineering and Computer Science. EE 126: Probablity and Random Processes. Problem Set 8 Fall 2007

STT 843 Key to Homework 1 Spring 2018

Introduction to Probability Theory for Graduate Economics Fall 2008

CHAPTER 4 MATHEMATICAL EXPECTATION. 4.1 Mean of a Random Variable

Notes on Random Vectors and Multivariate Normal

Next tool is Partial ACF; mathematical tools first. The Multivariate Normal Distribution. e z2 /2. f Z (z) = 1 2π. e z2 i /2

Math Spring Practice for the final Exam.

MAS113 Introduction to Probability and Statistics. Proofs of theorems

Statistics 351 Probability I Fall 2006 (200630) Final Exam Solutions. θ α β Γ(α)Γ(β) (uv)α 1 (v uv) β 1 exp v }

Lecture 2: Review of Probability

Statistics. Statistics

EC212: Introduction to Econometrics Review Materials (Wooldridge, Appendix)

Continuous Distributions

Moments. Raw moment: February 25, 2014 Normalized / Standardized moment:

III - MULTIVARIATE RANDOM VARIABLES

A Comparison of Particle Filters for Personal Positioning

Asymptotic Properties and simulation in gretl

M(t) = 1 t. (1 t), 6 M (0) = 20 P (95. X i 110) i=1

5. Random Vectors. probabilities. characteristic function. cross correlation, cross covariance. Gaussian random vectors. functions of random vectors

Stat 516, Homework 1

Manual for SOA Exam MLC.

STA2603/205/1/2014 /2014. ry II. Tutorial letter 205/1/

HW5 Solutions. (a) (8 pts.) Show that if two random variables X and Y are independent, then E[XY ] = E[X]E[Y ] xy p X,Y (x, y)

MAS223 Statistical Inference and Modelling Exercises

Course: ESO-209 Home Work: 1 Instructor: Debasis Kundu

Sampling Distributions

ECSE B Solutions to Assignment 8 Fall 2008

Bivariate Paired Numerical Data

Algorithms for Uncertainty Quantification

Continuous Distributions

Lesson 4: Stationary stochastic processes

Class 26: review for final exam 18.05, Spring 2014

1 Review of Probability

Solution: The process is a compound Poisson Process with E[N (t)] = λt/p by Wald's equation.

Introduction to Computational Finance and Financial Econometrics Probability Review - Part 2

Poisson processes and their properties

Bivariate distributions

Lecture 1: August 28

Lecture 28: Asymptotic confidence sets

PCMI Introduction to Random Matrix Theory Handout # REVIEW OF PROBABILITY THEORY. Chapter 1 - Events and Their Probabilities

Transcription:

Solutions-3, 3. oktober 212; s. 1 STA51. Solutions to eercises. 3, fall 212 See R script le 'problem-set-3-h-12.r'. Problem 1 Histogram of y.non.risk The histograms to the right show the simulated distributions (1 replications) of resources riskand non risk weighted...4.8.12..2.4 1 2 3 4 5 6 7 y.non.risk Histogram of y.risk 1 2 3 4 5 6 7 y.risk Histogram of y.c c) The histogram to the right shows the simulated distribution of resources. P (Y 62) is estimated to.78 (1 replications)...5.1.15.2 5 55 6 y.c Simulation of Poisson processes In for eample problem 2, we are asked to simulate a (homogenous) Poisson process N(t) with intensity λ = 2. A recommended way to do this is to start with simulating the inter arrival times T 1, T 2, T 3,.... The T j 's are independent Ep(λ) (E(T j ) = 1, λ is called the rate of the process): λ T < rep(n = n.interarr, lambda = 2) Then the time points at which N(t) jumps, is found with: S.t < cumsum(t) ( S.t is assigned the numbers: S 1 = T 1, S 2 = T 1 +T 2, S 3 = T 1 +T 2 +T 3,..., i.e. the time points at which the process makes a one unit jump; called the arrival times.) Undervisning\STA51, Statistical modeling and simulation\eercises\1213-solutions-3.te

Solutions-3, 3. oktober 212; s. 2 The process N(t) is zero for t < t 1, and t 1 is the rst time point in S.t, i.e. S.t[1]. Then the process is one for t 1 t < t 2 and so on. Therefore we can plot a simulated realization of N(t) by Nt < : length( S.t ) plot( = c(, S.t ), y = Nt, type = s ) (The type = s produces a step function plot.) The value of N(t) (at time t) in the simulation is: n < min( which( S.t > t ) ) 1 See R script le 'problem-set-3-h-12.r Problem 2 Non homogenous Poisson processes In N(t) is a non homogenous Poisson processes with intensity λ(t) which we are going to simulate on the interval [, t ], we have to nd an upper limit for the intensity λ(t); nd a value λ such that λ(t) λ for t t. Simulate inter arrival times T 1, T 2, T 3,... where T j 's are independent Ep(λ ) (these are inter arrival times of a homogenous processes with rate λ.) The T 1, T 2, T 3,... form the arrival times S 1 = T 1, S 2 = T 1 + T 2, S 3 = T 1 + T 2 + T 3,... of the homogenous processes with rate λ, and only a subset of these events at the times S 1, S 2, S 3,... corresponds to the non homogenous processes. At time S j = t an event should be regarded an event of the non homogenous processes with probability λ(t)/λ. Thus: collect arrival times S j with probability λ(s j )/λ ; disregard the other events. The the resulting (sub) set of arrival times constitutes the the ones of the non homogenous processes. The number of inter arrival times One question is how large n.interarr, the number of inter arrival times, has to be. This depends on the time point t we want to study the process, N(t ), and it depends on the rate λ. The epected number of arrivals at time t is E{N(t )} = λt. But there is a considerable probability that the number eceeds λt, and n.interarr should be larger than this. If λt is not small (larger than 9 is sucient), N(t ) is approimately normally distributed with mean λt and standard deviation λt. Thus the probability that N(t ) eceeds λt + 3 λt, e.g., can be calculated approimately. This is: P (N(t ) > λt + 3 λt ) P (Z > 3) =.135, Undervisning\STA51, Statistical modeling and simulation\eercises\1213-solutions-3.te

Solutions-3, 3. oktober 212; s. 3 where Z N(, 1). Therefore, if we choose n.interarr < ceiling( lambda t.star + 3 sqrt( lambda t.star ) ) only in approimately 14 out of 1 times we would simulate too few inter arrival times. (Here t.star is t.) This method for computing the number of needed T j 's is not used in problems 2 and 3. But it is used in problem 3.21 from the book. It could of course as well have been used in 2 and 3. See R script le 'problem-set-3-h-12.r Problem 3 Plot of realization of N 1 (t) and N 2 (t). Nt 2 4 6 8 1 12 N1 N2 5 1 15 2 t Problem 4 {, with probability 1 pj For i = 1,..., 1 let I j =, where I 1, with probability p j = 1 means that component j j works. Then i) P (I 1 = 1 I 2 = 1) = P (I 1 = 1)P (I 2 = 1) = p 1 p 2 =.7.95 =.665 ii) P (I 1 = 1 I 2 = 1) = P (I 1 = 1) + P (I 2 = 1) P (I 1 = 1)P (I 2 = 1) = p 1 + p 2 p 1 p 2 iii) P { (I 1 = 1 I 2 = 1) (I 3 = 1 I 4 = 1) } = P { (I 1 = 1 I 2 = 1 I 3 = 1) (I 1 = 1 I 2 = 1 I 4 = 1) } = p 1 p 2 p 3 + p 1 p 2 p 4 p 1 p 2 p 3 p 4 =.6633 iv) P (I 1 + + I 1 7) =... may be found in principle, but it is much more easy to nd this probability by simulation! Cf. R script le. Undervisning\STA51, Statistical modeling and simulation\eercises\1213-solutions-3.te

Solutions-3, 3. oktober 212; s. 4 Problem 5 X, Y and Z are normal random variables, where E(X) = µ X ; Var(X) = σ 2 X E(Y ) = µ Y ; Var(Y ) = σ 2 Y Corr(X, Y ) = Cov(X,Y ) σ X σ Y = ρ, and if Y = ax + Z, (Z independent of X) we get: Cov(X, Y ) = avar(x) ρ = Corr(X, Y ) = Cov(X, Y ) σ X σ Y E(Y ) = ae(x) + E(Z) E(Z) = E(Y ) ae(x) = a σ X σ Y a = ρ σ Y σ X Var(Y ) = a 2 Var(X) + Var(Z) Var(Z) = Var(Y ) a 2 Var(X) Problem 6 The a 1, a 2 and a 3 should be chosen as the epectations of X 1, X 2 and X 3 resp. The matri A should be chosen as the cholesky decomposition of the covariance matri of [X 1, X 2, X 3 ] : Σ = Cov(X 1, X 1 ) Cov(X 1, X 2 ) Cov(X 1, X 3 ) Cov(X 2, X 1 ) Cov(X 2, X 2 ) Cov(X 2, X 3 ) Cov(X 3, X 1 ) Cov(X 3, X 2 ) Cov(X 3, X 3 )... This is how it should be done. But why does this work? Simulation estimate of P (X 1 + X 2 + X 3 3):.465 (1 replications). Problem 3.11 (Rizzo) p1=.1 p1=.2 p1=.3 p1=.4 p1=.5 p1=.6 p1=.7 p1=.8 p1=.9 Undervisning\STA51, Statistical modeling and simulation\eercises\1213-solutions-3.te

Solutions-3, 3. oktober 212; s. 5 Problem 3.14 (Rizzo) 1 1 2 3 4 X 1 3 2 1 1 2 1 1 2 3 4 X 2 X 3 1 2 3 4 5 3 2 1 1 2 1 2 3 4 5 Problem 3.21 (Rizzo) Inhomogeneous Poisson process N(t) is an inhomogeneous Poisson process with mean value function m(t) = t 2 + 2t. That is the rate (intensity) λ(t) is determined by m(t) = t λ()d. This means that λ(t) = m (t) = 2t + 2. To simulate N(t) on the interval [4, 5], we could eploit that N(4) is Poisson with mean m(4) = 4 2 + 2 4 = 24. So if Y P oiss(24), N(t) = Y + N (t 4), t 4, where N (t) is an inhomogeneous Poisson process with mean value function m (t) = m(t + 4) (intensity: λ (t) = λ(t + 4) = 2(t + 4) + 2 = 2t + 1). We will simulate N(t) for t < 6, to cover the interval [4, 5]. That is, we have to simulate N (t) for t < 2. In this period the intensity has the maimal value: λ (t) λ (2) = 2 2 + 1 = 14 (since λ (t) increases with t) The number of inter arrival times: When the intensity is not constant, we can try to use the average intensity in the period considered, for the calculations of number of needed inter arrival times. Generally, the average Undervisning\STA51, Statistical modeling and simulation\eercises\1213-solutions-3.te

Solutions-3, 3. oktober 212; s. 6 1 b m(b) m(a) intensity in the interval [a, b] is: λ(t)dt =. a b a b a The average intensity of N (t) in [, 2] is m (2) m () 48 24 = 2 2 12 2 + 3 12 2 = 38.7 39 T j 's are needed. = 12. This implies that If we do not eploit that N(4) is Poisson with mean m(4) = 4 2 + 2 4 = 24 we can proceed as follows: We will simulate N(t) for t < 6, to cover the interval [4, 5]. In this period the intensity has the maimal value: λ(t) λ(6) = 2 6 + 2 = 14 (since λ(t) increases with t) The number of inter arrival times: The average intensity of N(t) in [, 6] is 3 8 6 = 68.8 69 T j 's are needed. m(6) m() 6 = 48 6 = 8. This implies that 8 6 + Problem 6.4 (Rizzo) X 1,..., X n : i.i.d., lognormal(µ, σ 2 ). I.e. X i = e Y i, where Y i N(µ, σ 2 ). E(Y i ) = E{ln(X i )} = µ. E(X i ) = e µ+σ2 /2 ; Var(X i ) = e 2µ+σ2 (e σ2 1). (Y i Y ) 2 (ordi- Y µ For n large, we have approimately: SY 2 /n N(, 1), where S2 Y = 1 n 1 nary variance estimator, estimates σ 2 = Var(Y i )). On this background if n is large: n i=1 P ( z α/2 < Y µ S 2 Y /n < z α/2) 1 α P (Y z α/2 SY 2 /n < µ < Y + z α/2 SY 2 /n) 1 α Therefore, ( Y z α/2 S 2 Y /n, Y + z α/2 S 2 Y /n ) is a condence interval for µ with approimate condence level 1 α. Actually, since the Y i 's are i.i.d. N(µ, σ 2 ), we have that S Y µ Y 2 /n P ( t α/2,n 1 < Y µ < t S 2 α/2,n 1) = 1 α and that ( Y t α/2,n 1 S 2 Y /n Y /n, t(n 1), Y + t α/2,n 1 S 2 Y /n ) Undervisning\STA51, Statistical modeling and simulation\eercises\1213-solutions-3.te

Solutions-3, 3. oktober 212; s. 7 is a condence interval for µ with (eact) condence level 1 α. We are asked to use a Monte Carlo method to obtain an empirical estimate of the condence level of the interval. C.f. book at pages 16 162 and check R script le. For dierent n (2, 4, 1, 2), this gave estimated condence levels very close to 95% (1 replications used). Problem 6.5 (Rizzo) X 1,..., X 2 : i.i.d., χ 2 (2) (chi square distributed with 2 degrees of freedom.) We are supposed to (erroneously) use the t-interval: ( Y t α/2,n 1 SY 2 /n, Y + t α/2,n 1 SY 2 /n ) as a condence interval for E(X i ) = µ = 2 (=d.f.) in this situation. (Erroneous, because this t-interval assumes that the X i 's are i.i.d. N(µ, σ 2 ).) This mean that the condence interval does not necessarily have condence 1 α. C.f. book at pages 16 162 and check R script le. With 1 replications used, this gave an estimated condence level 92.7% which is very close to 95%. π/3 sin(t)dt = cos(t) Problem 5.1 (Rizzo) π/3 π/3 = cos(π/3) + 1 =.5 If U U[, π/3], then E{sin(U)} = sin(t) 1 π/3 dt = 3 sin(t)dt. So, for n U[, π/3] distributed U 1,..., U n, we have that the average of sin(u 1 ),..., sin(u n ) times ( 3 π ) 1 will π estimate the quantity π/3 π/3 sin(t)dt. The Monte Carlo estimate is then: v ( 3 π ) 1, (with v i = sin(u i )). We want to estimate (assume < ) The term Φ() = Problem 5.2 (Rizzo) 1 e 1 1 2 y2 dy =.5 + e 1 2 y2 dy 2π 2π 1 2π e 1 2 y2 dy can be estimated by Monte Carlo simulation by using U U[, ]. Then we have: E{e 1 2 U 2 } = e 1 1 2π 2 y2 dy = 1 e 1 2 y2 dy. 2π Undervisning\STA51, Statistical modeling and simulation\eercises\1213-solutions-3.te

Solutions-3, 3. oktober 212; s. 8 Thus if U 1,..., U n are i.i.d. U[, ] and V i = e 1 2 U 2 i, then Here V = 1 n ni=1 V i. 1 V estimates e 1 2 y2 dy. 2π 2π Remark: The gure below shows a histogram of n = 1 simulated values of Φ() =.5 + V for 2π = 2. As may be seen, it is possible that a simulated value may larger that 1., but we know that Φ() 1 for all. Histogram of fi..vec 1 2 3 4 For these simulated values: Maimum value: 1.572 Variance: 6.36116e-5 The condence interval, 1: (.9631,.9929) The condence interval, 2: (.9615,.992) Theoretical value:.9772.96.97.98.99 1. 1.1 fi..vec Undervisning\STA51, Statistical modeling and simulation\eercises\1213-solutions-3.te