Exercises

In some of the exercises, there will be need for using a statistical package. We will use R in the course. R is a free software available both for linux and windows and can be downloaded from the R home page. A good reference for use of R is Kuhnert and Venables: An introduction to R (free).

 

R scripts used for the different exercises are available at /studier/emner/matnat/math/STK4030/h13/R-scripts/

 

Exercises for 29. November

Extra exercise 6 (try this first) and 4, available here

Week 46 (22. November). Extra exercise 9.1

Data set no2.dat

The R code for solution consists of the file:
solution.extra.ex.9.1.r
Everything in a pdf-file, including results.

 

Week 45 (15. November). Extra exercise 7.1

 

The R code for solution consists of the following files:
solution.extra.ex.7.1a.r
solution.extra.ex.7.1bc.r
cv.k.perm.r
model.selection.r
div.sim.r
cv.k.r
calc.err.r
calc.res.r
Everything in a pdf-file, including results.

Exercises for 8. november

Exam 2006, problem 2

Exam 2012, problem 2

Challenge: Exercise 5.7

Exercises for 1. november

Exercise 5.1 (Hint: Consider only two intervals first and write both intervals as a_j+b_j*(x-xi_1)+c_j(x-xi_1)^2+d_j(x-xi_1)^3)

Exercise 5.3 (Hint: Remember that all methods are linear in the beta's and also remember eq (3.8) which can be used to obtain prediction variances), exer5_3.r

Exercise 5.4

 

Exercises for 25. october

Extra exercise 2, available here

Challenge: Exercise 4.6

 

Exercises for 18. october:

Exercise 4.2, solution available here

Extra exercise 1, avaliable here

 

Exercises for 11. october:

(Exercise 4.2, this we postphone to next week)

Exercise 4.9: Extensions to this exercise:

  1.   Start by defining binary outputs for each class and for each of the following regression methods, construct classification rules (by writting computer programs):
    1. linear regression
    2. logistic regression
  2. Write a computer program to perform a linear discriminant analysis
  3. Then finally implement quadratic discriminant analysis
  4. Compare the different methods and conclude.

Note: The vowel data contain both a training and a test set. Use the training set to construct the classifiers and the test set to compare the different methods!

Hint: The file exer4_9_hint.r contain code for the first part of the exercise.

 

Week 40 (4. October). Extra exercise 3.4

The R code for solution consists of the following files:
solution.extra.ex.3.4a.r
solution.extra.ex.3.4b.r
solution.extra.ex.3.4c.r
cv.k.r
Everything in a pdf-file, including results.

Exercise for 27. September: Extra exercise 3.3

The R code for solution consists of the following files:
solution.extra.ex.3.3a.r
solution.extra.ex.3.3b.r
cv.k.r
Everything in a pdf-file, including results.

Exercise for 20. September: Extra exercise 3.2

If doing the whole exercise requires too much work, you can try to solve only part a).

The R code for solution consists of the following files:
solution.extra.ex.3.2a.r
solution.extra.ex.3.2b.r
div.sim.r
lm.best.subset.r
cv.k.r
calc.err.r
calc.res.r
Everything in a pdf-file, including results.

Exercise for 6. September: Extra exercise 3.1

R code for solution
R code in a pdf-file, including results.

Exercises for August 30:

  1. Derive equation (2.13)
  2. Exercise 2.2
  3. Exercise 2.5
  4. Exercise 2.7

In some of the exercises, there will be need for using a statistical package.
We will use R in the course. R is a free software available both for linux and windows and
can be downloaded from the R home page. A good reference for use of R are
Kuhnert and Venables: An introduction to R (free).

 

Published Aug. 23, 2013 2:55 PM - Last modified Mar. 13, 2023 1:29 PM