Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help with d part please 95 () For each model, compute the 10-fold CV estimate for the test error by following the steps: Run the

Help with d part please image text in transcribed
95 () For each model, compute the 10-fold CV estimate for the test error by following the steps: Run the folloring command Tines. 6.r) 97 set.seed(1) # the seed can be arbitrary but we use 1 for the sake of consistency 98 fold.index cut(sampleC1:nrow(Weekly)), breaks-10, labels-FALSE) testIn 101 Write a for loop from i -1 toi - 10 and in each loop, perform each of the following steps: 182 i. Fit a logistic regression model using all but the observations thot satisfy fold.index-i to predict Direction using Logl and Lag? for model train (i) and using Lagi, Lag2, ICLag1'2), I(Lag2'2) for modelCii) 103 ii. Compute the posterior probability of the market moving up for the observations that satisfy 184 fold.index.. 105 iii. Use the posterior probabilities for the observations that satisfy fold.indexei and use the threshold 186 8.5 in order to predict whether or not the market moves up. the error rate was mode in predicting Direction for those observations thot sotisfy 188 fold.index--i 109 Take the average of the 18 numbers obtained in iv in order to obtain the 18-fold CV estinate for the test 118 error. 112 113r 114 error.3repCe, din(heekly)[1]) 115. for (i in 1:10) t test.i 1 and only the first elenent will be usedthe condition has length s 1 and only the first element will be usedthe condition has length >1 and only the first elenent will be usedthe condition has length > 1 and only the first element wilt be usedthe condition has length > 1 and only the first element will be usedthe condition has length 1 and only the first element "in be usedthe condition has length > 1 and only the first elenent will be usedthe condi tion has length > 1 and only the first elenent will be used[1] the condition has length >1 and only the first element will be usedthe condition has length > 1 and only the first element will be usedthe element will be usedthe condition has length > 1 and only the first element will be usedthe 1 and only the first elenent will be usedthe 95 () For each model, compute the 10-fold CV estimate for the test error by following the steps: Run the folloring command Tines. 6.r) 97 set.seed(1) # the seed can be arbitrary but we use 1 for the sake of consistency 98 fold.index cut(sampleC1:nrow(Weekly)), breaks-10, labels-FALSE) testIn 101 Write a for loop from i -1 toi - 10 and in each loop, perform each of the following steps: 182 i. Fit a logistic regression model using all but the observations thot satisfy fold.index-i to predict Direction using Logl and Lag? for model train (i) and using Lagi, Lag2, ICLag1'2), I(Lag2'2) for modelCii) 103 ii. Compute the posterior probability of the market moving up for the observations that satisfy 184 fold.index.. 105 iii. Use the posterior probabilities for the observations that satisfy fold.indexei and use the threshold 186 8.5 in order to predict whether or not the market moves up. the error rate was mode in predicting Direction for those observations thot sotisfy 188 fold.index--i 109 Take the average of the 18 numbers obtained in iv in order to obtain the 18-fold CV estinate for the test 118 error. 112 113r 114 error.3repCe, din(heekly)[1]) 115. for (i in 1:10) t test.i 1 and only the first elenent will be usedthe condition has length s 1 and only the first element will be usedthe condition has length >1 and only the first elenent will be usedthe condition has length > 1 and only the first element wilt be usedthe condition has length > 1 and only the first element will be usedthe condition has length 1 and only the first element "in be usedthe condition has length > 1 and only the first elenent will be usedthe condi tion has length > 1 and only the first elenent will be used[1] the condition has length >1 and only the first element will be usedthe condition has length > 1 and only the first element will be usedthe element will be usedthe condition has length > 1 and only the first element will be usedthe 1 and only the first elenent will be usedthe

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 9th International Conference Dasfaa 2004 Jeju Island Korea March 2004 Proceedings Lncs 2973

Authors: YoonJoon Lee ,Jianzhong Li ,Kyu-Young Whang

2004th Edition

3540210474, 978-3540210474

More Books

Students also viewed these Databases questions