Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

STSCI 4740 Machine Learning and Data Mining_HW1_solutions Cornell University STSCI 4740

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
16-02-2023
Written in
2022/2023

STSCI 4740 Machine Learning and Data Mining Fall  Dr. Yang Ning Homework 1 Problem 1 (6 points) 1. Express Var(X1 X2) through the variances and covariances of X1, X2 (assuming all variances exist). Answer: Var(X1 X2) = E((X1 X2) 2) (E(X1 X2))2 = E(X2 1 ) 2E(X1X2) + E(X2 2 ) E(X1) 2 + 2E(X1)E(X2) E(X2) 2 = Var(X1) + Var(X2) 2Cov(X1, X2) 2. Assume that X1, ..., Xn are i.i.d. real-valued random variables with finite variances. Show that Var⇣ 1 n Xn i=1 Xi ⌘ = 1 nVar(X1). Answer: From 1.1, we notice that if X1 and X2 are independent, then variance of the sum of random variables is the sum of variance. Var 1 n Xn i=1 Xi ! = 1 n2 Var Xn i=1 Xi ! = 1 n2 Xn i=1 Var (Xi) (Xi’s are independent) = 1 n2 · nVar (X1) (Xi’s are identically distributed) = 1 nVar(X1) 3. Assume that X, Y are independent random variables with E[X]=0, E[Y ]=1, Var(X) = 1, Var(Y ) = 2. Compute E[(3X + Y )(5Y + 2X 1)] Answer: E[(3X + Y )(5Y + 2X 1)] = E(15XY + 5Y 2 + 6X2 Y 3X) = 15E(XY )+5E(Y 2)+6E(X2) E(Y ) 3E(X) = 15 · 0 + 5(Var(Y ) + E(Y ) 2) + 6(Var(X) + E(X) 2) E(Y ) 3E(X) (X and Y are independent)

Show more Read less
Institution
Course

Content preview

STSCI 4740 Machine Learning and Data Mining Fall
Dr. Yang Ning Homework 1



Problem 1 (6 points)

1. Express Var(X1 X2 ) through the variances and covariances of X1 , X2 (assuming all
variances exist).
Answer:

Var(X1 X2 ) = E((X1 X2 ) 2 ) (E(X1 X2 ))2
= E(X12 ) 2E(X1 X2 ) + E(X22 ) E(X1 )2 + 2E(X1 )E(X2 ) E(X2 )2
= Var(X1 ) + Var(X2 ) 2Cov(X1 , X2 )

2. Assume that X1 , ..., Xn are i.i.d. real-valued random variables with finite variances. Show
that
⇣1 X n ⌘ 1
Var Xi = Var(X1 ).
n n
i=1

Answer: From 1.1, we notice that if X1 and X2 are independent, then variance of the
sum of random variables is the sum of variance.


n
! n
!
1X 1 X
Var Xi = 2 Var Xi
n n
i=1 i=1
n
X
1
= Var (Xi ) (Xi ’s are independent)
n2
i=1
1
= · nVar (X1 ) (Xi ’s are identically distributed)
n2
1
= Var(X1 )
n

3. Assume that X, Y are independent random variables with E[X] = 0, E[Y ] = 1, Var(X) =
1, Var(Y ) = 2. Compute E[(3X + Y )(5Y + 2X 1)]
Answer:

E[(3X + Y )(5Y + 2X 1)] = E(15XY + 5Y 2 + 6X 2 Y 3X)
2 2
= 15E(XY ) + 5E(Y ) + 6E(X ) E(Y ) 3E(X)
= 15 · 0 + 5(Var(Y ) + E(Y ) ) + 6(Var(X) + E(X)2 ) E(Y ) 3E(X)
2

(X and Y are independent)
= 20

Problem 2 (8 points)

Assume
This study source that weby have
was downloaded the regression
100000850872992 model on 02-16-2023 08:49:35 GMT -06:00
from CourseHero.com

1
https://www.coursehero.com/file/47582188/STSCI-4740-HW1-solpdf/

, Y = f (X) + ",
where " is independent of X and E(") = 0, E("2 ) = 2 .Assume that the training data
(x1 ; y1 ), ..., (xn ; yn )are used to construct an estimate of f(x), denoted by fˆ(x). Given a new
random vector (X,Y ) (i.e., test data independent of the training data),

1. show that E[(f (X) fˆ(X))2 |X = x] = var(fˆ(x)) + [E[fˆ(x)] f (x)]2
Answer:

E[(f (X) fˆ(X))2 |X = x] = E[(f (x) fˆ(x))2 ]
(X and the estimate of f are independent)
= E[(f (x) E(fˆ(x)) + E(fˆ(x)) fˆ(x))2 ]
= E[(f (x) Efˆ(x))2 ] + E[(fˆ(x) Efˆ(x))2 ] + 2E[(f (x) Efˆ(x))(fˆ(x) Efˆ(x))]
= [(f (x) Efˆ(x))2 ] + E[(fˆ(x) Efˆ(x))2 ] + 2(f (x) Efˆ(x))E(fˆ(x) Efˆ(x))
(f(x) and Efˆ(x)are constant)
= [f (x) Efˆ(x)]2 + var(fˆ(x))

2. Show that E[(Y fˆ(x))2 |X = x] = var(fˆ(x)) + [E[fˆ(x)] f (x)]2 + 2


Answer: We have shown in the class that

E[(Y fˆ(x))2 |X = x]
= E[(f (x) + " fˆ(x))2 ]
= E[(f (x) fˆ(x))2 ] + E("2 ) + 2E["(f (x) fˆ(x))]
= var(fˆ(x)) + [E[fˆ(x)] f (x)]2 + 2 + 2E["]E[f (x) fˆ(x)] (from 2.1)
= var(fˆ(x)) + [E[fˆ(x)] f (x)]2 + 2
. (" is independent of f(x) and fˆ(x))

3. Explain the bias-variance trade-o↵ based on the above equation.
Answer: the total error= bias +variance+ irriducible error Our goal is to minimize the
total error to attain an accurate model. Howerver, there is a trade-o↵ between bias and
variance. Flexible models have low bias and high variance and relatively rigid models
have high bias and low variance. The model with the optimal predictive capability is the
one that leads to the best balance between bias and variance.

4. Explain the di↵erence between training MSE and test MSE. Can expected test MSE be
smaller than 2 ?
Answer: Training MSE is computed in the trainig data set and can reach 0 if we fit
the training data very well. Test MSE is computed with the test observations and fitted
model. Although some model performs well with respect to trainig MSE, it may not have
the same predictive ability in the test data. Our goal is to find the model which minimize
the expected test MSE.
As 2.2 shows, the expected test MSE is the sum of variance of preidictor, the squared
bias and 2 , so it can’t be smaller than 2


This study source was downloaded by 100000850872992 from CourseHero.com on 02-16-2023 08:49:35 GMT -06:00

2
https://www.coursehero.com/file/47582188/STSCI-4740-HW1-solpdf/

Written for

Course

Document information

Uploaded on
February 16, 2023
Number of pages
7
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Themanehoppe American Intercontinental University Online
Follow You need to be logged in order to follow users or courses
Sold
345
Member since
4 year
Number of followers
224
Documents
3784
Last sold
4 days ago

3.5

55 reviews

5
25
4
7
3
7
2
3
1
13

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions