-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.xml
More file actions
executable file
·994 lines (826 loc) · 98.2 KB
/
index.xml
File metadata and controls
executable file
·994 lines (826 loc) · 98.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Julian Faraway</title>
<link>https://julianfaraway.github.io/</link>
<atom:link href="https://julianfaraway.github.io/index.xml" rel="self" type="application/rss+xml" />
<description>Julian Faraway</description>
<generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><lastBuildDate>Sat, 01 Jun 2030 13:00:00 +0000</lastBuildDate>
<image>
<url>https://julianfaraway.github.io/images/icon_hu0b7a4cb9992c9ac0e91bd28ffd38dd00_9727_512x512_fill_lanczos_center_3.png</url>
<title>Julian Faraway</title>
<link>https://julianfaraway.github.io/</link>
</image>
<item>
<title>Example Page 1</title>
<link>https://julianfaraway.github.io/courses/example/example1/</link>
<pubDate>Sun, 05 May 2019 00:00:00 +0100</pubDate>
<guid>https://julianfaraway.github.io/courses/example/example1/</guid>
<description><p>In this tutorial, I&rsquo;ll share my top 10 tips for getting started with Academic:</p>
<h2 id="tip-1">Tip 1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis posuere tellus ac convallis placerat. Proin tincidunt magna sed ex sollicitudin condimentum. Sed ac faucibus dolor, scelerisque sollicitudin nisi. Cras purus urna, suscipit quis sapien eu, pulvinar tempor diam. Quisque risus orci, mollis id ante sit amet, gravida egestas nisl. Sed ac tempus magna. Proin in dui enim. Donec condimentum, sem id dapibus fringilla, tellus enim condimentum arcu, nec volutpat est felis vel metus. Vestibulum sit amet erat at nulla eleifend gravida.</p>
<p>Nullam vel molestie justo. Curabitur vitae efficitur leo. In hac habitasse platea dictumst. Sed pulvinar mauris dui, eget varius purus congue ac. Nulla euismod, lorem vel elementum dapibus, nunc justo porta mi, sed tempus est est vel tellus. Nam et enim eleifend, laoreet sem sit amet, elementum sem. Morbi ut leo congue, maximus velit ut, finibus arcu. In et libero cursus, rutrum risus non, molestie leo. Nullam congue quam et volutpat malesuada. Sed risus tortor, pulvinar et dictum nec, sodales non mi. Phasellus lacinia commodo laoreet. Nam mollis, erat in feugiat consectetur, purus eros egestas tellus, in auctor urna odio at nibh. Mauris imperdiet nisi ac magna convallis, at rhoncus ligula cursus.</p>
<p>Cras aliquam rhoncus ipsum, in hendrerit nunc mattis vitae. Duis vitae efficitur metus, ac tempus leo. Cras nec fringilla lacus. Quisque sit amet risus at ipsum pharetra commodo. Sed aliquam mauris at consequat eleifend. Praesent porta, augue sed viverra bibendum, neque ante euismod ante, in vehicula justo lorem ac eros. Suspendisse augue libero, venenatis eget tincidunt ut, malesuada at lorem. Donec vitae bibendum arcu. Aenean maximus nulla non pretium iaculis. Quisque imperdiet, nulla in pulvinar aliquet, velit quam ultrices quam, sit amet fringilla leo sem vel nunc. Mauris in lacinia lacus.</p>
<p>Suspendisse a tincidunt lacus. Curabitur at urna sagittis, dictum ante sit amet, euismod magna. Sed rutrum massa id tortor commodo, vitae elementum turpis tempus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean purus turpis, venenatis a ullamcorper nec, tincidunt et massa. Integer posuere quam rutrum arcu vehicula imperdiet. Mauris ullamcorper quam vitae purus congue, quis euismod magna eleifend. Vestibulum semper vel augue eget tincidunt. Fusce eget justo sodales, dapibus odio eu, ultrices lorem. Duis condimentum lorem id eros commodo, in facilisis mauris scelerisque. Morbi sed auctor leo. Nullam volutpat a lacus quis pharetra. Nulla congue rutrum magna a ornare.</p>
<p>Aliquam in turpis accumsan, malesuada nibh ut, hendrerit justo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Quisque sed erat nec justo posuere suscipit. Donec ut efficitur arcu, in malesuada neque. Nunc dignissim nisl massa, id vulputate nunc pretium nec. Quisque eget urna in risus suscipit ultricies. Pellentesque odio odio, tincidunt in eleifend sed, posuere a diam. Nam gravida nisl convallis semper elementum. Morbi vitae felis faucibus, vulputate orci placerat, aliquet nisi. Aliquam erat volutpat. Maecenas sagittis pulvinar purus, sed porta quam laoreet at.</p>
<h2 id="tip-2">Tip 2</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis posuere tellus ac convallis placerat. Proin tincidunt magna sed ex sollicitudin condimentum. Sed ac faucibus dolor, scelerisque sollicitudin nisi. Cras purus urna, suscipit quis sapien eu, pulvinar tempor diam. Quisque risus orci, mollis id ante sit amet, gravida egestas nisl. Sed ac tempus magna. Proin in dui enim. Donec condimentum, sem id dapibus fringilla, tellus enim condimentum arcu, nec volutpat est felis vel metus. Vestibulum sit amet erat at nulla eleifend gravida.</p>
<p>Nullam vel molestie justo. Curabitur vitae efficitur leo. In hac habitasse platea dictumst. Sed pulvinar mauris dui, eget varius purus congue ac. Nulla euismod, lorem vel elementum dapibus, nunc justo porta mi, sed tempus est est vel tellus. Nam et enim eleifend, laoreet sem sit amet, elementum sem. Morbi ut leo congue, maximus velit ut, finibus arcu. In et libero cursus, rutrum risus non, molestie leo. Nullam congue quam et volutpat malesuada. Sed risus tortor, pulvinar et dictum nec, sodales non mi. Phasellus lacinia commodo laoreet. Nam mollis, erat in feugiat consectetur, purus eros egestas tellus, in auctor urna odio at nibh. Mauris imperdiet nisi ac magna convallis, at rhoncus ligula cursus.</p>
<p>Cras aliquam rhoncus ipsum, in hendrerit nunc mattis vitae. Duis vitae efficitur metus, ac tempus leo. Cras nec fringilla lacus. Quisque sit amet risus at ipsum pharetra commodo. Sed aliquam mauris at consequat eleifend. Praesent porta, augue sed viverra bibendum, neque ante euismod ante, in vehicula justo lorem ac eros. Suspendisse augue libero, venenatis eget tincidunt ut, malesuada at lorem. Donec vitae bibendum arcu. Aenean maximus nulla non pretium iaculis. Quisque imperdiet, nulla in pulvinar aliquet, velit quam ultrices quam, sit amet fringilla leo sem vel nunc. Mauris in lacinia lacus.</p>
<p>Suspendisse a tincidunt lacus. Curabitur at urna sagittis, dictum ante sit amet, euismod magna. Sed rutrum massa id tortor commodo, vitae elementum turpis tempus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean purus turpis, venenatis a ullamcorper nec, tincidunt et massa. Integer posuere quam rutrum arcu vehicula imperdiet. Mauris ullamcorper quam vitae purus congue, quis euismod magna eleifend. Vestibulum semper vel augue eget tincidunt. Fusce eget justo sodales, dapibus odio eu, ultrices lorem. Duis condimentum lorem id eros commodo, in facilisis mauris scelerisque. Morbi sed auctor leo. Nullam volutpat a lacus quis pharetra. Nulla congue rutrum magna a ornare.</p>
<p>Aliquam in turpis accumsan, malesuada nibh ut, hendrerit justo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Quisque sed erat nec justo posuere suscipit. Donec ut efficitur arcu, in malesuada neque. Nunc dignissim nisl massa, id vulputate nunc pretium nec. Quisque eget urna in risus suscipit ultricies. Pellentesque odio odio, tincidunt in eleifend sed, posuere a diam. Nam gravida nisl convallis semper elementum. Morbi vitae felis faucibus, vulputate orci placerat, aliquet nisi. Aliquam erat volutpat. Maecenas sagittis pulvinar purus, sed porta quam laoreet at.</p>
</description>
</item>
<item>
<title>Example Page 2</title>
<link>https://julianfaraway.github.io/courses/example/example2/</link>
<pubDate>Sun, 05 May 2019 00:00:00 +0100</pubDate>
<guid>https://julianfaraway.github.io/courses/example/example2/</guid>
<description><p>Here are some more tips for getting started with Academic:</p>
<h2 id="tip-3">Tip 3</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis posuere tellus ac convallis placerat. Proin tincidunt magna sed ex sollicitudin condimentum. Sed ac faucibus dolor, scelerisque sollicitudin nisi. Cras purus urna, suscipit quis sapien eu, pulvinar tempor diam. Quisque risus orci, mollis id ante sit amet, gravida egestas nisl. Sed ac tempus magna. Proin in dui enim. Donec condimentum, sem id dapibus fringilla, tellus enim condimentum arcu, nec volutpat est felis vel metus. Vestibulum sit amet erat at nulla eleifend gravida.</p>
<p>Nullam vel molestie justo. Curabitur vitae efficitur leo. In hac habitasse platea dictumst. Sed pulvinar mauris dui, eget varius purus congue ac. Nulla euismod, lorem vel elementum dapibus, nunc justo porta mi, sed tempus est est vel tellus. Nam et enim eleifend, laoreet sem sit amet, elementum sem. Morbi ut leo congue, maximus velit ut, finibus arcu. In et libero cursus, rutrum risus non, molestie leo. Nullam congue quam et volutpat malesuada. Sed risus tortor, pulvinar et dictum nec, sodales non mi. Phasellus lacinia commodo laoreet. Nam mollis, erat in feugiat consectetur, purus eros egestas tellus, in auctor urna odio at nibh. Mauris imperdiet nisi ac magna convallis, at rhoncus ligula cursus.</p>
<p>Cras aliquam rhoncus ipsum, in hendrerit nunc mattis vitae. Duis vitae efficitur metus, ac tempus leo. Cras nec fringilla lacus. Quisque sit amet risus at ipsum pharetra commodo. Sed aliquam mauris at consequat eleifend. Praesent porta, augue sed viverra bibendum, neque ante euismod ante, in vehicula justo lorem ac eros. Suspendisse augue libero, venenatis eget tincidunt ut, malesuada at lorem. Donec vitae bibendum arcu. Aenean maximus nulla non pretium iaculis. Quisque imperdiet, nulla in pulvinar aliquet, velit quam ultrices quam, sit amet fringilla leo sem vel nunc. Mauris in lacinia lacus.</p>
<p>Suspendisse a tincidunt lacus. Curabitur at urna sagittis, dictum ante sit amet, euismod magna. Sed rutrum massa id tortor commodo, vitae elementum turpis tempus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean purus turpis, venenatis a ullamcorper nec, tincidunt et massa. Integer posuere quam rutrum arcu vehicula imperdiet. Mauris ullamcorper quam vitae purus congue, quis euismod magna eleifend. Vestibulum semper vel augue eget tincidunt. Fusce eget justo sodales, dapibus odio eu, ultrices lorem. Duis condimentum lorem id eros commodo, in facilisis mauris scelerisque. Morbi sed auctor leo. Nullam volutpat a lacus quis pharetra. Nulla congue rutrum magna a ornare.</p>
<p>Aliquam in turpis accumsan, malesuada nibh ut, hendrerit justo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Quisque sed erat nec justo posuere suscipit. Donec ut efficitur arcu, in malesuada neque. Nunc dignissim nisl massa, id vulputate nunc pretium nec. Quisque eget urna in risus suscipit ultricies. Pellentesque odio odio, tincidunt in eleifend sed, posuere a diam. Nam gravida nisl convallis semper elementum. Morbi vitae felis faucibus, vulputate orci placerat, aliquet nisi. Aliquam erat volutpat. Maecenas sagittis pulvinar purus, sed porta quam laoreet at.</p>
<h2 id="tip-4">Tip 4</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis posuere tellus ac convallis placerat. Proin tincidunt magna sed ex sollicitudin condimentum. Sed ac faucibus dolor, scelerisque sollicitudin nisi. Cras purus urna, suscipit quis sapien eu, pulvinar tempor diam. Quisque risus orci, mollis id ante sit amet, gravida egestas nisl. Sed ac tempus magna. Proin in dui enim. Donec condimentum, sem id dapibus fringilla, tellus enim condimentum arcu, nec volutpat est felis vel metus. Vestibulum sit amet erat at nulla eleifend gravida.</p>
<p>Nullam vel molestie justo. Curabitur vitae efficitur leo. In hac habitasse platea dictumst. Sed pulvinar mauris dui, eget varius purus congue ac. Nulla euismod, lorem vel elementum dapibus, nunc justo porta mi, sed tempus est est vel tellus. Nam et enim eleifend, laoreet sem sit amet, elementum sem. Morbi ut leo congue, maximus velit ut, finibus arcu. In et libero cursus, rutrum risus non, molestie leo. Nullam congue quam et volutpat malesuada. Sed risus tortor, pulvinar et dictum nec, sodales non mi. Phasellus lacinia commodo laoreet. Nam mollis, erat in feugiat consectetur, purus eros egestas tellus, in auctor urna odio at nibh. Mauris imperdiet nisi ac magna convallis, at rhoncus ligula cursus.</p>
<p>Cras aliquam rhoncus ipsum, in hendrerit nunc mattis vitae. Duis vitae efficitur metus, ac tempus leo. Cras nec fringilla lacus. Quisque sit amet risus at ipsum pharetra commodo. Sed aliquam mauris at consequat eleifend. Praesent porta, augue sed viverra bibendum, neque ante euismod ante, in vehicula justo lorem ac eros. Suspendisse augue libero, venenatis eget tincidunt ut, malesuada at lorem. Donec vitae bibendum arcu. Aenean maximus nulla non pretium iaculis. Quisque imperdiet, nulla in pulvinar aliquet, velit quam ultrices quam, sit amet fringilla leo sem vel nunc. Mauris in lacinia lacus.</p>
<p>Suspendisse a tincidunt lacus. Curabitur at urna sagittis, dictum ante sit amet, euismod magna. Sed rutrum massa id tortor commodo, vitae elementum turpis tempus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean purus turpis, venenatis a ullamcorper nec, tincidunt et massa. Integer posuere quam rutrum arcu vehicula imperdiet. Mauris ullamcorper quam vitae purus congue, quis euismod magna eleifend. Vestibulum semper vel augue eget tincidunt. Fusce eget justo sodales, dapibus odio eu, ultrices lorem. Duis condimentum lorem id eros commodo, in facilisis mauris scelerisque. Morbi sed auctor leo. Nullam volutpat a lacus quis pharetra. Nulla congue rutrum magna a ornare.</p>
<p>Aliquam in turpis accumsan, malesuada nibh ut, hendrerit justo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Quisque sed erat nec justo posuere suscipit. Donec ut efficitur arcu, in malesuada neque. Nunc dignissim nisl massa, id vulputate nunc pretium nec. Quisque eget urna in risus suscipit ultricies. Pellentesque odio odio, tincidunt in eleifend sed, posuere a diam. Nam gravida nisl convallis semper elementum. Morbi vitae felis faucibus, vulputate orci placerat, aliquet nisi. Aliquam erat volutpat. Maecenas sagittis pulvinar purus, sed porta quam laoreet at.</p>
</description>
</item>
<item>
<title>Example Talk</title>
<link>https://julianfaraway.github.io/talk/example/</link>
<pubDate>Sat, 01 Jun 2030 13:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/talk/example/</guid>
<description><div class="alert alert-note">
<div>
Click on the <strong>Slides</strong> button above to view the built-in slides feature.
</div>
</div>
<p>Slides can be added in a few ways:</p>
<ul>
<li><strong>Create</strong> slides using Academic&rsquo;s
<a href="https://sourcethemes.com/academic/docs/managing-content/#create-slides" target="_blank" rel="noopener"><em>Slides</em></a> feature and link using <code>slides</code> parameter in the front matter of the talk file</li>
<li><strong>Upload</strong> an existing slide deck to <code>static/</code> and link using <code>url_slides</code> parameter in the front matter of the talk file</li>
<li><strong>Embed</strong> your slides (e.g. Google Slides) or presentation video on this page using
<a href="https://sourcethemes.com/academic/docs/writing-markdown-latex/" target="_blank" rel="noopener">shortcodes</a>.</li>
</ul>
<p>Further talk details can easily be added to this page using <em>Markdown</em> and $\rm \LaTeX$ math code.</p>
</description>
</item>
<item>
<title>Converting from Bookdown to Quarto</title>
<link>https://julianfaraway.github.io/post/converting-from-bookdown-to-quarto/</link>
<pubDate>Wed, 17 Aug 2022 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/converting-from-bookdown-to-quarto/</guid>
<description><p>Two years ago, I
<a href="https://julianfaraway.github.io/post/converting-to-accessible-lecture-notes/" target="_blank" rel="noopener">converted my lecture notes to Bookdown</a>. I have been following the development of
<a href="https://quarto.org/" target="_blank" rel="noopener">Quarto</a> with interest. Although Bookdown is not going away, it does seem that future developments will be based on Quarto. For this reason, I decided to convert my lecture notes to Quarto. Here&rsquo;s my experience.</p>
<p>I installed Quarto. I started with a
<a href="https://www.openscapes.org/blog/2022/07/21/quarto-migrate/" target="_blank" rel="noopener">conversion guide</a> written by
Stefanie Butland and Ileana Fenwick. I renamed by Rmd files to qmd files and moved
some information around in a couple of config files as described in the guide.
Within about 20 minutes, I had the whole book rendered. Great - how easy was that?
Unfortunately, on examining the book, I realised I had more work to do.</p>
<p>The first problem was with the displayed equations. Bookdown could be finicky
about the placement of the delimiting <code>$$</code>&rsquo;s and my labels were all inside the
delimiters. Quarto is more fussy about the layout - you need something like this:</p>
<pre><code>$$
\your \latex \stuff \here
$$ {#eq-yourlabel}
</code></pre>
<p>In particular, you need to have the <code>$$</code>&rsquo;s on a new line.
Fortunately, getting the equations to preview within the editor was a reliable indication that I had done it right - there was no need to keep recompiling to check my work.</p>
<p>The second problem was the cross referencing. Previously, for a figure, you would have the label in the <code>{r myfig}</code> chunk and refer to it as <code>Figure \@ref(fig:myfig)</code> but this becomes:</p>
<pre><code class="language-{verbatim}">```{r}
#| label: fig-myfig
plot(x,y)
```
</code></pre>
<p>and is referred to as <code>@fig-myfig</code> which will render as something like <code>Figure 5.1</code> so you&rsquo;ll need to delete the extra &ldquo;Figure &quot; from your text. You will need to change the equation, table, section etc. crossreferences also.</p>
<p>The third problem required me to reformat some R chunks. As seen above, the desired format for the option in R chunks has changed to have these each listed on a seperate line, prefixed with a <code>#|</code>. This does make sense and the old format still works - sometimes. But if you have some figures with multiple plots or other features, you will have to convert. The new multicolumn setup is nice but you will need to do some editing.</p>
<p>Previously, Bookdown allowed you to load some R code before running each chapter using <code>before_chapter_script:</code> but I could not get this to work in Quarto. I had to put this in the <code>.Rprofile</code> to get this working (I tend to avoid using .Rprofile for reproducibility reasons).</p>
<p>Someone with better scripting skills than me could write a conversion script to deal with many of these problems (although some hand-editing would still be necessary). I don&rsquo;t think anyone has done this yet.</p>
<p>Although it took a bit more work than I had initially thought, I am pleased with the result. The design of Quarto is better than Bookdown and it already has some nice features that I want to try. I am also looking forward to a more consistent syntax across the other R markdown documents such as presentations, websites and scripts that I commonly use.</p>
</description>
</item>
<item>
<title>Challenges in realising the potential of wastewater-based epidemiology to quantitatively monitor and predict the spread of disease</title>
<link>https://julianfaraway.github.io/publication/challengeswbe/</link>
<pubDate>Sat, 11 Jun 2022 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/publication/challengeswbe/</guid>
<description></description>
</item>
<item>
<title>Wastewater Monitoring</title>
<link>https://julianfaraway.github.io/project/wastewater/</link>
<pubDate>Mon, 21 Dec 2020 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/project/wastewater/</guid>
<description><p>I am working with
<a href="https://researchportal.bath.ac.uk/en/persons/barbara-kasprzyk-hordern" target="_blank" rel="noopener">Barbara Kasprzyk-Hordern</a>
[on building an Early Warning System for community-wide infectious disease spread](UKRI GCRF/Newton Fund : Building an Early Warning System for community-wide infectious disease spread: SARS-CoV-2 tracking in Africa via environment fingerprinting- COVID-19). I am also involved in
<a href="https://gtr.ukri.org/projects?ref=EP%2FT029986%2F1" target="_blank" rel="noopener">EDGE</a> which is
environment fingerprinting via digital technology - a new paradigm in hazard forecasting and early-warning systems for health risks in Africa.</p>
</description>
</item>
<item>
<title>Extending the Linear Model with R</title>
<link>https://julianfaraway.github.io/book/glmm/</link>
<pubDate>Tue, 15 Dec 2020 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/book/glmm/</guid>
<description></description>
</item>
<item>
<title>Linear Models with Python</title>
<link>https://julianfaraway.github.io/book/lmp/</link>
<pubDate>Tue, 15 Dec 2020 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/book/lmp/</guid>
<description></description>
</item>
<item>
<title>Linear Models with R</title>
<link>https://julianfaraway.github.io/book/lmr/</link>
<pubDate>Tue, 15 Dec 2020 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/book/lmr/</guid>
<description></description>
</item>
<item>
<title>Statistics training in Mongolia</title>
<link>https://julianfaraway.github.io/project/mongolia/</link>
<pubDate>Tue, 15 Dec 2020 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/project/mongolia/</guid>
<description><p>I have a
<a href="https://gow.epsrc.ukri.org/NGBOViewGrant.aspx?GrantRef=EP/T003707/1" target="_blank" rel="noopener">EPSRC GCRF grant</a>
for statistics training in Mongolia. We have a particular interest in the effects of air pollution
on health. We delivered a
<a href="https://www.bath.ac.uk/announcements/delivering-training-for-data-informed-policy-in-ulaanbaatar/" target="_blank" rel="noopener">workshop in Ulaanbaatar</a> in May 2019. You can see the
<a href="https://people.bath.ac.uk/td314/data_sprint.html" target="_blank" rel="noopener">training materials</a>
and read more in the
<a href="https://t.co/Jh2uIIUVWR?amp=1" target="_blank" rel="noopener">report</a>. I have been working
with
<a href="https://people.bath.ac.uk/ak257" target="_blank" rel="noopener">Andreas Kyprianou</a> who has
<a href="https://people.bath.ac.uk/ak257/#Mongolia" target="_blank" rel="noopener">longstanding connections</a> to
Mongolia.</p>
</description>
</item>
<item>
<title>A more moderate view of Excel</title>
<link>https://julianfaraway.github.io/post/a-more-moderate-view-of-excel/</link>
<pubDate>Tue, 06 Oct 2020 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/a-more-moderate-view-of-excel/</guid>
<description><p>When I heard that the UK government had lost 16,000 covid-19 cases meaning that the contacts of infected persons were not traced and informed, I got angry. The problem was attributed to an Excel &ldquo;glitch&rdquo; so I posted a rather
caustic
<a href="https://twitter.com/JulianFaraway/status/1313055455829254145" target="_blank" rel="noopener">tweet</a> about how Excel should not be used for data analysis. Twitter is a quickfire medium and not the place for nuance. Here&rsquo;s my more moderate view on the matter:</p>
<p>In a long career, I&rsquo;ve spent a lot of time cleaning data delivered to me in Excel format. Although it is possible to maintain data cleanly in Excel, this is often not the case. It often takes a lot of time and frustration to restore the data into a form suitable for statistical analysis. Although one could blame the producers of the data, Excel gives them more than enough freedom to mess things up. In particular, there&rsquo;s no clear boundary in Excel between data and analysis - it&rsquo;s all mixed together in a single spreadsheet. It&rsquo;s this experience that makes me angry when I hear about Excel data &ldquo;glitches&rdquo;. Please use almost any other format.</p>
<p>Excel is installed on a large proportion of computers and a very large number of people have some experience of using it. It is very versatile software. It&rsquo;s like a swiss army knife, performing a wide range of tasks, often in adequate manner without excelling (hah!) at any particular task. It&rsquo;s been so successful because it so useful. Unfortunately, people sometimes fail to recognise when Excel is not the right tool. They are familiar with Excel and are either unaware of or unwilling to learn a more appropriate software tool.</p>
<p>My tweet about the missing covid cases was inaccurate. I said that Excel is not good for (statistical) data analysis when I should have said that Excel is not good for database management. Both are true but in this instance, the error was caused by using Excel in the data handling pipeline. This was a database problem, not a statistics problem.</p>
<p>It&rsquo;s all too easy to point the finger at people making errors - how could you be so stupid? etc. But all of us make errors because we are human. Our defence against these errors is using systems that are designed to catch errors. In the missing covid cases example, Excel could have been used successfully. Some people might say that the users and not Excel were at fault. But this is the principal weakness of Excel in comparison to purpose-built statistical software or database management software. These latter software systems make it much easier to build in the error checking, the auditing and the reproducibility that are essential for the minimisation of human error.</p>
</description>
</item>
<item>
<title>Converting to Accessible Lecture Notes</title>
<link>https://julianfaraway.github.io/post/converting-to-accessible-lecture-notes/</link>
<pubDate>Tue, 01 Sep 2020 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/converting-to-accessible-lecture-notes/</guid>
<description><h2 id="why-do-this">Why do this?</h2>
<p>In 2018, the UK government passed the
<a href="https://www.legislation.gov.uk/uksi/2018/852/made" target="_blank" rel="noopener">The Public Sector Bodies (Websites and Mobile Applications) Accessibility Regulations</a> which requires Universities (among others) to provide
all website information in an &ldquo;accessible&rdquo; format. The UK government has provided a more
<a href="https://www.gov.uk/guidance/accessibility-requirements-for-public-sector-websites-and-apps" target="_blank" rel="noopener">detailed set of recommendations</a> on how
to meet these requirements. From the mathematical perspective, you can find a
<a href="https://www.homepages.ucl.ac.uk/~ucahmto/elearning/latex/2019/05/06/accessibility-regulations.html" target="_blank" rel="noopener">discussion of the requirements</a> by
Matthew Towers of UCL.</p>
<p>In our case, the primary beneficiaries are people with impaired vision but does include other categories of disability. In the past, we were able to meet the requirements of prior equalities legislation by providing alternative formats to affected students. This might be as simple as producing large print versions but sometimes needed more unusual formats. I was able to send my LaTeX source to a specialist who produced the required formats on a case-by-case basis depending on the students in the class. But under the new legislation, this is no longer acceptable and the primary version of my online materials must be accessible. Since some of these materials are created during the teaching period, I need to be able to create them myself.</p>
<p>The main problem for anyone teaching a mathematical subject is that the primary medium for materials is LaTeX compiled to a PDF. Despite some efforts to make LaTeX-&gt;PDF accessible, it falls far short of the legal requirements. The main advantage of a webpage or an e-reader is that the fonts can be resized or changed and the page can be resized with the text being reflowed to fit. You cannot do this with a PDF. The main challenge is to convert to a format that allows this resizing and reflowing. There are other requirements for accessibility such as alternate text for images but we&rsquo;ll focus on the resizing and reflowing problem.</p>
<h2 id="bookdown">Bookdown</h2>
<p>A big step towards the solution is to use Bookdown. You can find numerous examples at
<a href="https://bookdown.org/" target="_blank" rel="noopener">bookdown.org</a>. In particular,
<a href="https://bookdown.org/yihui/bookdown/" target="_blank" rel="noopener">bookdown: Authoring Books and Technical Documents with R Markdown</a> is very helpful. The books shown on bookdown.org display nicely on webpages but also can be printed in a relatively standard and compact format. If you have never used <code>R</code> and do not want to use <code>R</code>, don&rsquo;t worry, you don&rsquo;t need to. You can use bookdown without any Statistics or R - here&rsquo;s an
<a href="https://www.homepages.ucl.ac.uk/~ucahmto/elearning/2019/09/14/bookdown.html" target="_blank" rel="noopener">example</a> of some algebra lecture notes. It certainly helps if you are familiar with markdown but it should not provide much challenge to anyone who has tackled LaTeX.</p>
<h2 id="conversion-process">Conversion Process</h2>
<p>I won&rsquo;t attempt to provide a step-by-step guide here. Start with the first two chapters of the
<a href="https://bookdown.org/yihui/bookdown/" target="_blank" rel="noopener">bookdown book</a> to get going. It would be a lot easier to write the bookdown lecture
notes directly but you may have a large amount of existing material that needs to be converted from LaTeX. Some of
this will be documents of a few pages such as exercise sheets and solutions. You don&rsquo;t need bookdown for these (we&rsquo;ll discuss these later). Bookdown is best for a longer document with multiple sections or chapters.</p>
<ol>
<li>
<p>You don&rsquo;t need to use Rstudio but it does have some useful features. In particular, making a new
bookdown project is nice because it creates all the necessary setup files. It also has a nice previewer. But Rstudio was not built for editing LaTeX and I missed all my usual keyboard shortcuts.</p>
</li>
<li>
<p>
<a href="https://www.mathjax.org/" target="_blank" rel="noopener">Mathjax</a> takes care of creating all the mathematical equations, both displayed and inline. It&rsquo;s important to understand this is not done using the usual LaTeX compilation process. I had a lot of LaTeX macros from my predecessor throughout the lecture notes. Mathjax didn&rsquo;t understand these and I had to replace them with standard LaTeX. Mathjax only understands a limited set of LaTeX packages. For example, it does not have <em>boldmath</em> but did have <em>boldsymbol</em> so I needed to make some translations.</p>
</li>
<li>
<p>
<a href="https://pandoc.org/" target="_blank" rel="noopener">Pandoc</a> is wonderful. It will be installed as part of the bookdown installation process. It does an excellent job of converting your LaTeX into markdown. But it fails on the referencing and citation system used by bookdown. I had to fix all these manually.</p>
</li>
<li>
<p>The
<a href="https://yihui.org/knitr/" target="_blank" rel="noopener">knitr</a> engine is usually used for processing R code chunks but I was delighted to find that it also handles
<a href="https://en.wikipedia.org/wiki/PGF/TikZ" target="_blank" rel="noopener">Tikz</a>.</p>
</li>
<li>
<p>Although you can use bookdown for short LaTeX documents, it&rsquo;s easier to use R markdown (on which bookdown is based). Suppose you have <em>exercise.tex</em>, convert this to markdown with:</p>
</li>
</ol>
<pre><code>pandoc -o exercise.md exercise.tex
</code></pre>
<p>You may need to fix up the markdown. Add a YAML such as:</p>
<pre><code>---
title: &quot;Exercise One&quot;
author: &quot;Julian Faraway&quot;
date: &quot;01/09/2020&quot;
output: html_document
---
</code></pre>
<p>Change the name to <em>exercise.Rmd</em> and convert to HTML with:</p>
<pre><code>Rscript -e &quot;rmarkdown::render('exercise.Rmd')&quot;
</code></pre>
<ol start="6">
<li>You can produce PDF output from the same source. Let&rsquo;s suppose this is for students who want to print out some hard copy. As a rule, they will want a compact format so that there are less pages to print. I put</li>
</ol>
<pre><code>documentclass: article
geometry: &quot;margin=1.5cm,nohead&quot;
fontsize: 10pt
</code></pre>
<p>in the YAML header of <code>index.Rmd</code>. Even so, the output was about 15% longer than the original PDF version. I could cut that down a bit with further fiddling but I don&rsquo;t want to be messing with LaTeX floats. You can also create an epub version for e-readers although I&rsquo;m not sure Kindles and the like can cope with Mathjax. R Markdown can also be output in Microsoft Word format which many mathematicians would regard as the ultimate sacrilege.</p>
<ol start="7">
<li>I have yet to find a convenient way to add alternative text to images using bookdown. The alt-text is confounded with the fig-cap but these should be two different texts. I am also unsure what alt-text is best for something like a scatterplot.</li>
</ol>
<h2 id="conclusion">Conclusion</h2>
<p>It took some effort to understand how bookdown works and make the conversion. In the future, writing documents in markdown with embeded LaTeX maths will be no more difficult than creating a full LaTeX document. Given the markdown is simpler than LaTeX, I expect it will be easier. It also allows some more interesting possibilities.</p>
<p>I was pleased with resulting bookdown lecture notes. They are easier to read on screen than a PDF given the flexibility in resizing and reflowing the content. Although I used to provide students with printed lecture notes, I noticed that many used the online PDF version in preference. Although the conversion was motivated by the need to satisfy accessibility legislation, I think the result will benefit all students. Now that more instruction is online, the primary version of the materials should be the web version rather than the hard copy version.</p>
</description>
</item>
<item>
<title>Bayesian Regression Modeling with INLA</title>
<link>https://julianfaraway.github.io/book/brinla/</link>
<pubDate>Fri, 28 Aug 2020 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/book/brinla/</guid>
<description></description>
</item>
<item>
<title>An Alternative to the OFQUAL algorithm</title>
<link>https://julianfaraway.github.io/post/an-alternative-to-the-ofqual-algorithm/</link>
<pubDate>Wed, 19 Aug 2020 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/an-alternative-to-the-ofqual-algorithm/</guid>
<description><p>As anyone in the UK knows, A-level exams, taken at age 18 and mostly used to determined admission to university were cancelled this year due to the pandemic. The UK government asked OFQUAL (a semi-independent government body) to determine the A-level grades. OFQUAL developed an algorithm based on past school performance and teacher rankings of students explained here. When these results were released there was an uproar because large numbers of students did not receive the grades they were expecting and rejected from their chosen universities. After days of pressure the UK government backtracked on these predicted results and also allowed teacher predicted grades. For many universities, this has resulted in more students having qualified to enter than they can accommodate. Hence chaos.</p>
<p>Naturally statisticians were very interested in this algorithm. Back at the beginning of the process, the Royal Statistical Society had volunteered professorial help in constructing the algorithm. But OFQUAL insisted on a highly restrictive NDA to which the RSS declined to agree. After details of the algorithm emerged, Guy Nason described several deficiencies in the algorithm. The algorithm had some biases that favoured small independent schools (that usually have wealthier students) and tended to mark down larger state schools (that usually have less privileged students). My colleague in Computer Science at Bath, Tom Haines, describes other problems with the construction of the algorithm (although I do take umbrage at him blaming statisticians for this! – we did try to help)</p>
<p>Statisticians have suggested improvements to the algorithm that would avoid some of the bias problems but given the information available, students would still have been upset at the result. Given that the school of the student was one of the few useful predictors available, one could not avoid using this information and yet the very fact that this was done was found highly objectionable by many. Why should the school you attend determine your university outcome? Furthermore, due to a natural phenomenom known as “regression to the mean”, predictions for students who had good reasons to expect to do well will be shifted downwards. Even had OFQUAL taken more professional advice, many students would still have been angry about the results and the media uproar would have been much the same.</p>
<p>I propose that an entirely different approach should have been used. Few really care what A-level grades they get – they care which university will accept them. We can issue a pandemic certificate of completion for the A-levels and deal with the university admission problem directly. Here’s my proposal:</p>
<ol>
<li>Wait until all universities have made their offers and students have made their firm (first) choice and insurance (second) choice.</li>
<li>Oxbridge is at the top of the tree and (as usual) pick first. They randomly choose students from among those they have accepted. They would want to control numbers on different courses and in different colleges but they must make a random selection. They pass on their rejected students to the next tier of universities.</li>
<li>As in a normal year, the next tier of universities would wait until they receive their insurance students from Oxbridge. This year they will accept all the insurance students and randomly fill their remaining places with students who held them as first choice. They pass on their rejected students to the next tier as in a normal year.</li>
<li>The process repeats until all students have been (randomly) allocated. The sequence of universities in the decision process is determined by the entry tariff for the given subject as would happen in a normal year. The only differences are that the selection is random and all insurance students are accepted.</li>
</ol>
<p>Now there would be need to be some modifications occasionally if capacity constraints are hit or for other uncommon circumstances. Given that there is about enough capacity in the university system as a whole for all students, my proposed algorithm would ensure that most students receive their first or second choice of university. Now doubtless there would be some sad face photos of students whose hopes and dreams have been crushed by not going to their first choice of university and having to suffer through the horrors of their second choice. But the important difference is that their misfortune will be just that – bad luck and cannot be attributed to some perceived bias against them. You can’t get angry at bad luck.</p>
<p>Efficiency is the other consideration as we want to allocate students to universities commensurate with their ability. Under my scheme, students chose universities where they believed they could gain admission and universities had accepted them. Given we have no A-level exam information, this is the best we can do.</p>
<p>Unfortunately, it’s too late to execute this scheme as it would be politically unacceptable that already accepted students could now be rejected.</p>
</description>
</item>
<item>
<title>Experience from running R workshops in developing countries</title>
<link>https://julianfaraway.github.io/post/experience-from-running-r-workshops-in-developing-countries/</link>
<pubDate>Tue, 19 May 2020 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/experience-from-running-r-workshops-in-developing-countries/</guid>
<description><p>Having run a couple of workshops introducing R in developing countries, I offer four pieces of advice:</p>
<ol>
<li>Don’t rely on the internet. The internet reaches everywhere but what may be adequate for light use by a single user quickly crumbles when large numbers try to make downloads simultaneously. We anticipated this would be a problem and came equipped with R and Rstudio on many cheap memory sticks but this is not sufficient. For example, try installing the Tidyverse and knitting an R markdown document. You will find this requires installing several packages with multiple dependencies. You’ve probably forgotten the multiple packages, pieces of software and configurations you did to make things work on your own machine. It was all so easy when you had a good internet connection. Find an old laptop with a fresh OS install and disconnect it from the internet. Discover what it takes to get it running on your R teaching materials and then you’ll be prepared. Purchase a local data SIM for that country so you can create a local WiFi hotspot. At least you’ll have a chance to access the internet in case of need (quite likely!). Also plan on a period of chaos at the beginning of the workshop to take care of the many install problems.</li>
<li>Tidyverse. R is difficult, particularly for users only familiar with GUI-based statistics software. A tidyverse-only approach greatly simplifies the range of syntax and commands that the workshop participants will need to understand. You can create exercises that they can successfully complete. The tidyverse is sufficiently powerful that you can perform a wide range of practically useful tasks. The participants will gain a feeling of accomplishment and some ability to use R for their own work. Soon enough they will also need to learn to use base R. But if you start with base R, the entry cost is much higher and some of your students will not make it.</li>
<li>Simplicity. This comes in two forms. Firstly, in countries where English is not the native language, you will find that most professional people (who are attending your workshop) know at least some English but that does not mean all of them are entirely fluent. In your presentation, speak slowly and enunciate your words clearly. Avoid colloquial expressions and figures of speech. Do not use complex words. As a native speaker of English, you will find this difficult. Use written documentation to supplement your spoken presentation. Consider using a translator. Secondly, consider simplicity in your R presentation. It is tempting to include some cool R tricks but beginners won’t enjoy this. Stick to the basics and reduce complexity where possible.</li>
<li>Local Data. All too many expositions of R use overworn example datasets such as mtcars. Find some datasets from the country of the workshop. The participants will find this far more interesting and will suggest different ways to analyze the data. This will demonstrate how R can be used to turn data into knowledge.</li>
</ol>
</description>
</item>
<item>
<title>Government Statistics in Paraguay</title>
<link>https://julianfaraway.github.io/project/paraguay/</link>
<pubDate>Sun, 15 Dec 2019 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/project/paraguay/</guid>
<description><p>We visited in Asuncion in 2018 to
<a href="https://blogs.bath.ac.uk/samba/2018/09/27/samba-visits-paraguay-after-itt8/" target="_blank" rel="noopener">deliver a statistics workshop</a>.
We visited again in 2019 to
<a href="https://www.abc.com.py/edicion-impresa/locales/2019/09/22/cooperacion-de-universidad-britanica/" target="_blank" rel="noopener">plan further collaboration</a>.
We are working with
<a href="https://desarrollo.edu.py/en/home/" target="_blank" rel="noopener">Instituto Desarrollo</a> with support from
the
<a href="https://desarrollo.edu.py/en/world-bank/" target="_blank" rel="noopener">World Bank</a> on a project to iqmprove the quality of production and use of administrative records for evidence-based policy formulation to support the following Sustainable Development Goals.</p>
</description>
</item>
<item>
<title>Attribution of long-term changes in peak river flows in Great Britain</title>
<link>https://julianfaraway.github.io/publication/peak-river-flows/</link>
<pubDate>Tue, 25 Jun 2019 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/publication/peak-river-flows/</guid>
<description></description>
</item>
<item>
<title>Slides</title>
<link>https://julianfaraway.github.io/slides/example/</link>
<pubDate>Tue, 05 Feb 2019 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/slides/example/</guid>
<description><h1 id="create-slides-in-markdown-with-academic">Create slides in Markdown with Academic</h1>
<p>
<a href="https://sourcethemes.com/academic/" target="_blank" rel="noopener">Academic</a> |
<a href="https://sourcethemes.com/academic/docs/managing-content/#create-slides" target="_blank" rel="noopener">Documentation</a></p>
<hr>
<h2 id="features">Features</h2>
<ul>
<li>Efficiently write slides in Markdown</li>
<li>3-in-1: Create, Present, and Publish your slides</li>
<li>Supports speaker notes</li>
<li>Mobile friendly slides</li>
</ul>
<hr>
<h2 id="controls">Controls</h2>
<ul>
<li>Next: <code>Right Arrow</code> or <code>Space</code></li>
<li>Previous: <code>Left Arrow</code></li>
<li>Start: <code>Home</code></li>
<li>Finish: <code>End</code></li>
<li>Overview: <code>Esc</code></li>
<li>Speaker notes: <code>S</code></li>
<li>Fullscreen: <code>F</code></li>
<li>Zoom: <code>Alt + Click</code></li>
<li>
<a href="https://github.com/hakimel/reveal.js#pdf-export" target="_blank" rel="noopener">PDF Export</a>: <code>E</code></li>
</ul>
<hr>
<h2 id="code-highlighting">Code Highlighting</h2>
<p>Inline code: <code>variable</code></p>
<p>Code block:</p>
<pre><code class="language-python">porridge = &quot;blueberry&quot;
if porridge == &quot;blueberry&quot;:
print(&quot;Eating...&quot;)
</code></pre>
<hr>
<h2 id="math">Math</h2>
<p>In-line math: $x + y = z$</p>
<p>Block math:</p>
<p>$$
f\left( x \right) = ;\frac{{2\left( {x + 4} \right)\left( {x - 4} \right)}}{{\left( {x + 4} \right)\left( {x + 1} \right)}}
$$</p>
<hr>
<h2 id="fragments">Fragments</h2>
<p>Make content appear incrementally</p>
<pre><code>{{% fragment %}} One {{% /fragment %}}
{{% fragment %}} **Two** {{% /fragment %}}
{{% fragment %}} Three {{% /fragment %}}
</code></pre>
<p>Press <code>Space</code> to play!</p>
<span class="fragment " >
One
</span>
<span class="fragment " >
**Two**
</span>
<span class="fragment " >
Three
</span>
<hr>
<p>A fragment can accept two optional parameters:</p>
<ul>
<li><code>class</code>: use a custom style (requires definition in custom CSS)</li>
<li><code>weight</code>: sets the order in which a fragment appears</li>
</ul>
<hr>
<h2 id="speaker-notes">Speaker Notes</h2>
<p>Add speaker notes to your presentation</p>
<pre><code class="language-markdown">{{% speaker_note %}}
- Only the speaker can read these notes
- Press `S` key to view
{{% /speaker_note %}}
</code></pre>
<p>Press the <code>S</code> key to view the speaker notes!</p>
<aside class="notes">
<ul>
<li>Only the speaker can read these notes</li>
<li>Press <code>S</code> key to view</li>
</ul>
</aside>
<hr>
<h2 id="themes">Themes</h2>
<ul>
<li>black: Black background, white text, blue links (default)</li>
<li>white: White background, black text, blue links</li>
<li>league: Gray background, white text, blue links</li>
<li>beige: Beige background, dark text, brown links</li>
<li>sky: Blue background, thin dark text, blue links</li>
</ul>
<hr>
<ul>
<li>night: Black background, thick white text, orange links</li>
<li>serif: Cappuccino background, gray text, brown links</li>
<li>simple: White background, black text, blue links</li>
<li>solarized: Cream-colored background, dark green text, blue links</li>
</ul>
<hr>
<section data-noprocess data-shortcode-slide
data-background-image="/media/boards.jpg"
>
<h2 id="custom-slide">Custom Slide</h2>
<p>Customize the slide style and background</p>
<pre><code class="language-markdown">{{&lt; slide background-image=&quot;/media/boards.jpg&quot; &gt;}}
{{&lt; slide background-color=&quot;#0000FF&quot; &gt;}}
{{&lt; slide class=&quot;my-style&quot; &gt;}}
</code></pre>
<hr>
<h2 id="custom-css-example">Custom CSS Example</h2>
<p>Let&rsquo;s make headers navy colored.</p>
<p>Create <code>assets/css/reveal_custom.css</code> with:</p>
<pre><code class="language-css">.reveal section h1,
.reveal section h2,
.reveal section h3 {
color: navy;
}
</code></pre>
<hr>
<h1 id="questions">Questions?</h1>
<p>
<a href="https://spectrum.chat/academic" target="_blank" rel="noopener">Ask</a></p>
<p>
<a href="https://sourcethemes.com/academic/docs/managing-content/#create-slides" target="_blank" rel="noopener">Documentation</a></p>
</description>
</item>
<item>
<title>Anxiety and Depression</title>
<link>https://julianfaraway.github.io/project/depression/</link>
<pubDate>Sat, 22 Dec 2018 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/project/depression/</guid>
<description><p>Depression and anxiety are set to be leading causes of disability in high income countries by 2030, and currently cost the UK economy £9 billion a year. Improving access to psychological therapies (IAPT) is a national programme aimed at reducing this disability burden by increasing the availability of ‘talking therapies’ on the NHS. I am
working with
<a href="https://researchportal.bath.ac.uk/en/persons/katherine-button" target="_blank" rel="noopener">Kate Button</a> and
PhD student, Clarissa Bauer-Staub on a project to improve the allocation of psychological treaments
for depression. We are working with Bath company,
<a href="https://mayden.co.uk/" target="_blank" rel="noopener">Mayden</a>. See our
<a href="https://www.medrxiv.org/content/10.1101/2020.08.15.20175562v2" target="_blank" rel="noopener">preprint</a> on the effects of Covid-19 on
IAPT.</p>
</description>
</item>
<item>
<title>Statistial Analysis of Facial Motion</title>
<link>https://julianfaraway.github.io/project/facial/</link>
<pubDate>Fri, 21 Dec 2018 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/project/facial/</guid>
<description><p>I am working with
<a href="https://facultyprofiles.tufts.edu/carrollann-trotman" target="_blank" rel="noopener">Carroll-Ann Trotman</a>.
We use
<a href="https://dental.tufts.edu/research/faculty-research/facial-animation-laboratory" target="_blank" rel="noopener">facial motion capture</a>
to model patients with cleft lip/palate or facial paralysis. Here is a
<a href="https://people.bath.ac.uk/jjf23/face/" target="_blank" rel="noopener">list of my publications</a> in this area.</p>
</description>
</item>
<item>
<title> Linear Models with R translated to Python</title>
<link>https://julianfaraway.github.io/post/linear-models-with-r-translated-to-python/</link>
<pubDate>Fri, 27 Apr 2018 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/linear-models-with-r-translated-to-python/</guid>
<description><p>I have translated the R code in
<a href="https://julianfaraway.github.io/faraway/LMR/" target="_blank" rel="noopener">Linear Models with R</a> into Python. The code is available as
<a href="https://julianfaraway.github.io/faraway/LMR/python/" target="_blank" rel="noopener">Jupyter Notebooks</a>.</p>
<p>I was able to translate most of the content into Python. Sometimes the output is similar but not the same. Python has far less statistics functionality than R but it seems most of the functionality in base R can be found in Python. R now has over 10,000 packages. Python has about ten times as many but most of these are unrelated to Statistics. My book does not depend heavily on additional packages so this was not so much of an obstacle for me. In a few cases, I rely on R packages that do not exist in Python. Doubtless a Python equivalent could be created but that will take some effort.</p>
<p>After this experience, I can say that R is a better choice for Statistics than Python. Nevertheless, there are good reasons why one might choose to do Statistics with Python. One obvious reason is that if you already know Python, you will be reluctant to also learn R. In the UK, Python is now being taught in schools and we will soon have a wave of students who will come to university knowing Python. Python usage is also more common in several areas such as Computer Science and Engineering. Another reason to use Python is the huge range of packages ranging from text, image and signal processing to machine learning and optimisation. These go far beyond what can found in R. The Python userbase is much larger than R and this has translated into greater functionality as a programming language.</p>
<p>I started using S in 1984 and moved onto R when it was first released. It’s hard to move from 34 years of experience of R to no prior experience with Python. Here are a few impressions that may help other R users who start learning Python:</p>
<p>1.Base R is quite functional without loading any packages. In Python, you will always need to load some packages even to do some basic computations. You will probably need to load numpy, scipy, pandas, statsmodels, matplotlib just to get something similar to the base R environment.
2. Python is very fussy about namespaces. You will find yourself have to prefix every loaded function. For example, you cannot write <code>log(x)</code> — you’ll need to write <code>np.log(x)</code> indicating that log comes from the numpy package. I understand the reason for this but this alone makes Python code longer than R code.
3. Python array indices start from zero. Again, I know why this is but it’s something the R user has to continually adjust to.
4. matplotlib is the Python equivalent of the R base plotting functionality. It does more than R but a range of options is daunting for the new user. I had a better time with seaborn which is more like ggplot is producing attractive plots. (There’s a partial translation of ggplot into Python but I preferred seaborn).
5. statsmodels provides the linear modelling functionality found in R but you will find some differences that will trip you up. In particular, no intercept term is included by default and the handling of saturated models is different, as the Moore-Penrose inverse is used rather than dropping some offending columns as R does. The output from the linear model is far too verbose for my tastes. Of course, you can work around all these issues.
6. Python uses pipes very commonly. It helps if you have already started using these in R via the <code>%&gt;%</code> operator to get you into that frame of mind.</p>
<p>New users inevitably encounter some frustrations but did find Python enjoyable. I have nightmares about having to do Statistics in Excel but Python world is a pleasant land even if it is still a bit unfamiliar to me.</p>
</description>
</item>
<item>
<title>When small data beats big data</title>
<link>https://julianfaraway.github.io/post/when-small-data-beats-big-data/</link>
<pubDate>Thu, 29 Mar 2018 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/when-small-data-beats-big-data/</guid>
<description><p>More data is always better? No - not always. Nicole Augustin and I have published a paper entitled
<a href="https://julianfaraway.github.io/publication/smalldata/" target="_blank" rel="noopener">When Small Data beats Big Data</a>. The main points are:</p>
<ol>
<li><strong>Quality beats quantity</strong>. A high quality small dataset is often more informative than a biased larger dataset. Performance is a tradeoff between bias and variance. As the sample size increases, the variance decreases but the bias remains. You don&rsquo;t need a huge amount of data to achieve an acceptably small variance so that small dataset with no bias due to careful sampling or a controlled experiment will beat the big garbage dump of a dataset. David beats Goliath with a well-aimed shot.</li>
<li><strong>Cost</strong>. There is no free lunch. More data costs money - what did you think those power studies were for? But it&rsquo;s not just the acquisition costs of data. Some procedures are computationally expensive and the cost increases at a faster than linear rate with data size. If you need your results now, you might do better with less data. Other costs of data are not financial. People value privacy - we should assign a cost to invading that privacy. We should avoid using more data than necessary to protect privacy.</li>
<li><strong>Inference works better on small data</strong>. Statisticians have spent years developing methods for inference on relatively small datasets. Unfortunately, most of these methods don&rsquo;t work well with big data because the inference becomes unbelievably sharp. The reason for this is that most statistical methods do not allow for model uncertainty or unknown sampling biases. Machine learners do no better as their methods often fail to tackle the uncertainty problem at all. Until we learn how to express uncertainty in big data models, we might be better off sticking with small data.</li>
<li><strong>Aggregation</strong>. Sometimes we have the option of reducing a big individual level dataset to a smaller grouped dataset. Information may be lost by this aggregation but sometimes it can be beneficial. It reduces variation, needs simpler models and reduces privacy concerns.</li>
<li><strong>Teaching</strong>. Students now need to learn about big and small data methods. But where to start? Small data is easier to work with. It&rsquo;s much simpler for students to understand both the principles and details of the computation without the technical overhead of big data. Students will need to learn big data methods sooner rather than later but it&rsquo;s best to come into this with a good understanding of the ideas of uncertainty.</li>
</ol>
</description>
</item>
<item>
<title>When small data beats big data</title>
<link>https://julianfaraway.github.io/publication/smalldata/</link>
<pubDate>Thu, 29 Mar 2018 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/publication/smalldata/</guid>
<description></description>
</item>
<item>
<title>Statisticians do not improve sports</title>
<link>https://julianfaraway.github.io/post/statisticians-do-not-improve-sports/</link>
<pubDate>Fri, 17 Nov 2017 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/statisticians-do-not-improve-sports/</guid>
<description><p>There’s always been statistics in sports. People have kept records of achievements such as the most goals in a season or home runs in a career for many years. These statistics add extra flavour to the mere winning and losing of games and championships. I’ve no complaint about such descriptive statistics. My objection is to the use of more advanced statistical methods to improve the chances of a team to win games. The book, and later the movie, Moneyball, was about recruiting underrated players and changing the strategy of a baseball team to win more games. The underlying methods are statistical and have been very successful. The ideas have been developed and spread throughout the sporting world. Many regard this as a success story for statistics but I beg to differ.</p>
<p>I understand the attraction. As a graduate student in Berkeley, I came across Bill James’ Baseball Abstract and was fascinated. James was not a professional statistician but he was great at assembling the right data to answer a question and backing up his claims with sensible statistical summaries. This was a model for how applied statistics should be done. Nonetheless, I realised that Baseball would not take much notice of a nerdy guy and so it proved for many years until Moneyball. So I’m not one of those people who object to sports sessions at Statistics conferences because sports is a trivial matter (as they feel) that does not deserve such attention at a serious conference.</p>
<p>We all like to feel that our work is improving the world in some way such as improving medical procedures or building more reliable products. American football coach, Vince Lombardi said “Winning isn’t everything, it’s the only thing.” so you might think the purpose of professional sports is winning. If statisticians can help teams win, surely that’s a good thing? But for every winner, there is a loser. The statistician can only help one team win at the expense of other teams losing. It’s a zero-sum game.</p>
<p>The true purpose of professional sports is not winning but entertainment. Lombardi had it all wrong. We watch sports because we find it enjoyable. The winning and losing are all part of the enjoyment. Do statisticians improve the enjoyment of sports? At best the answer is neutral and there is some evidence to suggest that they make it less enjoyable. In baseball, statisticians have discovered that players who foul off a lot of balls improve the chances of winning while stealing bases does not. Yet watching balls being fouled off is boring while base stealing is exciting. In football, statistical advice has sometimes led to boring, park-the-bus, defensive play.</p>
<p>It’s probably too late to turn back the clock as sports teams will not forgo the chance to gain an advantage. Nevertheless, statisticians should realise that, while they may derive some satisfaction and employment in applying statistics to sports, the overall effect of statistics on the professional sporting world has been negative.</p>
</description>
</item>
<item>
<title>Formatting LaTeX for a small screen</title>
<link>https://julianfaraway.github.io/post/formatting-latex-for-a-small-screen/</link>
<pubDate>Wed, 21 Sep 2016 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/formatting-latex-for-a-small-screen/</guid>
<description><p>Almost every student has a smart phone so it makes sense to format lecture notes so that they can be read on these small screen devices. But this can be difficult to achieve if you use LaTeX to produce your lecture notes or other mathematical/statistical handouts. We also want to maintain a full size version so the smaller version needs to be produced with minimal changes. Here are some tips which require increasing effort to implement</p>
<ol>
<li>Use A6 size paper by opening your LaTeX document with:</li>
</ol>
<pre><code> \documentclass[a6paper]{article}
</code></pre>
<p>This is one quarter the size of A4 so it will shrink the page size greatly. I use the default 10pt font since students tend to have good eyesight. I can just about read this if I hold my phone in landscape orientation.</p>
<ol start="2">
<li>Use the <em>geometry</em> package to specify minimal margins:</li>
</ol>
<pre><code> \usepackage[margin=1mm]{geometry}
</code></pre>
<p>Because who needs margins if you are not printing this out.</p>
<ol start="3">
<li>I use the <em>graphicx</em> package for including graphics. When including a plot or diagram use something like this:</li>
</ol>
<pre><code> \includegraphics*[width=0.75\textwidth]{resfit.pdf}
</code></pre>
<p>The plot will take up 75% of the width of the page which works for both the small and the large screen versions.</p>
<p>Some mathematical expressions can be quite long and will exceed the page width particularly on the small screen version. This is not a problem with text since LaTeX knows how to set the line breaks. But it’s much harder to do this with mathematical expressions. This is where the <em>breqn</em> package is very useful. At a minimum you can easily replace all your equation environments with <em>dmath</em>. This will get you automated line breaking in your equations. The <em>breqn</em> package has a lot more functionality if you want to make more of an effort.</p>
<p>It would be nice if LaTeX could produce documents that could dynamically reflow depending on screen size like the *epub&amp; format used on e-readers. But that’s unlikely to happen so a version formatted for the small screen is the next best thing.</p>
</description>
</item>
<item>
<title>What’s wrong with University League tables</title>
<link>https://julianfaraway.github.io/post/what-s-wrong-with-university-league-tables/</link>
<pubDate>Mon, 23 May 2016 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/what-s-wrong-with-university-league-tables/</guid>
<description><p>Today, the Guardian published its
<a href="https://www.theguardian.com/education/2016/may/23/university-league-table-loughborough-races-into-top-five" target="_blank" rel="noopener">University Guide 2017</a>. Let’s take a closer look at the components of these league tables. I don’t mean to pick on the Guardian table as the other tables have similar characteristics.</p>
<p>Three of the measures are based on student satisfaction and are drawn from the National Student Survey. When the NSS started out, it received fairly honest responses and had some value in provoking genuine improvements in education. But its value has deteriorated over time as Universities and students have reacted to it. Most students realise that the future value of their degree depends on the esteem in which their university is held. It is rational to rate your own university highly even if you don’t really feel that way. Furthermore, students find it difficult to rate their experience since most have only been to one university. It’s like rating the only restaurant you’ve ever eaten at. The Guardian makes things worse by using three measures from the NSS in its rankings.</p>
<p>Student to staff ratio is a slippery statistic. Many academics have divided responsibilities between teaching and research. It’s difficult to measure how much teaching they do and how much they interact with students. Class sizes can vary a lot according to type of programme and year in the degree – it’s not like primary education. Spend per student is another problematic measure. Expenditure on facilities can vary substantially from year to year and unpicking university budgets is difficult.</p>
<p>Average entry tariff is a solid measure and reflects student preferences. If you reorder the Guardian table on this measure alone, you’ll get a ranking that is closer to something knowledgeable raters would construct. This measure is sensitive to the selection of courses offered by the university since grades vary among A-level subjects.</p>
<p>Value added scores are highly dubious. It’s a measure of the difference between degree output and A-level input. A-levels are national tests and are a reasonable measure of entry ability. Degree qualifications are not comparable across Universities. A 2:1 at a top university is not the same as a 2:1 from a lower level university. If you compare the exams in Mathematics taken in top universities with those given by lower level universities, you will see huge differences in the difficulty and content. A student obtaining a 2:2 in Mathematics at a top university will likely know far more Maths than a student with a first from a post 92 university. This means it is foolish to take the proportion of good degrees (1 and 2:1) as a measure of output performance.</p>
<p>The final component is the percentage holding career jobs after six months. This is a useful statistic but is hard to measure accurately. This will also be affected by the mixture of courses offered by the university.</p>
<p>All these measures are then combined into a single “Guardian score”. There is no one right way to do this. If you consider the set of all convex combinations of the measures, you would generate a huge number of possible rankings, all them just as valid (or invalid) as the Guardian score. It’s a cake baked from mostly dodgy ingredients using an arbitrary recipe.</p>
<p>We might laugh this off as a bit of harmless fun. Unfortunately, some prospective students and members of the public take it seriously. Universities boast of their performance in press releases and on their websites. University administrators set their policies to increase their league table standing. Some of these policies are harmful to education and rarely are they beneficial. Meanwhile, the league tables are not actually useful to a 17 year old deciding on a degree course. The choice is constrained by expected A-level grades, course and location preferences. The statistics in the tables fluctuate from year to year and are an unreliable predictor of the individual student experience.</p>
</description>
</item>
<item>
<title>Is data splitting good for you?</title>
<link>https://julianfaraway.github.io/post/is-data-splitting-good-for-you/</link>
<pubDate>Fri, 08 Apr 2016 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/is-data-splitting-good-for-you/</guid>
<description><p>Suppose you have some data and you want to build a model to predict future observations. Data splitting means dividing your data into two, not necessarily equal, parts. One part is used to build the model and the other half to evaluate it in some way. There are two related, but distinct, reasons why people do this. It’s well known that if you use the same data to both build the model and test the performance of that model, you’ll be overoptimistic about how well your model will do in predicting new data. Analysts have various tricks to avoid overconfidence, such as crossvalidation, but these are not perfect. Furthermore, if you need to prove to someone else how well you’ve done, they will be sceptical of such tricks. The gold standard is to reserve part of your data as a test set and build and fit your model on the remaining training set part of the data. You use this model to predict the observations in the test set. Because the test set has been held back, it’s (almost) like having fresh data. The performance on this test set will be a realistic assessment of how the model will perform on future data. But you lost something in the data splitting – the training data is smaller than the full data so the model you select and fit won’t be as good. If you don’t need to prove how good your model is, this form of data splitting is a bad idea. It’s as if a customer orders a new car and asks that the seller drive it around for 10K miles to prove there’s nothing wrong with it. The customer will receive the assurance that the car is not a lemon but it won’t be as good as getting a brand new car in perfect condition.</p>
<p>By the way, if you find your model doesn’t do as well as you’d hoped on the test set, you might be tempted to go back and change the model. But the performance on this new model cannot be judged cleanly with the test set because you’ve borrowed some information from the test set to help build the model. You only get one shot using the test set.</p>
<p>There’s a second reason why you might use data splitting. The typical model building process involves choosing from a wide range of potential models. Usually there is substantial model uncertainty about the choice but you take your best pick. You then use the data to estimate the parameters of your chosen model. Statistical methods are good at assessing the parametric uncertainty in your estimates, but don’t reflect the model uncertainty at all. This a big reason why statistical models tend to be overconfident about future predictions. That’s where the data splitting can help. You use the the first part of your data to build the model and the second part to estimate the parameters of your chosen model. This results in more realistic estimates of the uncertainty in predictions. Again you pay a price for the data splitting. You use less data to choose the model and less data to fit the model. Your point predictions will not be as good as if you used the full data for everything. But your statements of the uncertainty in your predictions will be better (and probably wider).</p>
<p>So judging the value of data splitting in this context means we have to attach some value to uncertainty assessment as well as point prediction. The method of scoring is a good way to do this. All this and more is discussed in my paper
<a href="https://link.springer.com/article/10.1007/s11222-014-9522-9" target="_blank" rel="noopener">Does data splitting improve prediction?</a> and on
<a href="https://arxiv.org/pdf/1301.2983.pdf" target="_blank" rel="noopener">ArXiv</a>. Although it depends on the circumstances, I show that this form of data splitting can improve prediction.</p>
</description>
</item>
<item>
<title>Confidence Bands for Smoothness</title>
<link>https://julianfaraway.github.io/post/confidence-bands-for-smoothness/</link>
<pubDate>Wed, 16 Mar 2016 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/confidence-bands-for-smoothness/</guid>
<description><p>In
<a href="https://julianfaraway.github.io/post/what-s-wrong-with-simultaneous-confidence-bands" target="_blank" rel="noopener">What’s wrong with simultaneous confidence bands</a>, I discussed the deficiencies of standard confidence bands, but how can we do better? Suppose we have a Gaussian process for the curve with some mean and a covariance kernel:</p>
<p>$$
k(x,x^\prime) = \sigma^2_f \exp \left( - {1 \over 2l^2} (x-x^\prime)^2 \right) + \sigma^2_n \delta(x - x^\prime)
$$</p>
<p>where δ is a delta function. The three hyper parameters, $\sigma_f, \sigma_n$ and $l$ control the appearance of the curve. We can put priors on these parameters along with a prior on the mean function and calculate the posterior using MCMC methods. The most important parameter $l$ controls the smoothness of the curve. We can view the uncertainty in this smoothness by computing a 95% credible interval for this parameter and plot the two curves corresponding to the endpoints of this interval. The other parameters are set at the posterior means. An example of these bands can be seen in the figure:</p>
<figure id="figure-plot-of-smoothness-bands">
<a data-fancybox="" href="https://julianfaraway.github.io/media/cbsm.jpg" data-caption="Plot of smoothness bands">
<img src="https://julianfaraway.github.io/media/cbsm.jpg" alt="" >
</a>
<figcaption>
Plot of smoothness bands
</figcaption>
</figure>
<p>The solid line corresponds to the lower end of 95% interval for the smoothing parameter $l$ giving a rougher fit while the dashed line is the upper end of the interval which is a smoother fit. We are fairly sure that the correct amount of smoothness lies between these two limits.</p>
<p>Notice this makes a big difference to how many peaks and valleys we see in the function. The uncertainty about these features is more interesting than any uncertainty about the vertical position of the curve expressed by the traditional bands.</p>
<p>You can read all the details in my article:
<a href="https://julianfaraway.github.io/publication/confidence-bands/" target="_blank" rel="noopener">Confidence bands for smoothness in nonparametric regression</a> and also view the
<a href="https://people.bath.ac.uk/jjf23/scb/" target="_blank" rel="noopener">R code</a>.</p>
</description>
</item>
<item>
<title>Modeling Light Curves for Improved Classification of Astronomical Objects</title>
<link>https://julianfaraway.github.io/post/modeling-light-curves-for-improved-classification-of-astronomical-objects/</link>
<pubDate>Sun, 13 Mar 2016 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/modeling-light-curves-for-improved-classification-of-astronomical-objects/</guid>
<description><p>Sky surveys provide a wide-angle view of the universe. Instead of focusing on a single star or galaxy, they provide a snapshot of a wider portion of the sky. Their primary purpose is to search for asteroids, so they take a sequence of images over a short timespan: minutes or hours. By seeing what has changed, the asteroid can be detected. But meanwhile, much further away, other things are changing. Most objects in the night sky do not change much on human timescales, but some of the most interesting stars and galaxies are performing for us. As the survey returns to the same location from time to time, we can see those objects that have changed. But how do we detect and categorise these objects? Here is a plot of four such objects:</p>
<figure id="figure-plot-of-light-curves">
<a data-fancybox="" href="https://julianfaraway.github.io/media/lceg.png" data-caption="Plot of light curves">
<img src="https://julianfaraway.github.io/media/lceg.png" alt="" >
</a>
<figcaption>
Plot of light curves
</figcaption>
</figure>
<p>The first of the four is an example of an active galactic nucleus. The plot shows how the brightness of the object varies over time. The second plot shows a supernova – most of the time we see nothing because the galaxy is below the detection limit but briefly we see a spark of light for a few weeks. The third object is a flare – it’s mostly quiet but burst into life from time to time. The fourth object is like our sun – it varies a little but enough to be interesting (fortunately for us!).</p>
<p>These are examples of light curves. As technology improves, increasingly large numbers of these curves will be recorded. We need to quickly identify and categorise the interesting ones so that they can be rapidly followed up (before the show is over!). In
<a href="https://doi.org/10.1002/sam.11305" target="_blank" rel="noopener">Modeling lightcurves for improved classification of astronomical objects</a>, we describe how this can be done. You can also read about it on
<a href="https://arxiv.org/abs/1401.3211" target="_blank" rel="noopener">ArXiv</a> and examine the
<a href="https://people.bath.ac.uk/jjf23/modlc/" target="_blank" rel="noopener">software and data</a>.</p>
</description>
</item>
<item>
<title>What's wrong with simultaneous confidence bands</title>
<link>https://julianfaraway.github.io/post/what-s-wrong-with-simultaneous-confidence-bands/</link>
<pubDate>Fri, 11 Mar 2016 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/what-s-wrong-with-simultaneous-confidence-bands/</guid>
<description><p>Here are some 95% confidence bands for a fitted curve shown on the same data. The first uses spline smoothing from the mgcv package while the second uses a loess smoother from the ggplot2 package.</p>
<p>
<figure id="figure-plot-of-smoothness-bands-using-mgcv">
<a data-fancybox="" href="https://julianfaraway.github.io/media/mgcvagn.png" data-caption="Plot of smoothness bands using mgcv">
<img src="https://julianfaraway.github.io/media/mgcvagn.png" alt="" >
</a>
<figcaption>
Plot of smoothness bands using mgcv
</figcaption>
</figure>
<figure id="figure-plot-of-smoothness-bands-using-loess">
<a data-fancybox="" href="https://julianfaraway.github.io/media/scblow.png" data-caption="Plot of smoothness bands using loess">
<img src="https://julianfaraway.github.io/media/scblow.png" alt="" >
</a>
<figcaption>
Plot of smoothness bands using loess
</figcaption>
</figure>
</p>
<p>If all you want is a graphical expression of the uncertainty in these two estimates, these are just fine. But suppose you want to check whether some proposed function fits entirely within the bands, then you will need to do more work. The bands above are pointwise meaning that the confidence statement is true at any given point but not true for the entire curve. For that, you will need simultaneous confidence bands. These are more work to produce and involve all sorts of intricate calculations. Hundreds of papers have been written on the topic because of the fascinating theoretical challenges it raises. I&rsquo;m responsible for a few of these papers myself.</p>
<p>But are these bands really useful? Properly constructed, they may tell us there&rsquo;s a 95% chance that the bands capture the true curve. But what is the value in that? There will be some users who are interested in replacing the smooth fit with some particular parametric form, say a quadratic. Such users would be better off embedding their search within a family of increasingly complex alternatives and choosing accordingly. SCBs would not be an efficient strategy.</p>
<p>In SCB papers that have a data example, the usual motivation is that the user is interested in whether some particular feature exists, say a secondary maximum, for example. But users looking for particular features are better off with a method designed to look for those features, such as SiZer.</p>
<p>The greatest uncertainty is demonstrated by comparing the two figures above. How much smoothing should be applied? This makes a crucial difference to our interpretation. In the typical SCB construction, the amount of smoothing is chosen by some algorithm and the bands only reflect the uncertainty in the amplitude of the curves.</p>
<p>We need bands that tell us about the uncertainty in the smoothing. I will explain how to do this in the next
<a href="https://julianfaraway.github.io/post/confidence-bands-for-smoothness" target="_blank" rel="noopener">blog post</a>.</p>
</description>
</item>
<item>
<title>Confidence bands for smoothness in nonparametric regression</title>
<link>https://julianfaraway.github.io/publication/confidence-bands/</link>
<pubDate>Sun, 10 Jan 2016 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/publication/confidence-bands/</guid>
<description></description>
</item>
<item>
<title>Statistics authors single no more</title>
<link>https://julianfaraway.github.io/post/statistics-authors-single-no-more/</link>
<pubDate>Wed, 09 Dec 2015 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/statistics-authors-single-no-more/</guid>
<description><p>While looking at tables of contents for journals and CVs for job applications, it struck me that there are a lot of multi-author papers now. Just to check that I was not imagining it, I downloaded the tables of contents for JASA and JRSS-B for the years 2014, 2004, 1994, 1984 and 1974. I removed the comments, book reviews and corrections to focus just on the research articles. I counted the number of authors for each paper and here’s what I found:</p>
<p>Mean number of authors per article:</p>
<table>
<thead>
<tr>
<th>Journal</th>
<th>1974</th>
<th>1984</th>
<th>1994</th>
<th>2004</th>
<th>2014</th>
</tr>
</thead>
<tbody>
<tr>
<td>JASA</td>
<td>1.48</td>
<td>1.61</td>
<td>1.89</td>
<td>2.50</td>
<td>2.97</td>
</tr>
<tr>
<td>JRSS</td>
<td>1.29</td>
<td>1.51</td>
<td>1.70</td>
<td>2.45</td>
<td>2.65</td>
</tr>
</tbody>
</table>
<p>and</p>
<p>Fraction of single author articles:</p>
<table>
<thead>
<tr>
<th>Journal</th>
<th>1974</th>
<th>1984</th>
<th>1994</th>
<th>2004</th>
<th>2014</th>
</tr>
</thead>
<tbody>
<tr>
<td>JASA</td>
<td>0.56</td>
<td>0.50</td>
<td>0.35</td>
<td>0.19</td>
<td>0.06</td>
</tr>
<tr>
<td>JRSS</td>
<td>0.71</td>
<td>0.57</td>
<td>0.41</td>
<td>0.12</td>
<td>0.03</td>
</tr>
</tbody>
</table>
<p>I’d like to have done more but Web of Science doesn’t make it easy to get the data. Nevertheless, the trend is very clear. Browse through a few journals, old and new and you’ll see the same pattern. You can see similar trends in other fields. The average number of authors per paper has been increasing significantly over time. Most dramatically, the number of single author papers has gone from a majority down to single digit percentages.</p>
<p>Now there are several good reasons not to go it alone. If you write a genuine applications paper, you will be collaborating with a scientist from another field who would be a natural co-author. But most of the articles in these two journals are methodological with Statistical authors. In any case this doesn’t explain the trend. It’s also possible that your co-authors bring different skills to the table, theoretical or computational. It’s also nice to have someone to discuss the paper. You correct each other’s errors and misconceptions. You learn from each other. The social aspect of the collaboration can make you more productive. But that’s also been true in the past. You can point to the greater ease of long distance collaborations using the internet but I suspect there is a stronger cause.</p>
<p>The academic world is increasingly driven by metrics. You will get far more credit for writing four articles, each with four authors than for producing one single author paper. So there’s a huge incentive to collaborate. This is good when the co-authors have clearly distinct skills but often they are just other statisticians, much like you.</p>
<p>But something has been lost. Most good papers have one main idea and only one person can have that idea. Sure, other people can help refine that idea and turn it into a paper but somewhere in that list of multiple authors there is that one person who had the idea. Truly creative and innovative ideas start out sounding a bit crazy, ill-formed and speculative. If you discuss the idea with your peers, they will back away since it won’t sound like something that will reliably result in a publishable paper. Don’t even think of submitting a grant proposal. So you work on the idea and turn it into flesh. By that time, you don’t need co-authors. Working as a group is a reliable way to get work published but for truly creative work, you need to go it alone.</p>
</description>
</item>
<item>
<title>Plotting Regression Datasets</title>
<link>https://julianfaraway.github.io/post/2015-07-23-r-rmarkdown/</link>
<pubDate>Fri, 09 Oct 2015 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/2015-07-23-r-rmarkdown/</guid>
<description>
<p>Consider a regression dataset with a response and several predictors. You want a single plot showing the response plotted against each of the predictors. You could use the pairs() but that also shows plots between the predictors. If there are more than a few predictors, there are too many plots to see any one of them clearly. Here’s a simple solution:</p>
<p>Here’s an example dataset:</p>
<pre class="r"><code>head(swiss)
Fertility Agriculture Examination Education Catholic
Courtelary 80.2 17.0 15 12 9.96
Delemont 83.1 45.1 6 9 84.84
Franches-Mnt 92.5 39.7 5 5 93.40
Moutier 85.8 36.5 12 7 33.77
Neuveville 76.9 43.5 17 15 5.16
Porrentruy 76.1 35.3 9 7 90.57
Infant.Mortality
Courtelary 22.2
Delemont 22.2
Franches-Mnt 20.2
Moutier 20.3
Neuveville 20.6
Porrentruy 26.6</code></pre>
<p>Now reorganise the data using the tidyr package so that there is one (x,y) pair on each line:</p>
<pre class="r"><code>library(tidyr)
rdf &lt;- gather(swiss, variable, value, -Fertility)
head(rdf)
Fertility variable value
1 80.2 Agriculture 17.0
2 83.1 Agriculture 45.1
3 92.5 Agriculture 39.7
4 85.8 Agriculture 36.5
5 76.9 Agriculture 43.5
6 76.1 Agriculture 35.3</code></pre>
<p>Use ggplot2 to plot the response against each of the predictors (which are on different scales so
we need to allow for that)</p>
<pre class="r"><code>library(ggplot2)
ggplot(rdf, aes(x=value,y=Fertility)) + geom_point() + facet_wrap(~ variable, scale=&quot;free_x&quot;)</code></pre>
<p><img src="https://julianfaraway.github.io/post/2015-07-23-r-rmarkdown_files/figure-html/unnamed-chunk-3-1.png" width="672" /></p>
<p>We can elaborate as needed.</p>
</description>
</item>
<item>
<title>GLM - An overused paradigm</title>
<link>https://julianfaraway.github.io/post/glm/</link>
<pubDate>Wed, 19 Aug 2015 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/post/glm/</guid>
<description><p>There are a very large number of books, articles and university courses with “Generalised Linear Models” (GLM) in the title. I even wrote such a book myself. But is the GLM paradigm really that useful?</p>
<p>The idea is that we can develop a general theory of estimation, inference and diagnostics that will apply to a wide class of models. We will avoid duplication of effort and synergies will arise across this class of models. The idea goes back to a 1972 paper in JRSS-B by Nelder and Wedderburn.</p>
<p>But what response distributions belong to the GLM family? The Gaussian (or normal) distribution is the most used in practice. But this is simply the linear model for which much more general and powerful results exist. The Gaussian gains nothing from the GLM perspective.</p>
<p>Next we have the binomial and Poisson, which do benefit from GLM membership. But beyond that, the family members become progressively more exotic. The gamma GLM is not commonly used because a linear model with a transformed response will often suffice. Venturing further into the outback, you may find an inverse Gaussian or Tweedie GLM but these are truly rare birds. There are more interesting distributions such as the negative binomial and beta but they are excluded from the club as they don’t belong to the “exponential family” of distributions.</p>
<p>So there are only two important members of the GLM family: the binomial and the Poisson. Even here we must be careful because large chunks of the theory and practice for these models is specific to one or the other. The GLM paradigm does tell us one way to estimate and do inference for these models. But there other ways to do these things.</p>
<p>Statisticians love widely applicable theories – but perhaps a little too much. GLM is a nice, useful theory but the paradigm has become too dominant in the way people learn or are taught about these kind of models.</p>
</description>
</item>
<item>
<title>Does data splitting improve prediction?</title>
<link>https://julianfaraway.github.io/publication/data-splitting/</link>
<pubDate>Wed, 29 Oct 2014 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/publication/data-splitting/</guid>
<description></description>
</item>
<item>
<title>Ergonomics</title>
<link>https://julianfaraway.github.io/project/ergonomics/</link>
<pubDate>Thu, 21 Dec 2006 00:00:00 +0000</pubDate>
<guid>https://julianfaraway.github.io/project/ergonomics/</guid>
<description><p>Formerly, I worked at the
<a href="https://www.humosim.org" target="_blank" rel="noopener">Human Motion Simulation</a> at the
<a href="https://www.umich.edu" target="_blank" rel="noopener">University of Michigan</a>. You can read more about my work
<a href="https://people.bath.ac.uk/jjf23/humosim/" target="_blank" rel="noopener">here</a></p>
</description>
</item>
</channel>
</rss>