Publications by aardvarkfunnyxia

Exercise 1.3 Simple random walk

07.01.2024

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

Publish Document

08.12.2023

hubble ## distance velocity ## 1 0.032 170 ## 2 0.034 290 ## 3 0.214 -130 ## 4 0.263 -70 ## 5 0.275 -185 ## 6 0.275 -220 ## 7 0.450 200 ## 8 0.500 290 ## 9 0.500 270 ## 10 0.630 200 ## 11 0.800 300 ## 12 0.900 -30 ## 13 0.900 650 ## 14 ...

4724 sym 4 img

Exercise 9

05.12.2023

Sheff_temp <- read.csv("Sheffield_max_temp_data.csv", header = FALSE) colnames (Sheff_temp) <- c ("Year", "Month", "Max_temp") Exercise 9.1. boxplot (Sheff_temp$Max_temp ~ Sheff_temp$Month, xlab = "", ylab = "Celsius", xaxt = "n", main = "Average maximum monthly temperature in Sheffield, 1883 - 2014") axis(side = 1, at = 1:12, l...

1156 sym R (10258 sym/37 pcs) 13 img

Cocoa price from 2012 to 2014

05.12.2023

###### The plot for exercise 6.4. Cocoa Prices from 2012 to 2014 # add the price and mean lines for all three years using # the a and b arguments for abline(), legend, text and axis features. cocoa <- read.csv ("Cocoa_prices.csv", header = FALSE) Mths <- substr(cocoa$V1, start = 1, stop = 3) Yrs <- paste ("20", substr ( cocoa$V1, start = 5, stop ...

5 sym Python (1888 sym/1 pcs) 1 img

Updated: cocoa price from 2012 to 2014

05.12.2023

cocoa <- read.csv ("Cocoa_prices.csv", header = FALSE) Mths <- substr(cocoa$V1, start = 1, stop = 3) Yrs <- paste ("20", substr ( cocoa$V1, start = 5, stop = 6)) cocoa_updated <- data.frame (Yrs, Mths, cocoa$V2) Price <- cocoa_updated$cocoa.V2 cocoa_updated_price <- data.frame (Yrs, Mths, Price) cocoa_wide <- reshape ( cocoa_updated_price, timeva...

5 sym Python (3276 sym/1 pcs) 1 img

Document

04.12.2023

Sheff_temp <- read.csv("Sheffield_max_temp_data.csv", header = FALSE) colnames (Sheff_temp) <- c ("Year", "Month", "Max_temp") Sheff_temp_noNA <- na.omit(Sheff_temp) par (mfrow = c (1,1)) boxplot (Sheff_temp$Max_temp ~ Sheff_temp$Month, xlab = "Months", ylab = "Celsius", xaxt = "n", main = "Average maximum monthly temperature ...

8 sym 2 img

Publish Document

03.12.2023

The purpose of a violin plot: It is used to visualize the distribution of numerical data. library(ggplot2) Sheff_temp <- read.csv("Sheffield_max_temp_data.csv", header = FALSE) colnames (Sheff_temp) <- c ("Year", "Month", "Max_temp") Sheff_temp_noNA <- na.omit(Sheff_temp) attach(Sheff_temp_noNA) ggplot (Sheff_temp_noNA, aes (x = fact...

100 sym R (1423 sym/2 pcs) 1 img

Document

03.12.2023

apply() Use the apply() function when we want to apply a function to the rows or columns of a matrix / data frame. apply ( name (of the matrix/data frame), MARGIN (which dimension to perform an operation across 1 = row, 2 = column), FUN (specific operation you want to perform (max, min, sum. mean, etc.)) Example: # We first create a data frame with...

1773 sym

Publish Document

28.11.2023

Exercise 8.1. x_values = seq ( -3, 3, length.out = 100000) plot ( x_values, dnorm (x_values, mean = 0, sd = 1), type = "l") abline ( v = c (-3, 3), col = "red", lty = 2, lwd = 2) total_area <- pnorm (Inf, mean = 0, sd = 1) area_below_3 <- pnorm (3, mean = 0, sd = 1) area_between <- ((2 * area_below_3 - 1) / total_area ) *100 print...

1406 sym 5 img

Document

27.11.2023

When a certain driver parks their car in the evenings, they are equally likely to remember or to forget to switch off the headlights. Giving your answers in their simplest index form, find the probability that on the next 16 occasions that they park their car in the evening, they forget to switch off the headlights: a) 14 more times than they rem...

2471 sym 4 img