@@ -5,8 +5,7 @@ Status](https://travis-ci.org/moveability/calibration.svg)](https://travis-ci.or
5
5
[ ![ Project Status: Concept - Minimal or no implementation has been done
6
6
yet.] ( http://www.repostatus.org/badges/0.1.0/concept.svg )] ( http://www.repostatus.org/#concept )
7
7
8
- calibration
9
- ===========
8
+ # calibration
10
9
11
10
<!-- badges: start -->
12
11
@@ -21,7 +20,7 @@ City](https://www1.nyc.gov/html/dot/html/about/datafeeds.shtml#Pedestrians).
21
20
22
21
Final result looks like this:
23
22
24
- #> Loading calibration
23
+ #> Loading nyped
25
24
26
25
``` r
27
26
x <- calc_layer_scales (data_dir , model = " final" )
@@ -31,22 +30,22 @@ x <- calc_layer_scales (data_dir, model = "final")
31
30
knitr :: kable (x )
32
31
```
33
32
34
- | | layer | estimates| full\_ rel| ped\_ rel| full\_ abs| ped\_ abs| t| p |
35
- | ----- | :-------- | --------------: | -----------: | -----------: | -------------: | -------------: | ----------: | ----------: |
36
- | 13 | hea-dis | 105658.191105| 0.5719363| 0.3459949| 60429.755766| 36557.196583| 9.868915| 0.0000000|
37
- | 1 | sub-dis | 22.566344| 0.5219142| 0.5682277| 11.777695| 12.822822| 8.986039| 0.0000000|
38
- | 12 | sub-cen | -10.087818| -0.2347841| -0.3304276| 2.368459| 3.333293| -6.994975| 0.0000000|
39
- | 6 | sub-hea | 8.378134| 0.4338598| 0.4335501| 3.634935| 3.632341| 6.658314| 0.0000000|
40
- | 7 | sus-edu | -5923.748211| -0.6416411| -0.5697332| 3800.920378| 3374.956231| -6.056855| 0.0000000|
41
- | 8 | edu-hea | -24921.480025| -0.4563520| -0.3789464| 11372.966534| 9443.905594| -5.607032| 0.0000002|
42
- | 4 | edu-tra | 23977.299359| 0.3225789| 0.2620421| 7734.569685| 6283.060961| 5.347316| 0.0000006|
43
- | 2 | sub-tra | 6.444493| 0.2392262| 0.2839541| 1.541692| 1.829940| 5.080766| 0.0000018|
44
- | 9 | sus-res | 6258.235319| 0.3904308| 0.4362252| 2443.407704| 2729.999677| 5.080036| 0.0000018|
45
- | 11 | sus-sub | -1336.884757| -0.1903741| -0.2170844| 254.508256| 290.216796| -4.039428| 0.0001066|
46
- | 5 | sus-ent | 1445.795365| 0.2070682| 0.1704797| 299.378267| 246.478763| 4.002238| 0.0001220|
47
- | 3 | edu-dis | -78056.981732| -0.5872607| -0.3261469| 45839.794420| 25458.042278| -3.183290| 0.0019518|
48
- | 14 | ent-tra | 38179.006598| 0.1893925| 0.1540936| 7230.818735| 5883.141715| 3.176518| 0.0019936|
49
- | 10 | edu-sus | 16903.889029| 0.2340051| 0.1677712| 3955.596308| 2835.985535| 3.033825| 0.0030914|
33
+ | | layer | estimates | full\_ rel | ped\_ rel | full\_ abs | ped\_ abs | t | p |
34
+ | -- | :------ | -------------: | ----------: | ----------: | -----------: | -----------: | ---------: | --------: |
35
+ | 13 | hea-dis | 105658.191105 | 0.5719363 | 0.3459949 | 60429.755766 | 36557.196583 | 9.868915 | 0.0000000 |
36
+ | 1 | sub-dis | 22.566344 | 0.5219142 | 0.5682277 | 11.777695 | 12.822822 | 8.986039 | 0.0000000 |
37
+ | 12 | sub-cen | \ - 10.087818 | \ - 0.2347841 | \ - 0.3304276 | 2.368459 | 3.333293 | \ - 6.994975 | 0.0000000 |
38
+ | 6 | sub-hea | 8.378134 | 0.4338598 | 0.4335501 | 3.634935 | 3.632341 | 6.658314 | 0.0000000 |
39
+ | 7 | sus-edu | \ - 5923.748211 | \ - 0.6416411 | \ - 0.5697332 | 3800.920378 | 3374.956231 | \ - 6.056855 | 0.0000000 |
40
+ | 8 | edu-hea | \ - 24921.480025 | \ - 0.4563520 | \ - 0.3789464 | 11372.966534 | 9443.905594 | \ - 5.607032 | 0.0000002 |
41
+ | 4 | edu-tra | 23977.299359 | 0.3225789 | 0.2620421 | 7734.569685 | 6283.060961 | 5.347316 | 0.0000006 |
42
+ | 2 | sub-tra | 6.444493 | 0.2392262 | 0.2839541 | 1.541692 | 1.829940 | 5.080766 | 0.0000018 |
43
+ | 9 | sus-res | 6258.235319 | 0.3904308 | 0.4362252 | 2443.407704 | 2729.999677 | 5.080036 | 0.0000018 |
44
+ | 11 | sus-sub | \ - 1336.884757 | \ - 0.1903741 | \ - 0.2170844 | 254.508256 | 290.216796 | \ - 4.039428 | 0.0001066 |
45
+ | 5 | sus-ent | 1445.795365 | 0.2070682 | 0.1704797 | 299.378267 | 246.478763 | 4.002238 | 0.0001220 |
46
+ | 3 | edu-dis | \ - 78056.981732 | \ - 0.5872607 | \ - 0.3261469 | 45839.794420 | 25458.042278 | \ - 3.183290 | 0.0019518 |
47
+ | 14 | ent-tra | 38179.006598 | 0.1893925 | 0.1540936 | 7230.818735 | 5883.141715 | 3.176518 | 0.0019936 |
48
+ | 10 | edu-sus | 16903.889029 | 0.2340051 | 0.1677712 | 3955.596308 | 2835.985535 | 3.033825 | 0.0030914 |
50
49
51
50
With the following model statistics:
52
51
@@ -90,3 +89,19 @@ summary (lm (dat$p ~ f_))
90
89
The final flow model looks like this:
91
90
92
91
![ ] ( ./man/figures/flowmap.png )
92
+
93
+ And a final statistical relationship between modelled and observed
94
+ pedestrian counts that looks like this:
95
+
96
+ ``` r
97
+ data_dir <- " /data/data/moveability/nyc"
98
+ dat <- readRDS (file.path (data_dir , " ped-model-final.Rds" ))
99
+ mod <- lm (dat $ p ~ dat $ flowvars )
100
+ res <- data.frame (predicted = predict (mod ),
101
+ actual = dat $ p )
102
+ ggplot (res , aes (x = predicted , y = actual )) +
103
+ geom_point () +
104
+ geom_smooth (method = " lm" )
105
+ ```
106
+
107
+ <img src =" man/figures/README-model-plot-1.png " width =" 100% " />
0 commit comments