Publications by Xiao Ling

STAT3000 111824

18.11.2024

Image Compression An attractive application is dimensionwise reconstruction with a selection of \(k\leq p\) dimensions of the original data. library(jpeg) img0 <- readJPEG("cm11.jpg") dim(img0) ## [1] 256 256 3 img1 <- apply(img0,c(1,2),sum) img2 <- t(img1)[,nrow(img1):1] dim(img2) ## [1] 256 256 image(1:nrow(img2), 1:ncol(img2),img2,col=gr...

1214 sym R (4402 sym/14 pcs) 6 img

STAT3000 111324

13.11.2024

Principal Components Analysis (PCA) It is used to summarize the high-dimensional set with a smaller number of representative variables. PCA is an unsupervised approach. Each of the dimensions found by PCA is a linear combination of the \(p\) features. The first principal component of a set of features \(X_1,X_2, . . . ,X_p\) is the normalized li...

3121 sym R (7523 sym/39 pcs) 6 img

STAT3000 111124

11.11.2024

Clustering analysis data(“movielens”) library(tidyverse) library(rgl) library(dslabs) library(factoextra) x <- iris[,2:4] rownames(x)<- 1:150 plot3d(x,col = as.numeric(iris$Species),size = 8) K-means set.seed(123) kmres <- kmeans(x,3,iter.max = 10,nstart=1) print(kmres) ## K-means clustering with 3 clusters of sizes 50, 53, 47 ...

1000 sym R (3123 sym/11 pcs) 3 img

STAT3000 110624

06.11.2024

Visulalizing a linear regression fitting prediction process. library(rgl) data(mtcars) mylm <- lm(mpg ~ cyl + hp, data = mtcars) plot3d(mtcars$cyl, mtcars$hp, mtcars$mpg, xlab="cyl", ylab="hp", zlab="mpg",size=10,col="blue") planes3d(a=coef(mylm)[2], b = coef(mylm)[3], c = -1, d=coef(mylm)[1],alpha=0.3) myproj <- data.frame(cyl=mtcars$cyl,...

1025 sym R (8047 sym/29 pcs) 9 img

STAT3000 110424

04.11.2024

library(tidyverse) # data manipulation and visualization library(leaps) # model selection functions library(ISLR2) library(glmnet) LASSO (glmnet) The default model used in the package is the Guassian linear model or “least squares”. We load a set of dummy data : data("QuickStartExample") x <- QuickStartExample$x y <- QuickStartExample$y...

2117 sym R (7212 sym/33 pcs) 5 img

STAT3000 103024

30.10.2024

Lienar Model Secltion Best subset selection: Finding the best combination of the p predictors. Stepwise selection: Computationally efficient approach for feature selection. Comparing models: determing which model is best Replication requiremnts library(tidyverse) # data manipulation and visualization library(leaps) # model selection functions...

3757 sym R (2644 sym/22 pcs)

STAT3000 102824

28.10.2024

An Introduction to Logistic Regression Let’s first introducing Binomial experiment Fixed number of trials(n) Each trial is independent Each trial results in one of two outcomes: success or failure Probablity of success remains same for every trial. Example: To illustrate, suppose a quiz has 10 multiple-choice questions, with 5 possible answer...

3520 sym R (9787 sym/35 pcs)

STAT3000 102324

23.10.2024

library(ISLR2) library(MASS) head(Boston) ## crim zn indus chas nox rm age dis rad tax ptratio black lstat ## 1 0.00632 18 2.31 0 0.538 6.575 65.2 4.0900 1 296 15.3 396.90 4.98 ## 2 0.02731 0 7.07 0 0.469 6.421 78.9 4.9671 2 242 17.8 396.90 9.14 ## 3 0.02729 0 7.07 0 0.469 7.185 61.1 4.9671 2 242 1...

3233 sym R (40453 sym/43 pcs)

STAT3000 102124

21.10.2024

Linear Regression \(y_i=\beta_0+\beta_1x_i+\epsilon_i\) \(y_i\): is the outcome for sample i \(\beta_0\) is the intercept \(\beta_1\) is the slope \(x_i\) is the predictor for sample i \(\epsilon_i\) is the residual variation for sample i Least Square method \(\hat{\beta}_1=\frac{\sum x_iy_i-\frac{1}{n}\sum x_i\sum y_i}{\sum x_i^2-\frac{1}{n}...

2197 sym 1 img

STAT3000 101624

16.10.2024

Introduction to Test Statistics, Critical Region, Alpha Level, Significance Level, and p-value n_s <- 1000 n_t <- 100 single_expe <- sample(c(0,1),n_t,replace=TRUE,prob=c(0.5,0.5)) #simulate 100 tosses mean(single_expe) res <- replicate(n_s,mean( sample(c(0,1),n_t,replace=TRUE,prob=c(0.5,0.5)))) hist(res,breaks=100) Introduction to Hypoth...

2601 sym