Skip to content

something odd with WPA #74

@ak47twq

Description

@ak47twq

I compared the diff of two plays' home_wp_post and WPA in the database.
Is WPA suppose to be the diff of two plays' home_wp_post?
Most numbers check out, but some numbers dont make sense.

Why timeOUT has a different home_wp_post?

Here is what i do:

tic()
test<-pbp %>%
         filter(game_id == "2009_18_GB_ARI",!is.na(home_wp_post)) %>%
         select(game_id,play_id, qtr, desc, total, spread_line, home_wp_post, wpa) %>%
         collect()
toc()

tic()
test <- test %>%
     mutate(wp_diff1 = abs(wpa))
toc()

tic()
test[1,'wp_diff2'] = 0

rownum <- nrow(test)

for (i in 2:rownum){
test[i,'wp_diff2']=abs(test[i,'home_wp_post']-test[i-1,'home_wp_post'])
}
toc()

temp<-test%>%filter(wp_diff2!=wp_diff1)

WPA1
WPA2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions