Publications by Bryan Persaud
Data 608 Final Project
library(tidyverse) ## -- Attaching packages --------------------------------------- tidyverse 1.3.0 -- ## v ggplot2 3.3.2 v purrr 0.3.4 ## v tibble 3.0.4 v dplyr 1.0.2 ## v tidyr 1.1.2 v stringr 1.4.0 ## v readr 1.4.0 v forcats 0.5.0 ## -- Conflicts ------------------------------------------ tidyverse_conflicts() -- #...
3726 sym R (20402 sym/24 pcs)
Data 621 Blog 4
Beta Regression For my fourth blog I will be going over beta regression. Beta regression is mostly used when you have a dependent variable that fall in the (0,1) interval. Load Dataset To demonstrate beta regression I will be using the betareg package. Within the package also has the gasoline yield dataset. library(betareg) data("GasolineYield")...
834 sym R (2652 sym/6 pcs) 4 img
Data 609 HW 2
Ex.1 Show \(x^{2} + exp(x) + 2 x^{4} + 1\) is convex. Solution: \(f( \alpha x + \beta y) \leq \alpha f(x) + \beta f(y)\) \((\alpha x + \beta y)^{2} + exp(\alpha x + \beta y) + 2 (\alpha x + \beta y)^{4} + 1 \leq \alpha (x^{2} + exp(x) + 2 x^{4} + 1) + \beta (y^{2} + exp(y) + 2 y^{4} + 1)\) Using \(\alpha + \beta = 1\) we can simplify the inequali...
2884 sym R (416 sym/9 pcs) 1 img
Data 609 HW 1
Ex.1 Find the minimum of \(f(x,y) = x^{2} + xy + y^{2} in (x,y) \in R^{2}\) Solution: The stationary conditions are \(\frac{\partial f}{\partial x} =2x + y=0\) and \(\frac{\partial f}{\partial y} =x + 2y=0\) From the second condition we get either x = -2y or y = \(\frac{-x}{2}\) Substituting x = -2y into the first condition gives us 2(-2y) + y = ...
2391 sym
Data 609 HW 4
Ex.1 For Example 19 on Page 79 in the book, carry out the regression using R. x -0.98 1.00 2.02 3.03 4.00 y 2.44 -1.51 -0.47 2.54 7.52 Solution: x <- c(-0.98, 1.00, 2.02, 3.03, 4.00) y <- c(2.44, -1.51, -0.47, 2.54, 7.52) model1 <- lm(y~x) model1 ## ## Call: ## lm(formula = y ~ x) ## ## Coefficients: ## (Intercept) x ## ...
3380 sym R (1895 sym/11 pcs) 2 img
Data 609 HW 3
Ex.1 Write down Newton’s formula for finding the minimum of \(f(x) = (3x^{4} - 4x^{3}) / 12\) in the range [-10, 10]. Then, implement it in R. Solution: First find the first two derivatives of f(x) \(f'(x) = \frac{ 12x^{3} - 12x^{2} }{12} = x^{2}(x - 1) = x^{3} - x^{2}\) \(f''(x) = 3x^{2} - 2x\) Then we know Newton’s formula to be \(x_{k + 1}...
2147 sym R (1389 sym/11 pcs)
Data 609 HW 8
Ex.1 Use the nnet package to analyze the iris data set. Use 80% of the 150 samples as the training data and the rest for validation. Discuss the results. Solution: library(nnet) ## Warning: package 'nnet' was built under R version 4.0.5 set.seed(123) iris_split <- sort(sample(nrow(iris), nrow(iris) * 0.8)) train <- iris[iris_split, -5] validat...
1762 sym R (1933 sym/14 pcs) 1 img
Data 698 Final Project Presentation
Data 698 Final Project Presentation Bryan Persaud 5/18/2021 Abstract Watching TV used to be you watch shows on TV channels provided by some TV provider. This has seen some change in the modern world with the introduction of streaming services. This project will look to monitor this change by looking to answer these two questions, 1. Are strea...
15948 sym R (17678 sym/16 pcs) 5 img
Data 609 HW 7
Ex.1 Use the svm() algorithm of the e1071 package to carry out the support vector machine for the PlantGrowth data set. Then, discuss the number of support vectors/samples. [Install the e1071 package in R if needed.] Solution: library(e1071) ## Warning: package 'e1071' was built under R version 4.0.5 plant_svm <- svm(group ~ ., data = PlantGrowth...
843 sym R (1351 sym/11 pcs)
Data 609 HW 6
Ex.1 Use a data set such as the PlantGrowth in R to calculate three different distance metrics and discuss the results. Solution: plants_euclidean <- dist(PlantGrowth, method = "euclidean") ## Warning in dist(PlantGrowth, method = "euclidean"): NAs introduced by coercion as.matrix(plants_euclidean) ## 1 2 3 4...
3289 sym R (91341 sym/37 pcs) 3 img