First off, here are the previous posts in my Bayesian sampling series: Bayesian Simple Linear Regression with Gibbs Sampling in R Blocked Gibbs Sampling in R for Bayesian Multiple Linear Regression In the first post, I illustrated Gibbs Sampling - an algorithm for getting draws from a posterior when conditional posteriors are known. In the … Continue reading Metropolis-in-Gibbs Sampling and Runtime Analysis with Profviz

# Tag: computing

# Blocked Gibbs Sampling in R for Bayesian Multiple Linear Regression

In a previous post, I derived and coded a Gibbs sampler in R for estimating a simple linear regression. In this post, I will do the same for multivariate linear regression. I will derive the conditional posterior distributions necessary for the blocked Gibbs sampler. I will then code the sampler and test it using simulated … Continue reading Blocked Gibbs Sampling in R for Bayesian Multiple Linear Regression

# NYC Motor Vehicle Collisions – Street-Level Heat Map

In this post I will extend a previous analysis creating a borough-level heat map of NYC motor vehicle collisions. The data is from NYC Open Data. In particular, I will go from borough-level to street-level collisions. The processing of the code is very similar to the previous analysis, with a few more functions that map streets to colors. … Continue reading NYC Motor Vehicle Collisions – Street-Level Heat Map

# Motor Vehicle Collision Density in NYC

In a previous post, I visualized crime density in Boston using R's ggmap package. In this post, I use ggmap to visualize vehicle accidents in New York City. R code and data are included in this post. The data comes from NYC Open Data. My data cut ranges from 2012 to 2015. The data tracks the type of … Continue reading Motor Vehicle Collision Density in NYC

# Visualizing Hubway Trips in Boston

Most Popular Hubway Stations (in order): Post Office Sq. - located in the heart of the financial district. Charles St. & Cambridge - the first Hubway stop after crossing from Cambridge over Longfellow Bridge. Tremont St & West - East side of the Boston Common South Station Cross St. & Hannover - entrance to North End combing from financial … Continue reading Visualizing Hubway Trips in Boston

# Drug Crime Density in Boston

The original map can be found in my previous post, Spatial Data Visualization with R. As a review, I use get_map function in the ggmap package to grab a map of Boston from Google Maps. The "crime report" data can be found at https://data.cityofboston.gov/. In the code below, I bring in crime data as a csv file. The data … Continue reading Drug Crime Density in Boston

# Finding and Plotting Lorenz Solution using MATLAB

I use MATLAB to solve the following Lorenz initial value problem: $latex \begin{cases} x'=-10(x+y) \\ y'=-x(z+28)-y \\ z'=xy-\frac{8}{3}z \\ x(0)=y(0)=z(0)=5 \end{cases} $ I wrote a function, LorenzRK4IVP(), that takes the system of three differential equations as input and solves the system using the Runge-Kutta method with step size $latex h=.01$. I plot the strange attractor as … Continue reading Finding and Plotting Lorenz Solution using MATLAB