Publications by Shams Tabrez
Algo II Homework8
Chapter 09 (page 368): 5, 7, 8 (5) (a) x1 = runif(500) -0.5 x2 = runif(500) -0.5 y = 1 * (x1^2 - x2^2 > 0) (b) plot(x1[y==1], x2[y==1], col = "red", xlab = "x1", ylab = "x2") points(x1[y==0], x2[y==0]) ### (c) log.model = glm(y ~ x1 + x2, family = binomial) (d) log.PredProb = predict.glm(log.model, type = "response") log.PredSur = ifelse(lo...
8888 sym R (1520642 sym/7864 pcs) 8 img
Algo II Homework7
Chapter 08 (page 332): 3, 8, 9 (3) err = seq(0.0, 1.0, .01) m = 1 - err err.fun=function(a){ b = 1 - a return(1-max(a,b)) } class.error = sapply(err, err.fun) gini = ( ( err * (1 - err) ) + ( m * (1 - m) ) ) entropy = ( - ( (err * log2(err) ) + ( m * log2(m) ) ) ) plot(err, entropy, typ = "l", xlab ="", ylab = "") lines(err, gini, col = "...
1441 sym R (5398 sym/53 pcs) 8 img
Homework2
Load library “astsa” and set working directory library(astsa) library(fGarch) ## Loading required package: timeDate ## Loading required package: timeSeries ## Loading required package: fBasics ## ## Attaching package: 'fBasics' ## The following object is masked from 'package:astsa': ## ## nyse # set your working directory Exercise 1: S...
6108 sym R (15855 sym/103 pcs) 20 img
Document
Homework1 Exercise 1: ACF and PACF from simulated data under ARMA(p,q) model For simulated stationary data (n=200) under different ARMA models listed below, (i) plot observations, (ii) plot its ACF and PACF plots, and (iii) describe what you observe from ACF and PACF. a) Two sets of simulated stationary data under AR(3) model by specifying coe...
6239 sym R (7164 sym/58 pcs) 49 img
Homework6
Chapter 07 (page 297): 6, 10 6 (a) library(ISLR) library(boot) attach(Wage) MSE Cross Validation set.seed(42) MSE = vector(mode = "list", length = 10) for (i in 1:10) { fit=glm(wage~poly(age,i),data=Wage) MSE[i]=cv.glm(Wage, fit, K=10)$delta[1] } MSE ## [[1]] ## [1] 1676.334 ## ## [[2]] ## [1] 1601.952 ## ## [[3]] ## [1] 1597.313 ## ## [...
679 sym R (5561 sym/32 pcs) 11 img
Customer acquisition and retention case study
Access acquisitionRetention data, cleanup and split library(SMCRM) data("acquisitionRetention") ret = acquisitionRetention[,c(2:15)] ret = na.omit(ret) ret$acquisition = as.factor(ret$acquisition) ret$industry = as.factor(ret$industry) str(ret) ## 'data.frame': 500 obs. of 14 variables: ## $ acquisition: Factor w/ 2 levels "0","1": 2 2 2 1 2...
691 sym R (15984 sym/106 pcs) 16 img
Final Exam Data Driven Decision Making
Load libraries to be used library(astsa) library(forecast) ## Registered S3 method overwritten by 'quantmod': ## method from ## as.zoo.data.frame zoo ## ## Attaching package: 'forecast' ## The following object is masked from 'package:astsa': ## ## gas library(fGarch) ## Loading required package: timeDate ## Loading required p...
7745 sym R (21375 sym/95 pcs) 22 img
Petrol Prices Case Study
Business Objectives and Goals The main objective of this analysis is to determine factors affecting petrol prices. Following are the goals to achieve: Find factors, Correlation, Importance Data Sources and Data Used The dataset contains one response variable and six regressor variables. 84 observations data points of monthly data from April, 20...
2505 sym R (60150 sym/50 pcs) 7 img