- Generate the data set D as follows:
- 𝐷𝐷 = 100
- 𝑁𝑁 = 25
- 𝑋𝑋 contains samples from a uniform distribution U(0,1).
- 𝑡𝑡 = sin(2𝜋𝜋𝑋𝑋) + 𝜀𝜀, where 𝜀𝜀 contains samples from a Gaussian distribution N(0, 𝜎𝜎 =0.3).
- Select a set of permissible values for the regularization parameter 𝜆𝜆.
- For each value of 𝜆𝜆, use the method of “linear regression with non-linear models” to fit Gaussian basis functions to each of the datasets. Use 𝑠𝑠 = 0.1.
- Produce the plot as shown below, where
𝐷𝐷
1
𝑓𝑓(̅ 𝑥𝑥) = 𝑓𝑓(𝑑𝑑)(𝑥𝑥)
𝐷𝐷
𝑑𝑑=1
𝑁𝑁
1
(𝑏𝑏𝑏𝑏𝑏𝑏𝑠𝑠)2 = 𝑓𝑓𝑥𝑥̅ (𝑛𝑛)− ℎ𝑥𝑥(𝑛𝑛)2
𝑁𝑁
𝑛𝑛=1
𝑁𝑁 𝐷𝐷
1 1
𝑣𝑣𝑏𝑏𝑣𝑣𝑏𝑏𝑏𝑏𝑣𝑣𝑣𝑣𝑣𝑣 = 𝑓𝑓(𝑑𝑑)𝑥𝑥(𝑛𝑛)− 𝑓𝑓𝑥𝑥̅ (𝑛𝑛)2
𝑁𝑁 𝐷𝐷 𝑛𝑛=1 𝑑𝑑=1
- The test error curve is the average error for a test data set of 1000 points.



