Publications by aardvarkfunnyxia
Exercise 3.5 Presentation
2024-01-23 Exercise 3.5. For the country data: produce a matrix of scatter plots comparing the three numerical columns of data. You could either use: the pairs() function or explore the car package for a more sophisticated representation. Are any of the relationships linear? Look for best linear relationships using log() transformations and c...
743 sym 6 img
Exercise 3.5 Presentation
2024-01-22 Exercise 3.5. For the country data: produce a matrix of scatter plots comparing the three numerical columns of data. You could either use: the pairs() function or explore the car package for a more sophisticated representation. Are any of the relationships linear? Look for best linear relationships using log() transformations and c...
729 sym 5 img
Exercise 3.3 presentation
2024-01-21 Exercise 3.3 Apply your favorite transformation from Exercise 3.2 to the data, firstly excluding Brazil and China, and secondly excluding all dates before 2013. Produce a pair of plots similar to those in Exercise 3.2. What conclusions can we draw from our investigations? Does chocolate consumption improve intellectual output (for whic...
943 sym 4 img
Exercise 3.5 presentation
2024-01-21 Exercise 3.5. For the country data: produce a matrix of scatter plots comparing the three numerical columns of data. You could either use: the pairs() function or explore the car package for a more sophisticated representation. Are any of the relationships linear? Look for best linear relationships using log() transformations and c...
659 sym 3 img
week 2
(\(\blacksquare\) indicates the end of the answer of a specific exercise) First of all, let’s see the qanda data: ## Hair Birth Handspan Siblings Shoes Fish Height ## 1 Black July 20.0 1 10 1 168 ## 2 Blonde May 20.0 0 40 1 186 ## 3 Black October 15.8 1 37 0 183 ## 4 ...
4176 sym 2 img
Matrix multiplication
There are two signs: \(*\) and %*% , both means multiplication in broad terms, but they are different when dealing with matrices. Suppose I have two vectors: A <- matrix (1:6, nrow = 2) B <- matrix (5:10, ncol = 2) View these matrices: ## [,1] [,2] [,3] ## [1,] 1 3 5 ## [2,] 2 4 6 ## [,1] [,2] ## [1,] 5 8 ## [2,] ...
719 sym
Extension - prop.table() and margin.table() in R
How to use prop.table() in R The prop.table() in R can be used to calculate the value of each cell in a (contingency) table as a proportion of all values. The function uses the following basic syntax: prop.table( x, margin=NULL) where: x: Name of the Table margin: the margin to divide by (1 = row, 2 = column, default is NULL) Example: create a ma...
1999 sym
E1
Exercise 1.1. euler’s constant n <- seq (from = 1, to = 100, by = 1) euler <- sum (n^(-1)) - log (100, base = exp (1)) euler ## [1] 0.5822073 Exercise 1.2. simple random walk set.seed (10) # set seed for reproduction steps <- rbinom (n = 999, size = 1, prob = 1/2) rademacher_variables <- c (0, 2 * steps - 1...
535 sym Python (2027 sym/18 pcs) 2 img
Exercise 1.6, plot on log scale of errors - Euler's constant
Exercise 1.6. As in Exercise 1.1, compute \(\gamma \times n\) for \(n \in {10, 100, 1000, 10000, 100000}\). Compare your approximations \(\gamma \times n\) with the true value of the Euler’s constant (which you can obtain using -digamma(1) in R) to find the approximation error. Plot n against the approximation error with a log-log scale. prepara...
492 sym Python (1526 sym/15 pcs) 1 img
Exercise 1.3 simple random walk
Look up the help file of the cumsum() function. Apply this function on the vector of Rademacher random variables you obtained in Exercise 1.2 to create a simple random walk with 1000 steps. Plot your random walk on a suitable graph. What is the maximal deviation of this random walk from 0? How many times has your random walk returned to 0? prep...
469 sym 1 img