Sunday, March 2, 2014

Prediction Recap (2/24)

#1 Syracuse @ Maryland:  Syracuse by 1
#1 Syracuse @ #14 Virginia:  Virginia by 2

Syracuse is barely favored at mediocre Maryland, which could lead to the spectacle of having the #1 team lose four straight games. 

Syracuse pulls out a 2 point win at Maryland, so we don't get the spectacle of four straight losses, but they do lose to Virginia by 19 (!) points.
 
Virginia Tech @ #5 Duke:  Duke by 31

VT loses by "only" 18.
 
#20 Michigan @ Purdue:  Michigan by 3

A good chance for Purdue to steal a meaningless but satisfying upset.

Purdue loses by 1 point in OT -- but as Feinstein would say, that's what bad teams do.

#7 Cincinnati @ #21 Connecticut:  UConn by 6

UConn by ... 6.
 
#8 Kansas @ Oklahoma State: OKSt by 5

The PM may be the last believer in OK State (although they had a good win this week against Texas Tech).  If the PM is to be believed, they have a good chance to beat Kansas next Saturday.

Yes indeed, you mockers!  OKState wins by 7.
 
#11 Louisville @ #22 Memphis: Louisville by 3

A good illustration of how powerful the HCA is in college basketball. 

Memphis wins by 6 in a game that Louisville led by 8 points or so with just a few minutes to go.  Louisville is now 1-4 against ranked teams this season, which can't be a good sign.
 
#15 Iowa @ Minnesota: Iowa by 4
#11 Creighton @ Xavier:  Creighton by 3.5
#17 Kansas State @ Iowa State:  KSU by 4
#19 Texas @ Oklahoma: Oklahoma by 12
#25 Gonzaga @ St. Mary's:  SMU by 2

We could easily see all the ranked teams lose. 

Five ranked teams losing in the same weekend?  Are you crazy?

Iowa lost, Creighton lost,  Kansas State lost, and Texas lost.  (Gonzaga won fairly easily.) 
Crazy like a fox.  :-)

Wednesday, February 26, 2014

Tool Posting: Quicklisp with an Authenticating Proxy

