Skip to content

P-AnhTrinh/statistical-programming-final-project

Repository files navigation

statistical-programming-final-project

🏃‍♀️ Olympic Games

Given a data set speed.txt. It contains the times in seconds recorded by the winners in the finals of various men’s running events (200, 400, 800 and 1500 metres) at each of the 21 Olympic Games from 1900 to 2004, along with the heights above sea level of the different venues.

Create a plot that shows both the data and the best fitting line.

According to the average speed predicted best fitting linear model, in what year will the 100 meters race be likely to be run in less than 7 seconds?

How close are the residuals (difference between the actual average speed and the speed predicted by the best fitting line) to being normally distributed?

Investigate if there is any relation between the altitude of the venue and the average speed.

🥼 Modified Newton's method

The objective of this problem is to implement an efficient root finding technique for polynomials.

In this problem, a polynomial with coefficients c1, . . . , cn+1 is defined as:

P(x) = cn+1xn + cnxn-1 + ... + c2x + c1

🔍 Ada's Walk

The goal is to simulate a random walk of an agent called Ada (in honor of Ada Lovelace) over an infinite two-dimensional grid, i.e. the set of all pairs (i, j), where i, j are integers. The random walk is defined as follows:

  • The random walk is composed of a sequence of positions A0, A1, A2, ..., where each Ak is a 2D point with integer coordinates.

  • At time t = 0, Ada is in position A0 = (0, 0).

  • Assume Ada to be in position At at time t. At time t + 1, she will move up, down, left or right with equal probability. For example, if A3 = (3,−1), then A4 can be either (4,−1), (3, 0), (2,−1), or (3,−2) with equal probability.

  • Ada always moves (At ≠ At+1 for all t)

  • The random walk stops when Ada is back in position (0, 0) or if she has already done more than 100 steps (in that case, her final position will be A100, which might or might not be (0, 0)).

🤓 Gradient Descent

The idea of the gradient descent algorithm is the following. Assume to have an initial approximation x0 of xmin. Let h > 0 be a certain step size (usually, a very small positive number). Define the gradient descent iterations as

xk+1 = xk − h∇f(xk)

We keep computing new iterations xk until a certain stopping criterion is met. For example, given a certain tolerance TOL > 0, we can stop when

||xk+1 − xk||2 ≤ TOL

where ||x||2 is the Euclidean norm of x.

About

Data analysis project implemented in R

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages