Unformatted text preview: (Computer Exercise)
Faculty of Computers and Information Faculty Department of Computer Science Pattern Recognition A First Simulation Example on Designing and Assessing a Regression Function (cont.)
• Similar to the previous simulation on linear model, this time assume that Y is related to X as follows Y = sin X + ε,
2 where X is uniformally distributed in [−π, π ]; and ε ∼ N (0, 0.1). Notice that, in this case σY |X is constant. • Build diﬀerent models, intercept, ﬁrst order, second order, . . ., pth order. • For each model generate the following ﬁgures: – a ﬁgure showing the true model, E Y |X = sin X , along with the 500 ﬁts.
2 – a ﬁgure showing (vs. ntr ): the risk of the true model Ex0 σY |X =x0 , the average bias Ex0 Bias2 (y0 , y0 ), the average variance Ex0 Vartr (y0 ), and the mean error Ex0 Etr errtr (x0 ) = Etr Ex0 errtr (x0 ) = Etr errtr ; verify that 2 E errtr = E σY |X =x0 + E Bias2 (y0 , y0 ) + E Var (y0 ) . x0 x0 x0 tr tr • For each ntr , generate a ﬁgure (vs. the complexity p), that shows the L.H.S and the three terms of the R.H.S. of the equation above. • For each ntr , what is the best model for this problem? ...
View Full Document