(To regular readers of this blog who are looking for basketball content -- this posting is in my occasional series on the tools I use, and may not be of interest.  On the other hand, if you found this posting Googling for a workaround for an authenticating proxy in Quicklisp, you're in the right place!)

Quicklisp is a great tool for installing packages into Common Lisp.  Unfortunately, it doesn't work with authenticating proxies, which is a bother in many environments. However, there's a fairly straightforward workaround to fix this.

The basic idea is to insert a new proxy between Quicklisp and the authenticating proxy.  Quicklisp will talk to the new proxy without authentication, and the new proxy will take care of authenticating with the real proxy.There are probably several different proxies you can use to do this, but I chose DeleGate.  It's free to use for non-commercial use.  Download Delegate, install it, and then start it with the following command line:

delegate -P8091 SERVER=http PROXY="realProxy:8080:*" MYAUTH="username:password" ADMIN="foo@foo.com" 

This says to start delegate as an HTTP proxy on port 8091, forwarding all requests to port 8080 on the realProxy, using the authentication provided in MYAUTH.  (The ADMIN parameter is just an email address required by Delegate, you can put in whatever you'd like.)  Obviously you'll need to fill in the address of your existing proxy and the correct username and password for that proxy.
 
Once Delegate is running, you can install Quicklisp as follows:

(quicklisp-quickstart:install :proxy "http://localhost:8081/")
 

This directs Quicklisp to the new Delegate proxy.  Delegate connects to the real proxy using the username and password you provided, and then just passes along the requests.  The result is that Quicklisp doesn't have to talk directly to the authenticating proxy.

It's worth noting that whatever proxy specification you use when running quicklist-quickstart:install will be used by Quicklisp from then on.  If you ever need to change your proxy, you do it like so:

(setf (ql-config:config-value "proxy-url") "http://proxy.value.here")

Under Windows, you can set up Delegate as a service that will run every time Windows starts or just start it manually whenever you want to use Quicklisp.  The same trick will work for other programs that don't know how to interact with an authenticating proxy.

Monday, February 24, 2014

Top Twenty & Predictions (2/24)

1 NC Louisville
31.05
-0.13%
2 NC Iowa
30.31
-0.33%
3 NC Arizona
30.19
0.53%
4 NC Duke
29.88
-0.43%
5 (+1) Oklahoma St.
29.65
0.34%
6 (-1) Creighton
29.63
-0.07%
7 NC Michigan
29.46
0.14%
8 NC Ohio St.
29.39
0.17%
9 NC Villanova
29.25
-0.14%
10 NC Kentucky
29.20
-0.21%
11 NC Michigan St.
29.12
0.17%
12 NC UCLA
29.05
0.24%
13 (+2) Kansas
28.95
0.66%
14 (-1) Florida
28.88
-0.24%
15 (-1) Iowa St.
28.86
-0.14%
16 (+4) Wisconsin
28.68
0.35%
17 NEW Cincinnati
28.66
N/A
18 (-1) Connecticut
28.61
-0.28%
19 (-1) Pittsburgh
28.56
-0.28%
20 (-1) Syracuse
28.51
-0.45%

The farther we get into the season, the harder it is for the ratings to move, so as an experiment I'm showing the change in ratings from the previous Top Twenty as a percentage.  The big upward moves this week are Kansas (pounded #19 Texas), Arizona (pounded Colorado) and Wisconsin (beat #15 Michigan and #15 Iowa).  The big losers are Syracuse and Duke for obvious reasons.

#1 Syracuse @ Maryland:  Syracuse by 1
#1 Syracuse @ #14 Virginia:  Virginia by 2


Syracuse is barely favored at mediocre Maryland, which could lead to the spectacle of having the #1 team lose four straight games.  How Boeheim will top his Duke meltdown if this happens is unknown.

BLOWOUT OF THE WEEK

Virginia Tech @ #5 Duke:  Duke by 31


VT is getting worse much faster than Duke is getting worse.

#20 Michigan @ Purdue:  Michigan by 3

A good chance for Purdue to steal a meaningless but satisfying upset.

#7 Cincinnati @ #21 Connecticut:  UConn by 6

Cincinnati has popped onto the PM's Top Twenty this week but will probably be overmatched at Connecticut.

#8 Kansas @ Oklahoma State: OKSt by 5

The PM may be the last believer in OK State (although they had a good win this week against Texas Tech).  If the PM is to be believed, they have a good chance to beat Kansas next Saturday.

#11 Louisville @ #22 Memphis: Louisville by 3

A good illustration of how powerful the HCA is in college basketball.  This is #1 versus #34 in the PM's book, and the #1 is still only favored by 3 points because they're on the road.  Speaking of which...

#15 Iowa @ Minnesota: Iowa by 4
#11 Creighton @ Xavier:  Creighton by 3.5
#17 Kansas State @ Iowa State:  KSU by 4
#19 Texas @ Oklahoma: Oklahoma by 12
#25 Gonzaga @ St. Mary's:  SMU by 2


We could easily see all the ranked teams lose.  The moral of this story is "Try not to play road games as a mediocre ranked team."  :-)

Predictions Recap (2/19)

It was not a great week for the PM's predictions!

TOSS-UP OF THE WEEK
#23 UCLA @ Cal

Cal is a bare favorite at home.

UCLA won by 20 (!).  Good for my Bruins, although they blew it later against Stanford. 
 
#5 Duke @ UNC:  Duke +4

Duke lost by 8.
 
#1 Syracuse @ #5 Duke:  Duke +10

Coming off the inexplicable loss to BC, Syracuse loses to Duke by 6, although that number was artificially inflated by Boeheim's meltdown.  Not a good week for Duke, and they'll probably drop in the PM's rankings.
 
#11 Louisville @ #7 Cincinnati:  Louisville +4

Louisville is underrated by the AP and Cincinnati is overrated.

Louisville squeaks out a 1 point win.
 
#19 Texas @ #8 Kansas:  Kansas +10

Despite the scare at Texas Tech, Kansas should handle Texas without any problems.

Kansas by 31.  I tuned in during the first half and wondered if there was a scoreboard malfunction -- it was 46-18 at the half.
 
#16 Wisconsin @ #15 Iowa: Iowa +7

Road records in the B10 have been crazy, so I'm hesitant to put much faith in this prediction.

Wisely, as Wisconsin wins by 5.  Wisconsin has been steadily improving since the lost to Northwestern.
 
BLOWOUT OF THE WEEK
San Jose State @ SDSU:  SDSU +29

VT @ Duke is also going to be a blowout.

I accidentally looked too far ahead for these blowouts -- both games will be this week.

Wednesday, February 19, 2014

Time of Possession

A simple model of basketball is this:  A team brings the ball up court, runs its offense until it gets a good shot opportunity, and then shoots the ball.  So you might expect that good offenses (and poor defenses) lead to shorter times of possession, and vice versa.   This suggests that knowing something about a team's time of possession can help us judge its offensive effectivity.

(Of course, there are a lot of complicating factors.  Some teams intentionally take long or short possessions.  And possessions that start with an offensive rebound are likely to be shorter than ones that don't.  And so on.  But I did say this was a simple model.)

A "possession" is typically defined as a period during which one team or the other continuously controls the ball.  The traditional way to calculate the number of possessions in a game is to use a formula that looks something like this (there are several widely used variants):
Possessions = FGA - Oreb + 0.475*FTA + TO
If you look at the first two terms, you'll see that if a team has the ball, makes a shot attempt, gets the rebound and makes another shot attempt, that will equate to one possession, because the offensive rebound will "cancel out" the first shot attempt.

However, I'm interested in a different definition of possession -- one that corresponds with a team receiving a fresh shot clock.  This equates to the number of times a team "runs it's offense".  With this definition, if a team has the ball, makes a shot attempt, gets the rebound and makes another shot attempt, that will equate to two possessions.

After some experimentation, a fairly good equation for estimating that number seems to be:

Possessions = FGA + 0.666*FTA + TO + 3
(This is based upon counting the possessions from play-by-play data and performing a linear regression for games from the 2013 season.)

If you calculate the number of possessions for each team, you can then calculate the average length of possession for the game, but you cannot determine the average length of possession for each team.  To do that, you need to analyze the play-by-play data.  Fortunately, the ESPN Scoreboard provides play-by-play data for the majority of games, and the format is fairly standardized.

I've spent the last couple of weeks figuring out how to scrape the play by play data and analyze it to determine change-of-possession and average length of possession.  Whether these statistics are useful for prediction remains to be seen.

Top Twenty (2/19)

The Top Twenty was delayed a bit this week so that I could finish up some data collection (more on that shortly).

1 Louisville 31.09
NC
2 Iowa 30.41
NC
3 Arizona 30.03
NC
4 Duke 30.01
NC
5 Creighton 29.65
(+1)
6 Oklahoma St. 29.55
(-1)
7 Michigan 29.42
NC
8 Ohio St. 29.34
NC
9 Villanova 29.29
NC
10 Kentucky 29.26
NC
11 Michigan St. 29.07
NC
12 UCLA 28.98
(+1)
13 Florida 28.95
(+1)
14 Iowa St. 28.9
(-2)
15 Kansas 28.76
(+1)
16 Arizona St. 28.7
(+2)
17 Connecticut 28.69
NEW
18 Pittsburgh 28.64
(-3)
19 Syracuse 28.64
(-2)
20 Wisconsin 28.58
NEW

The top ten is remarkably stable this week.  Some shifting around in the bottom half -- Pittsburgh losing to Syracuse brought them down, and Syracuse's near miss at NC State has brought them down.  Meanwhile ASU moves up thanks to the nice (but not completely improbable) win against Arizona.

PREDICTIONS

TOSS-UP OF THE WEEK
#23 UCLA @ Cal

 Cal is a bare favorite at home.

#5 Duke @ UNC:  Duke +4

Assuming no more freak snowstorms.  A win here would prepare Duke for...

#1 Syracuse @ #5 Duke:  Duke +10
It's an almost certain end to Syracuse's unbeaten streak.   A team that needs a last second basket to escape (#100) NC State is going to have to play a lot better to win at Cameron.

#11 Louisville @ #7 Cincinnati:  Louisville +4

Louisville is underrated by the AP and Cincinnati is overrated.

#19 Texas @ #8 Kansas:  Kansas +10

Despite the scare at Texas Tech, Kansas should handle Texas without any problems.

#16 Wisconsin @ #15 Iowa: Iowa +7

Road records in the B10 have been crazy, so I'm hesitant to put much faith in this prediction.

BLOWOUT OF THE WEEK 
San Jose State @ SDSU:  SDSU +29
VT @ Duke is also going to be a blowout.

Sunday, February 16, 2014

Predictions Recap (2/10)

#10 Michigan @ tOSU:  OSU +4

Michigan wins pretty handily (+10) to continue the B10's chaos.  The road records in the B10 are crazy.
 
TOSS-UP OF THE WEEK

#19 Oklahoma State @ #15 Texas

Oklahoma State has four straight losses and Marcus Smart is out.  Texas is coming off an embarrassing loss to KSU.  Anything could happen, but with the absence of Smart I'll give Texas the nod.

Texas +9.  Losing Smart probably didn't hurt Ok State much in this game.  Texas just shot lights out in the first half.
 
#1 Syracuse @ #25 Pittsburgh:  Pittsburgh +3

Syracuse wins on a last second thirty-five footer from Ennis.  This will cement Syracuse as a favorite in the eyes of the media, but in reality it's not that surprising a result.
 
#11 Duke @ UNC:  Duke +5

Anything can happen in this rivalry...
 
Although I would not have predicted a weather-induced postponement between two campuses within spitting distance of each other.

#1 Arizona @ ASU:  Arizona +6

ASU is undoubtedly the best 18-6 team in the country, but they have a big job to beat Arizona even at home.

A big job, indeed.  It took them two overtimes.
 
#3 Florida @ #18 Kentucky:  Kentucky +5

Florida wins handily (+10) which has to be seen as something of a setback for Cal's boys.
 
#24 Memphis @ #22 Connecticut:  UConn +4

This should be a good game between two very evenly matched teams.

Indeed!  UConn manages to win by 5 in OT.
 
BLOWOUT OF THE WEEK

Rutgers @ Louisville:  Louisville +27

This will not be pretty.
That might have been an understatement.  Louisville by 48 (!).