Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

IEOR-4307

Problem Set #3

Fall 2023

Due: BEFORE CLASS October 12, 2023

Ex.  1 (2 pts).

Let X be the time (in minutes) that a random user spends using the Spotify app in a week. It has an unknown distribution with unknown mean µ and unknown variance σ 2 .

Spotify has developed a new recommender algorithm, with the goal of increasing the time that the average user spends using the app.  Before releasing the new algorithm they decide to perform an AB test: over the period of 1 week, 50% of the users will experience the old recommender algorithm (group A, with nA  users), while 50% of the users will experience the new recommender algorithm (group B, with nB  users).  Users won’t be aware of this experiment, and we can consider users to be independent from each other.  After 1 week, a Data Analyst has access to the collected data: for each user they know how much time they have spent using the Spotify app. In particular they would be able to compute:

. X(¯)A : the sample mean of time spent using the app during the week, for users in group A

. X(¯)B : the sample mean of time spent using the app during the week, for users in group B.

One way to analyze the results is to define δ(ˆ) = X(¯)B  − X(¯)A , which is an estimator for the difference in

population averages δ = µB  − µA .

Answer the following questions (attach your code or a screenshot of it.  It won’t be graded but might be used as a reference):

a-0.2pt) What are the limiting distribution of X(¯)A , X(¯)B , and δ(ˆ), including means and variances (using

symbols, not actual numbers)? Hint: you can refer to properties of the Normal distribution.

b-0.3pt) Using the data in the Spotify results.csv file, estimate the variance of δ(ˆ).  Take the square root

of the variance to obtain the standard error.  Also, compute the observed value of δ(ˆ).  Report

the 3 values.

c-0.5pt)  Using the values from the previous 2 questions, construct a 95% confidence interval for δ .  Does this interval provide evidence that the true (unobserved) δ is different than 0 (and therefore the new version of the algorithm is more powerful)? Explain.

d-0.5pt)  Consider a (α = 0.05) z-test on the null hypothesis H0  : δ = 0   versus   H1  : δ 0.  Before looking at the results of the test, do you expect the test to reject the null hypothesis or not? Explain.

e-0.5pt)  Compute  and  interpret the p-value of the test:  would you recommend releasing the  new algorithm to all the users?

Ex. 2 (1 pt).

Let X1, X2 ,..., Xn  be i.i.d. according to a Pareto distribution with density fθ(x) = θcθ x (θ+1) , where θ  >  0  and 0  < c 三 x. Both parameters are unknown. We want to test the hypothesis H0 : θ = θ0 vs the alternative hypothesis H1 : θ θ0.  Following the last example shown in Lecture 10 for testing whether the mean of a Normal distribution with unknown variance is µ0 , do the following:

(a) Write down the form of the likelihood ratio statistics λ(X), find the appropriate formulas for the MLEs (for both numerator and denominator), and find the critical value that defines a valid α size test.

(b) We fix n  =  100,  α  =  0.05  and θ0   =  1.    That  is,  we  want  to test  H0   :  θ0   =  1  with  a likelihood ratio test of size 5%.  Use your favorite programming language to report the re- sult of the test, including its pvalue, using the following vector of 100 observed values.  (at- tach your code or a screenshot of it.  It won’t be graded but might be used as a reference) Hint: while the function ”dpareto” is not available in some softwares, you can code your own Pareto likelihood function as prod(  theta  *  c^theta  *  x^(-theta  -  1)).  In Python this is numpy.prod([theta  *  c**theta  *  x**(-theta  -  1)]).

x = c(6.001410, 2.863437, 4.787484, 5.632882, 8.771344, 27.256596, 2.041172, 2.242426, 23.168110, 2.073247,  2.040012,  2.615700,  4.829843,  3.717446,  2.339373,  18.108029,  2.488386,  6.272944,

3.248914,  3.470290,  3.353668,  3.203452,  2.846076,  2.060825,  2.461402,  4.677574,  13.777352, 2.720961,  3.531138,  2.249743,  2.650698,  20.819149,  3.746843,  3.273191,  4.206762,  2.010445, 2.239236,  3.729884,  3.889938,  5.628976,  2.748946,  6.097551,  2.505084,  2.543718,  3.597635, 4.077332, 3.255719, 2.428195, 10.508027, 7.419452, 2.858112, 2.456785, 39.620460, 2.765933, 3.728607,  2.221640,  2.223791,  2.869630,  6.425813,  7.939203,  7.384178,  4.379601,  2.653953, 5.789347, 4.491682,  2.155311,  4.671701,  3.623419,  7.384143,  7.357775,  4.529153,  11.516393, 2.784358, 2.056124, 2.462936, 37.072534, 13.333619, 2.764130, 5.282848, 54.739031, 10.981649, 2.532538,  6.632495,  3.084052,  2.956415,  2.300548,  2.449687,  2.098248,  3.382130,  5.762572, 2.534577, 56.407493, 10.380827, 3.992525, 2.036599, 2.447863, 22.287945, 3.092304, 2.067607, 3.692485)

Ex. 3 (1 pt).

Go on Yahoo Finance.  Download the time series of historical data of the S&P 500 from Feb 16, 2021 to Feb 16, 2022.  Compute the daily returns of the S&P 500.  Do a Q-Q plot of the empirical quantiles versus theoretical quantiles, assuming that the theoretical distribution of the returns is Normal with some mean µ and variance σ2.  Based on the plot, is there enough evidence to conclude that the returns are Normally distributed? Explain.

Ex. 4 (1 pt).

A popular model in market microstructure postulates that the total number of trades, ignoring the case of no trade, within a minute for a particular stock follows a geometric distribution p(x) = P(X = x) = px 1 (1 − p), x = 1, 2, . . . The following table contains data of all the trade frequencies

within 134 minutes with at least one trade. Do the following

(a) Find the MLE for p.

(b)  Test whether the geometric distribution fits the data using a Pearson’s χ2  test.  Hint: you can use the buckets that are provided in the table, with j from 1 to 12, with the corresponding frequencies that correspond to observed Oj  values.

N. Trades

1

2

3

4

5

6

7

8

9

10

11

12

Frequency

46

32

21

11

5

7

4

3

1

2

1

1