Publications by Matthew Lucich

Document

02.02.2022

Principles of Data Visualization and Introduction to ggplot2 I have provided you with data about the 5,000 fastest growing companies in the US, as compiled by Inc. magazine. lets read this in: inc <- read.csv("https://raw.githubusercontent.com/charleyferrari/CUNY_DATA_608/master/module1/Data/inc5000_data.csv", header= TRUE) And lets preview this...

1470 sym R (6764 sym/14 pcs) 3 img

Document

30.01.2022

1. Problem set 1 (1) What is the rank of the matrix A? A <- matrix(c(1,-1,0,5,2,0,1,4,3,1,-2,-2,4,3,1,-3), nrow=4, ncol=4) A_ut <- A # Row operations to convert matrix into upper triangular form A_ut[2,] <- A[2,] + A[1,] A_ut[4,] <- A_ut[4,] - 5*A_ut[1,] A_ut[3,] <- A_ut[3,] - A_ut[2,]/2 A_ut[4,] <- A_ut[4,] + 3*A_ut[2,] A_ut[4,] <- A_ut[4,] + ...

2543 sym R (2545 sym/20 pcs)

Data 605 HW10

02.04.2022

Smith is in jail and has 1 dollar; he can get out on bail if he has 8 dollars. A guard agrees to make a series of bets with him. If Smith bets A dollars, he wins A dollars with probability .4 and loses A dollars with probability .6. Find the probability that he wins 8 dollars before losing all of his money if (a) he bets 1 dollar each time (timi...

1541 sym R (1271 sym/8 pcs)

Data 605 HW9

27.03.2022

1) The price of one share of stock in the Pilsdorff Beer Company (see Exer- cise 8.2.12) is given by Yn on the nth day of the year. Finn observes that the differences Xn = Yn+1 − Yn appear to be independent random variables with a common distribution having mean μ = 0 and variance σ2 = 1/4. If Y1 = 100, estimate the probability that Y365 is ...

2535 sym R (621 sym/12 pcs)

Data 605 HW7

14.03.2022

1) Let X1, X2, . . . , Xn be n mutually independent random variables, each of which is uniformly distributed on the integers from 1 to k. Let Y denote the minimum of the Xi’s. Find the distribution of Y . Let’s demonstrate the distribution of Y through simulations. min.uniform <- function(k, n) { all_rand_vars <- c() for (rand_x in c(1:n)...

1499 sym R (1446 sym/27 pcs) 3 img

Data 605 HW6

04.03.2022

1) A bag contains 5 green and 7 red jellybeans. How many ways can 5 jellybeans be withdrawn from the bag so that the number of green ones withdrawn will be less than 2? ((choose(7, 4) * choose(5, 1)) + choose(7, 5)) ## [1] 196 Solution: 196 2) A certain congressional committee consists of 14 senators and 13 representatives. How many ways can a s...

3279 sym R (1229 sym/30 pcs)

Data 605 HW5

20.02.2022

1. (Bayesian). A new test for multinucleoside-resistant (MNR) human immunodeficiency virus type 1 (HIV-1) variants was recently developed. The test maintains 96% sensitivity, meaning that, for those with the disease, it will correctly report “positive” for 96% of them. The test is also 98% specific, meaning that, for those without the disease...

6068 sym R (4191 sym/57 pcs)

Data 605 HW8

18.03.2022

11) (page 303) A company buys 100 lightbulbs, each of which has an exponential lifetime of 1000 hours. What is the expected time for the first of these bulbs to burn out? (See Exercise 10.) # Simulation method min.exponential <- function(n) { all_rand_vars <- c() for (rand_x in c(1:n)) { rand_var <- c() rand_var <- append(rand_var, re...

2140 sym R (560 sym/10 pcs)

Data 605 Discussion 11

06.04.2022

St. Louis FRED: Job Postings on Indeed in the United States (IHLCHGUS) vs Wilshire 5000 Total Market Full Cap Index (WILL5000INDFC) # Load data df_fred <- read_csv("jobs_market.csv") ## Rows: 523 Columns: 3 ## ── Column specification ────────────────────────────────────�...

673 sym R (2086 sym/18 pcs) 6 img

Data 605 HW 14

20.04.2022

This week, we’ll work out some Taylor Series expansions of popular functions. \(f(x) = \frac{1}{(1-x)}\) f=expression(1/(1-x)) # First derivative derv_1 <- D(f,'x') Simplify(derv_1) ## 1/(1 - x)^2 derv_1_func <- function(x) {1/(1 - x)^2} # Evaluate at zero derv_1_func(0) ## [1] 1 # Second derivative derv_2 <- D(D(f,'x'),'x') Simplify(der...

771 sym R (2950 sym/74 pcs)