Skip to content

This is a repository for Yale course BIS 557 Computational Statistics.

License

Notifications You must be signed in to change notification settings

yijunyang/bis557

Repository files navigation

bis557 - A Package for Computational Statistics

Travis build status Coveralls test coverage

This package contains course materials from Yale BIS557 Computational Statistics (2020 Fall). The goal is to design and implement algorithms for statistical analyses, including regression models (ridge/lasso/multi-logistic), cross-validation, stochastic gradient descent, neural networks, etc. R and Python code are designed for the implementation.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("yijunyang/bis557")

Example

This is a basic example which shows you how to solve a numerically-stable ridge regression that takes into account colinear regression variables:

# library(bis557)
data("iris")

# create a colinear term
iris$colinear <- 2*iris$Petal.Width + 0.1

# claim formula and dataset
form <- Sepal.Length ~ .
d <- iris

# make model matrices
mms <- make_model_matrices(form, d, contrasts = NULL)
X <- mms$X
Y <- mms$Y

# implement ridge regression
ridge_regression(form, d, lambda = 10)

# run the ridge regression function with cross validation
cv_ridge(form, d, lambda = seq(0, 0.05 ,0.001))

About

This is a repository for Yale course BIS 557 Computational Statistics.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published