Sunday, November 27, 2016

Lab 14: Gerrymandering

In this week's lab we had an assignment on Gerrymandering. Gerrymandering is when voting districts are drawn in a way that favours one party over another. In this lab we had to look at compactness and community as factors for determining if a district is gerrymandered or not.

Most heavily gerrymandered districts have huge perimeter to area ratio. They will end up long and snakey. This can be detected by looking at the district's compactness. I used the Polsby-Popper method to evaluate compactness. This compares the area to perimeter as if the district was a circle the higher the score the more compact the district. I have included a screenshot of what I found to be the least compact district below. It is Congressional District 12 of North Carolina.

A lot of heavily gerrymandered districts also chop up counties that should be contiguous and will end up being made up of a lot of counties. Congressional District 1 also of North Carolina (shown below) is a district made up of bits of counties that don't even neighbor each other. It is necessary for some districts to contain multiple counties due to population sizes or even portion of counties. LA county for example is very densely populated. It needs to be split up because a single district couldn't contain it. District 1 of NC on the other hand contains little bits of many counties and few counties in their entirety.

Sunday, November 20, 2016

Lab 13: A Tale of Two DEMs


I had to compared to two DEMs of a coastal Californian water basin for lab 13. I had one that was created using LIDAR and I had a SRTM one. I created two maps to show some of the differences between them. I had one in which I subtracted them from each other to show the differences in elevation. I also made a similar map for slope.

Sunday, November 13, 2016

Lab 12: OLS vs GWR

The biggest difference between Geographically Weighted Regression (GWR) and Ordinary Least Sqaures (OLS) is that GWR takes into account geographic distribution and explores local relationships while OLS models the data globally and is a bit more rigid. GWR improved the model in this lab greatly because all the data was organized spatially and affected things closer more than things at a distance. OLS is better for things that don't have a big spatial component.

Friday, November 4, 2016

Lab 11: Regression using a GIS

In this lab I used the lessons in regression we learned last week and used them in ArcMap. This allowed me to familiarize myself with how ArcMap processes and reports regressions. The performance of a model can be evaluated using the six Ordinary Least Squares (OLS) checks. They are as follows:

  1. Are the explanatory variables helping your model? This can be checked by examining the p-value of the variables and confirming that they are statistically significant.
  2. Are the relationship what you expected? This is checked by looking at the signs of the coefficients and making sure they make sense. If a variable has a negative coefficient when you expect it to be positive something is wrong with your model.
  3.  Are any of the explanatory variables redundant? This is easily checked by examining the Variance Inflation Factors (VIF). If the VIF shows that any of the variables are redundant you may have to remove one.
  4. Is the model biased? The Jarque-Bera test looks for bias or skewed residuals. If it is significant you may have an issue with your model.
  5. Do you have all key explanatory variables? If you run the Spatial Correlation (Global Moran's I) tool it will provide you with information about whether or not your residuals are clustered, dispersed, or random. If your distribution isn't random you may need more key variables in your model
  6.  How well are you explaining your dependent variable? This is easily evaluated by looking at the adjusted r-squared value. The higher the number the bigger the percent of variation is explained by your model. If you are trying to compare this model to others you can also look at the Akaike's Information Criterion (AIC). The AIC means nothing by itself but it is useful to compare it to other models. The model with the lowest AIC is usually the better one.



Friday, October 28, 2016

Lab 10: Using Regression to Predict Rainfall.

In this lab we had an assignment that involved predicting values for rainfall using regression analysis. We were given an Excel file containing rainfall data for station A(Y) and station B(X) ranging from the years 1931-2004. Unfortunately station A was missing measurements from 1931-1949. The goal was to predict those measurements. Using the regression analyst tool in Excel I got the slope(b) and intercept coefficient(a) of the regression. This allowed me to use the regression formula, Y = bX + a to calculate the missing values assuming that the stations would have similar values for that year and have a normal distribution of data.

Sunday, October 23, 2016

Lab 9: Assessment of the accuracy of DEMs

One can determine the quality of a Digital Elevation Model (DEM) using statistics. In this lab I used Microsoft Excel to calculate the percentiles, Root Mean Squared Error (RMSE), and Mean Error (ME).
The percentiles tell you how many points fit within a given range. I used the 68th and 95th percentiles for this lab. This means, for example, that the difference between the DEM and the field report data for the 95th percentile of urban land cover is within 0.384 m 95% of the time.
RMSE tells you how similar one set of values is to another. The lower the number the more accurate the data is. RMSE does not tell you about the distribution of error. I found that bare earth and low grass land covers were the most accurate while fully forested areas were the least accurate.
ME tells you about possible bias in the data. A negative number indicates underestimation while a positive number indicates overestimation.  The urban area was the most biased with a ME of 0.164 while bare earth was the least biased with -0.005. I have attached below a table summarizing the values I arrived at during this lab.



Accuracy Metric
Accuracy (m)
Bare earth and low grass
High grass, weeds, and crops
Brush land and low trees
Fully forested
Urban
Combined
Sample size
48
55
45
98
41
287
Accuracy 68th (m)
0.098
0.151
0.22
0.222
0.189
0.276
Accuracy 95th (m)
0.163
0.44
0.481
0.463
0.384
0.171
RMSE (m)
0.105
0.181
0.246
0.394
0.2
0.429
ME
-0.005
-0.069
-0.103
0.003
0.164
-0.006

Sunday, October 16, 2016

Lab 8: Interpolation Exploration

In Lab 8 I explored various interpolation methods. The lab covered thiessen polygons, inverse distance weighted (IDW), regularized spline, and tension spline. The picture above is an example of tension spline used to interpolate water quality in Tampa Bay, FL. Thiessen polygons take each point and matches it to the closest data point. This creates uniform areas that don't easily display anything subtle. IDW weighs the distance from data points and uses that to interpolate. The farther away a data point is the less effect it has on how an area is interpreted. The two types of spline both use similar formulas to create a "sheet" that best fits the slope the data points create. Regularized splines create smoother more gradually changing surfaces but the values can lay outside of the data's original range. Tension splines are a little bit stiffer and values are more constrained by the data's original values.