├── .gitignore
├── README.md
├── causality.bib
├── cheat-sheet.pdf
├── cheat-sheet.tex
├── figures
├── actual-cause-circuit.jpg
├── back-door.png
├── confounders.png
├── confounders.svg
├── front-door.png
├── graph-cond-ident-4-3-1.png
├── instrumental-variable.jpg
├── partial-compliance-instrument.png
├── partial-compliance-instrument.svg
├── selection-bias.png
├── selection-bias.svg
├── simpson.png
├── twin-network.png
└── twin-network.svg
└── genetics.bst
/.gitignore:
--------------------------------------------------------------------------------
1 | *.aux
2 | *.out
3 | *.aux
4 | *.synctex.gz
5 | *.log
6 | *.bbl
7 | *.blg
8 | *.swp
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # causal-inference-cheat-sheet
2 |
3 | A brief summary of useful/interesting results from Causality 2nd Edition (Pearl, 2009)
4 |
--------------------------------------------------------------------------------
/causality.bib:
--------------------------------------------------------------------------------
1 | @book{pearl09,
2 | title={Causality},
3 | author={Pearl, Judea},
4 | year={2009},
5 | publisher={Cambridge university press}
6 | }
7 |
8 | @article{tikka17,
9 | title={Identifying causal effects with the {R} package causaleffect},
10 | author={Tikka, Santtu and Karvanen, Juha},
11 | journal={J. Stat. Softw},
12 | year={2017}
13 | }
14 |
15 | @article{spirtes10,
16 | title={Automated search for causal relations: Theory and practice},
17 | author={Spirtes, Peter and Glymour, Clark and Scheines, Richard and Tillman, Robert},
18 | year={2010},
19 | journal={Carnegie Mellon University}
20 | }
21 |
22 | @article{zheng18,
23 | title={DAGs with NO TEARS: Continuous optimization for structure learning},
24 | author={Zheng, Xun and Aragam, Bryon and Ravikumar, Pradeep K and Xing, Eric P},
25 | journal={Advances in Neural Information Processing Systems},
26 | volume={31},
27 | pages={9472--9483},
28 | year={2018}
29 | }
30 |
31 | @inproceedings{Tian02,
32 | title={A general identification condition for causal effects},
33 | author={Tian, Jin and Pearl, Judea},
34 | booktitle={Aaai/iaai},
35 | pages={567--573},
36 | year={2002}
37 | }
38 |
39 | @book{Verma88,
40 | title={Influence diagrams and d-separation},
41 | author={Verma, Thomas and Pearl, Judea},
42 | year={1988},
43 | publisher={UCLA, Computer Science Department}
44 | }
45 |
46 | @article{Ramsey17,
47 | title={A million variables and more: the Fast Greedy Equivalence Search algorithm for learning high-dimensional graphical causal models, with an application to functional magnetic resonance images},
48 | author={Ramsey, Joseph and Glymour, Madelyn and Sanchez-Romero, Ruben and Glymour, Clark},
49 | journal={International journal of data science and analytics},
50 | volume={3},
51 | number={2},
52 | pages={121--129},
53 | year={2017},
54 | publisher={Springer}
55 | }
56 |
57 | @article{Shimizu06,
58 | title={A linear non-Gaussian acyclic model for causal discovery.},
59 | author={Shimizu, Shohei and Hoyer, Patrik O and Hyv{\"a}rinen, Aapo and Kerminen, Antti and Jordan, Michael},
60 | journal={Journal of Machine Learning Research},
61 | volume={7},
62 | number={10},
63 | year={2006}
64 | }
65 |
66 | @article{Chickering97,
67 | title={A clincian's tools for analyzing non-compliance},
68 | author={Chickering, David and Pearl, Judea},
69 | journal={Computing Science and Statisitcs},
70 | volume={29},
71 | number={2},
72 | year={1997}
73 | }
74 |
75 | @incollection{Simon77,
76 | title={Causal ordering and identifiability},
77 | author={Simon, Herbert A},
78 | booktitle={Models of Discovery},
79 | pages={53--80},
80 | year={1977},
81 | publisher={Springer}
82 | }
83 |
84 | @article{Nayak94,
85 | title={Causal approximations},
86 | author={Nayak, P Pandurang},
87 | journal={Artificial Intelligence},
88 | volume={70},
89 | number={1-2},
90 | pages={277--334},
91 | year={1994},
92 | publisher={Elsevier}
93 | }
94 |
95 | @misc{Halpern10,
96 | title={Actual causation and the art of modelling In Dechter JHR, Geffner H (Ed.), Heuristics, Probability, and Causality: A Tribute to Judea Pearl (pp. 383--406)},
97 | author={Halpern, JY and Hitchcock, CR},
98 | year={2010},
99 | publisher={London: College Publications}
100 | }
101 |
102 | @article{Halpern15,
103 | title={A modification of the Halpern-Pearl definition of causality},
104 | author={Halpern, Joseph Y},
105 | journal={arXiv preprint arXiv:1505.00162},
106 | year={2015}
107 | }
108 |
--------------------------------------------------------------------------------
/cheat-sheet.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaryaman/causal-inference-cheat-sheet/4763566bf7a0fd84688ff19cdd9f04f1d77ce98c/cheat-sheet.pdf
--------------------------------------------------------------------------------
/figures/actual-cause-circuit.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaryaman/causal-inference-cheat-sheet/4763566bf7a0fd84688ff19cdd9f04f1d77ce98c/figures/actual-cause-circuit.jpg
--------------------------------------------------------------------------------
/figures/back-door.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaryaman/causal-inference-cheat-sheet/4763566bf7a0fd84688ff19cdd9f04f1d77ce98c/figures/back-door.png
--------------------------------------------------------------------------------
/figures/confounders.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaryaman/causal-inference-cheat-sheet/4763566bf7a0fd84688ff19cdd9f04f1d77ce98c/figures/confounders.png
--------------------------------------------------------------------------------
/figures/confounders.svg:
--------------------------------------------------------------------------------
1 |
2 |
1101 |
--------------------------------------------------------------------------------
/figures/front-door.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaryaman/causal-inference-cheat-sheet/4763566bf7a0fd84688ff19cdd9f04f1d77ce98c/figures/front-door.png
--------------------------------------------------------------------------------
/figures/graph-cond-ident-4-3-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaryaman/causal-inference-cheat-sheet/4763566bf7a0fd84688ff19cdd9f04f1d77ce98c/figures/graph-cond-ident-4-3-1.png
--------------------------------------------------------------------------------
/figures/instrumental-variable.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaryaman/causal-inference-cheat-sheet/4763566bf7a0fd84688ff19cdd9f04f1d77ce98c/figures/instrumental-variable.jpg
--------------------------------------------------------------------------------
/figures/partial-compliance-instrument.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaryaman/causal-inference-cheat-sheet/4763566bf7a0fd84688ff19cdd9f04f1d77ce98c/figures/partial-compliance-instrument.png
--------------------------------------------------------------------------------
/figures/selection-bias.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaryaman/causal-inference-cheat-sheet/4763566bf7a0fd84688ff19cdd9f04f1d77ce98c/figures/selection-bias.png
--------------------------------------------------------------------------------
/figures/simpson.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaryaman/causal-inference-cheat-sheet/4763566bf7a0fd84688ff19cdd9f04f1d77ce98c/figures/simpson.png
--------------------------------------------------------------------------------
/figures/twin-network.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaryaman/causal-inference-cheat-sheet/4763566bf7a0fd84688ff19cdd9f04f1d77ce98c/figures/twin-network.png
--------------------------------------------------------------------------------
/figures/twin-network.svg:
--------------------------------------------------------------------------------
1 |
2 |
687 |
--------------------------------------------------------------------------------
/genetics.bst:
--------------------------------------------------------------------------------
1 | %% Updated 28 March, 2017 by Overleaf --
2 | %% Truncates >5 authors to et al. in references list.
3 | %%
4 | %% This is file `genetics.bst', generated
5 | %% on <1996/3/21> with the docstrip utility (2.2i).
6 | %%
7 | %% The original source files were:
8 | %%
9 | %% merlin.mbs (with options: `,ay,nat,nm-rev1,nmft-sc,nmand-rm,dt-beg,yrp-x,note-yr,jttl-rm,vol-bf,vnum-x,volp-sp,jnm-x,edby,blk-tit,pp,lab-sc,and-rm,etal-it')
10 | %% ----------------------------------------
11 | %% *** Bibliography style for Genetics (J.T. 8/3/96) ***
12 | %%
13 | %-------------------------------------------------------------------
14 | % The original source file contains the following version information:
15 | % \ProvidesFile{merlin.mbs}[1996/02/05 3.7 (PWD)]
16 | %
17 | % NOTICE:
18 | % This file may be used for non-profit purposes.
19 | % It may not be distributed in exchange for money,
20 | % other than distribution costs.
21 | %
22 | % The author provides it `as is' and does not guarantee it in any way.
23 | %
24 | % Copyright (C) 1994, 1995, 1996 Patrick W. Daly
25 | %-------------------------------------------------------------------
26 | % For use with BibTeX version 0.99a or later
27 | %-------------------------------------------------------------------
28 | % This bibliography style file is intended for texts in ENGLISH
29 | % This is an author-year citation style bibliography. As such, it is
30 | % non-standard LaTeX, and requires a special package file to function properly.
31 | % Such a package is natbib.sty by Patrick W. Daly
32 | % The form of the \bibitem entries is
33 | % \bibitem[Jones et al.(1990)]{key}...
34 | % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}...
35 | % The essential feature is that the label (the part in brackets) consists
36 | % of the author names, as they should appear in the citation, with the year
37 | % in parentheses following. There must be no space before the opening
38 | % parenthesis!
39 | % With natbib v5.3, a full list of authors may also follow the year.
40 | % In natbib.sty, it is possible to define the type of enclosures that is
41 | % really wanted (brackets or parentheses), but in either case, there must
42 | % be parentheses in the label.
43 | % The \cite command functions as follows:
44 | % \cite{key} ==>> Jones et al. (1990)
45 | % \cite[]{key} ==>> (Jones et al., 1990)
46 | % \cite[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2)
47 | % \cite[e.g.][]{key} ==>> (e.g. Jones et al., 1990)
48 | % \cite[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32)
49 | % \citeauthor{key} Jones et al.
50 | % \citefullauthor{key} Jones, Baker, and Smith
51 | % \citeyear{key} 1990
52 | %---------------------------------------------------------------------
53 |
54 | ENTRY
55 | { address
56 | author
57 | booktitle
58 | chapter
59 | edition
60 | editor
61 | howpublished
62 | institution
63 | journal
64 | key
65 | month
66 | note
67 | number
68 | organization
69 | pages
70 | publisher
71 | school
72 | series
73 | title
74 | type
75 | volume
76 | year
77 | }
78 | {}
79 | { label extra.label sort.label short.list }
80 |
81 | INTEGERS { output.state before.all mid.sentence after.sentence after.block }
82 |
83 | FUNCTION {init.state.consts}
84 | { #0 'before.all :=
85 | #1 'mid.sentence :=
86 | #2 'after.sentence :=
87 | #3 'after.block :=
88 | }
89 |
90 | STRINGS { s t }
91 |
92 | FUNCTION {output.nonnull}
93 | { 's :=
94 | output.state mid.sentence =
95 | { ", " * write$ }
96 | { output.state after.block =
97 | { add.period$ write$
98 | newline$
99 | "\newblock " write$
100 | }
101 | { output.state before.all =
102 | 'write$
103 | { add.period$ " " * write$ }
104 | if$
105 | }
106 | if$
107 | mid.sentence 'output.state :=
108 | }
109 | if$
110 | s
111 | }
112 |
113 | FUNCTION {output}
114 | { duplicate$ empty$
115 | 'pop$
116 | 'output.nonnull
117 | if$
118 | }
119 |
120 | FUNCTION {output.check}
121 | { 't :=
122 | duplicate$ empty$
123 | { pop$ "empty " t * " in " * cite$ * warning$ }
124 | 'output.nonnull
125 | if$
126 | }
127 |
128 | FUNCTION {fin.entry}
129 | { add.period$
130 | write$
131 | newline$
132 | }
133 |
134 | FUNCTION {new.block}
135 | { output.state before.all =
136 | 'skip$
137 | { after.block 'output.state := }
138 | if$
139 | }
140 |
141 | FUNCTION {new.sentence}
142 | { output.state after.block =
143 | 'skip$
144 | { output.state before.all =
145 | 'skip$
146 | { after.sentence 'output.state := }
147 | if$
148 | }
149 | if$
150 | }
151 |
152 | FUNCTION {add.blank}
153 | { " " * before.all 'output.state :=
154 | }
155 |
156 | FUNCTION {date.block}
157 | {
158 | add.blank
159 | }
160 |
161 | FUNCTION {not}
162 | { { #0 }
163 | { #1 }
164 | if$
165 | }
166 |
167 | FUNCTION {and}
168 | { 'skip$
169 | { pop$ #0 }
170 | if$
171 | }
172 |
173 | FUNCTION {or}
174 | { { pop$ #1 }
175 | 'skip$
176 | if$
177 | }
178 |
179 | FUNCTION {non.stop}
180 | { duplicate$
181 | "}" * add.period$
182 | #-1 #1 substring$ "." =
183 | }
184 |
185 | FUNCTION {new.block.checkb}
186 | { empty$
187 | swap$ empty$
188 | and
189 | 'skip$
190 | 'new.block
191 | if$
192 | }
193 |
194 | FUNCTION {field.or.null}
195 | { duplicate$ empty$
196 | { pop$ "" }
197 | 'skip$
198 | if$
199 | }
200 |
201 | FUNCTION {emphasize}
202 | { duplicate$ empty$
203 | { pop$ "" }
204 | { "{\em " swap$ * "\/}" * }
205 | if$
206 | }
207 |
208 | FUNCTION {bolden}
209 | { duplicate$ empty$
210 | { pop$ "" }
211 | { "{\bf " swap$ * "}" * }
212 | if$
213 | }
214 |
215 | % scaps function adapted to remove caps (2015/03/11)
216 | FUNCTION {scaps}
217 | { duplicate$ empty$
218 | { pop$ "" }
219 | { "{" swap$ * "}" * }
220 | if$
221 | }
222 |
223 | FUNCTION {roman}
224 | { duplicate$ empty$
225 | { pop$ "" }
226 | { "{\rm " swap$ * "}" * }
227 | if$
228 | }
229 |
230 | FUNCTION {capitalize}
231 | { "u" change.case$ "t" change.case$ }
232 |
233 | FUNCTION {space.word}
234 | { " " swap$ * " " * }
235 |
236 | % Here are the language-specific definitions for explicit words.
237 | % Each function has a name bbl.xxx where xxx is the English word.
238 | % The language selected here is ENGLISH
239 | FUNCTION {bbl.and}
240 | { "and"}
241 |
242 | FUNCTION {bbl.editors}
243 | { "editors" }
244 |
245 | FUNCTION {bbl.editor}
246 | { "editor" }
247 |
248 | FUNCTION {bbl.edby}
249 | { "edited by" }
250 |
251 | FUNCTION {bbl.edition}
252 | { "edition" }
253 |
254 | FUNCTION {bbl.volume}
255 | { "volume" }
256 |
257 | FUNCTION {bbl.of}
258 | { "of" }
259 |
260 | FUNCTION {bbl.number}
261 | { "number" }
262 |
263 | FUNCTION {bbl.nr}
264 | { "no." }
265 |
266 | FUNCTION {bbl.in}
267 | { "in" }
268 |
269 | FUNCTION {bbl.pages}
270 | { "pp." }
271 |
272 | FUNCTION {bbl.page}
273 | { "p." }
274 |
275 | FUNCTION {bbl.chapter}
276 | { "chapter" }
277 |
278 | FUNCTION {bbl.techrep}
279 | { "Technical Report" }
280 |
281 | FUNCTION {bbl.mthesis}
282 | { "Master's thesis" }
283 |
284 | FUNCTION {bbl.phdthesis}
285 | { "Ph.D. thesis" }
286 |
287 | FUNCTION {bbl.first}
288 | { "First" }
289 |
290 | FUNCTION {bbl.second}
291 | { "Second" }
292 |
293 | FUNCTION {bbl.third}
294 | { "Third" }
295 |
296 | FUNCTION {bbl.fourth}
297 | { "Fourth" }
298 |
299 | FUNCTION {bbl.fifth}
300 | { "Fifth" }
301 |
302 | FUNCTION {bbl.st}
303 | { "st" }
304 |
305 | FUNCTION {bbl.nd}
306 | { "nd" }
307 |
308 | FUNCTION {bbl.rd}
309 | { "rd" }
310 |
311 | FUNCTION {bbl.th}
312 | { "th" }
313 |
314 | MACRO {jan} {"January"}
315 |
316 | MACRO {feb} {"February"}
317 |
318 | MACRO {mar} {"March"}
319 |
320 | MACRO {apr} {"April"}
321 |
322 | MACRO {may} {"May"}
323 |
324 | MACRO {jun} {"June"}
325 |
326 | MACRO {jul} {"July"}
327 |
328 | MACRO {aug} {"August"}
329 |
330 | MACRO {sep} {"September"}
331 |
332 | MACRO {oct} {"October"}
333 |
334 | MACRO {nov} {"November"}
335 |
336 | MACRO {dec} {"December"}
337 |
338 | FUNCTION {eng.ord}
339 | { duplicate$ "1" swap$ *
340 | #-2 #1 substring$ "1" =
341 | { bbl.th * }
342 | { duplicate$ #-1 #1 substring$
343 | duplicate$ "1" =
344 | { pop$ bbl.st * }
345 | { duplicate$ "2" =
346 | { pop$ bbl.nd * }
347 | { "3" =
348 | { bbl.rd * }
349 | { bbl.th * }
350 | if$
351 | }
352 | if$
353 | }
354 | if$
355 | }
356 | if$
357 | }
358 |
359 | MACRO {acmcs} {"ACM Computing Surveys"}
360 |
361 | MACRO {acta} {"Acta Informatica"}
362 |
363 | MACRO {cacm} {"Communications of the ACM"}
364 |
365 | MACRO {ibmjrd} {"IBM Journal of Research and Development"}
366 |
367 | MACRO {ibmsj} {"IBM Systems Journal"}
368 |
369 | MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
370 |
371 | MACRO {ieeetc} {"IEEE Transactions on Computers"}
372 |
373 | MACRO {ieeetcad}
374 | {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
375 |
376 | MACRO {ipl} {"Information Processing Letters"}
377 |
378 | MACRO {jacm} {"Journal of the ACM"}
379 |
380 | MACRO {jcss} {"Journal of Computer and System Sciences"}
381 |
382 | MACRO {scp} {"Science of Computer Programming"}
383 |
384 | MACRO {sicomp} {"SIAM Journal on Computing"}
385 |
386 | MACRO {tocs} {"ACM Transactions on Computer Systems"}
387 |
388 | MACRO {tods} {"ACM Transactions on Database Systems"}
389 |
390 | MACRO {tog} {"ACM Transactions on Graphics"}
391 |
392 | MACRO {toms} {"ACM Transactions on Mathematical Software"}
393 |
394 | MACRO {toois} {"ACM Transactions on Office Information Systems"}
395 |
396 | MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
397 |
398 | MACRO {tcs} {"Theoretical Computer Science"}
399 |
400 | INTEGERS { nameptr namesleft numnames }
401 |
402 | FUNCTION {format.names}
403 | { 's :=
404 | #1 'nameptr :=
405 | s num.names$ 'numnames :=
406 | numnames 'namesleft :=
407 | { namesleft #0 > }
408 | { nameptr #1 >
409 | { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := }
410 | { s nameptr "{vv~}{ll}{, f.}{, jj}" format.name$ 't := }
411 | if$
412 | nameptr #1 >
413 | {
414 | %% Added 28 March 2017: truncate >5 authors
415 | nameptr #5
416 | #1 + =
417 | numnames #5
418 | > and
419 | { "others" 't :=
420 | #1 'namesleft := }
421 | 'skip$
422 | if$
423 | %%% End addition
424 | namesleft #1 >
425 | { ", " * t * }
426 | {
427 | numnames #2 >
428 | { "," * }
429 | 'skip$
430 | if$
431 | t "others" =
432 | { " " * "et~al." emphasize * }
433 | { bbl.and roman space.word * t * }
434 | if$
435 | }
436 | if$
437 | }
438 | 't
439 | if$
440 | nameptr #1 + 'nameptr :=
441 | namesleft #1 - 'namesleft :=
442 | }
443 | while$
444 | }
445 |
446 | FUNCTION {format.names.ed}
447 | { 's :=
448 | #1 'nameptr :=
449 | s num.names$ 'numnames :=
450 | numnames 'namesleft :=
451 | { namesleft #0 > }
452 | { s nameptr
453 | "{f.~}{vv~}{ll}{, jj}"
454 | format.name$ 't :=
455 | nameptr #1 >
456 | {
457 | namesleft #1 >
458 | { ", " * t * }
459 | {
460 | numnames #2 >
461 | { "," * }
462 | 'skip$
463 | if$
464 | t "others" =
465 | { " " * "et~al." emphasize * }
466 | { bbl.and roman space.word * t * }
467 | if$
468 | }
469 | if$
470 | }
471 | 't
472 | if$
473 | nameptr #1 + 'nameptr :=
474 | namesleft #1 - 'namesleft :=
475 | }
476 | while$
477 | }
478 |
479 | FUNCTION {format.key}
480 | { empty$
481 | { key field.or.null }
482 | { "" }
483 | if$
484 | }
485 |
486 | FUNCTION {format.authors}
487 | { author empty$
488 | { "" }
489 | {
490 | author format.names scaps
491 | }
492 | if$
493 | }
494 |
495 | FUNCTION {format.editors}
496 | { editor empty$
497 | { "" }
498 | {
499 | editor format.names scaps
500 | editor num.names$ #1 >
501 | { ", " * bbl.editors * }
502 | { ", " * bbl.editor * }
503 | if$
504 | }
505 | if$
506 | }
507 |
508 | FUNCTION {format.in.editors}
509 | { editor empty$
510 | { "" }
511 | { editor format.names.ed
512 | }
513 | if$
514 | }
515 |
516 | FUNCTION {format.title}
517 | { title empty$
518 | { "" }
519 | { title "t" change.case$
520 | }
521 | if$
522 | }
523 |
524 | FUNCTION {format.full.names}
525 | {'s :=
526 | #1 'nameptr :=
527 | s num.names$ 'numnames :=
528 | numnames 'namesleft :=
529 | { namesleft #0 > }
530 | { s nameptr
531 | "{vv~}{ll}" format.name$ 't :=
532 | nameptr #1 >
533 | {
534 | namesleft #1 >
535 | { ", " * t * }
536 | {
537 | numnames #2 >
538 | { "," * }
539 | 'skip$
540 | if$
541 | t "others" =
542 | { " " * "et~al." emphasize * }
543 | { bbl.and roman space.word * t * }
544 | if$
545 | }
546 | if$
547 | }
548 | 't
549 | if$
550 | nameptr #1 + 'nameptr :=
551 | namesleft #1 - 'namesleft :=
552 | }
553 | while$
554 | }
555 |
556 | FUNCTION {author.editor.key.full}
557 | { author empty$
558 | { editor empty$
559 | { key empty$
560 | { cite$ #1 #3 substring$ }
561 | 'key
562 | if$
563 | }
564 | { editor format.full.names }
565 | if$
566 | }
567 | { author format.full.names }
568 | if$
569 | }
570 |
571 | FUNCTION {author.key.full}
572 | { author empty$
573 | { key empty$
574 | { cite$ #1 #3 substring$ }
575 | 'key
576 | if$
577 | }
578 | { author format.full.names }
579 | if$
580 | }
581 |
582 | FUNCTION {editor.key.full}
583 | { editor empty$
584 | { key empty$
585 | { cite$ #1 #3 substring$ }
586 | 'key
587 | if$
588 | }
589 | { editor format.full.names }
590 | if$
591 | }
592 |
593 | FUNCTION {make.full.names}
594 | { type$ "book" =
595 | type$ "inbook" =
596 | or
597 | 'author.editor.key.full
598 | { type$ "proceedings" =
599 | 'editor.key.full
600 | 'author.key.full
601 | if$
602 | }
603 | if$
604 | scaps
605 | }
606 |
607 | FUNCTION {output.bibitem}
608 | { newline$
609 | "\bibitem[" write$
610 | label write$
611 | ")" make.full.names duplicate$ short.list =
612 | { pop$ }
613 | { * }
614 | if$
615 | "]{" * write$
616 | cite$ write$
617 | "}" write$
618 | newline$
619 | ""
620 | before.all 'output.state :=
621 | }
622 |
623 | FUNCTION {n.dashify}
624 | { 't :=
625 | ""
626 | { t empty$ not }
627 | { t #1 #1 substring$ "-" =
628 | { t #1 #2 substring$ "--" = not
629 | { "--" *
630 | t #2 global.max$ substring$ 't :=
631 | }
632 | { { t #1 #1 substring$ "-" = }
633 | { "-" *
634 | t #2 global.max$ substring$ 't :=
635 | }
636 | while$
637 | }
638 | if$
639 | }
640 | { t #1 #1 substring$ *
641 | t #2 global.max$ substring$ 't :=
642 | }
643 | if$
644 | }
645 | while$
646 | }
647 |
648 | FUNCTION {word.in}
649 | { bbl.in capitalize
650 | " " * }
651 |
652 | FUNCTION {format.date}
653 | { year duplicate$ empty$
654 | { "empty year in " cite$ * "; set to ????" * warning$
655 | pop$ "????" }
656 | 'skip$
657 | if$
658 | extra.label *
659 | }
660 |
661 | FUNCTION {format.btitle}
662 | { title emphasize
663 | }
664 |
665 | FUNCTION {tie.or.space.connect}
666 | { duplicate$ text.length$ #3 <
667 | { "~" }
668 | { " " }
669 | if$
670 | swap$ * *
671 | }
672 |
673 | FUNCTION {either.or.check}
674 | { empty$
675 | 'pop$
676 | { "can't use both " swap$ * " fields in " * cite$ * warning$ }
677 | if$
678 | }
679 |
680 | FUNCTION {format.bvolume}
681 | { volume empty$
682 | { "" }
683 | { bbl.volume volume tie.or.space.connect
684 | series empty$
685 | 'skip$
686 | { bbl.of space.word * series emphasize * }
687 | if$
688 | "volume and number" number either.or.check
689 | }
690 | if$
691 | }
692 |
693 | FUNCTION {format.number.series}
694 | { volume empty$
695 | { number empty$
696 | { series field.or.null }
697 | { output.state mid.sentence =
698 | { bbl.number }
699 | { bbl.number capitalize }
700 | if$
701 | number tie.or.space.connect
702 | series empty$
703 | { "there's a number but no series in " cite$ * warning$ }
704 | { bbl.in space.word * series * }
705 | if$
706 | }
707 | if$
708 | }
709 | { "" }
710 | if$
711 | }
712 |
713 | FUNCTION {is.num}
714 | { chr.to.int$
715 | duplicate$ "0" chr.to.int$ < not
716 | swap$ "9" chr.to.int$ > not and
717 | }
718 |
719 | FUNCTION {extract.num}
720 | { duplicate$ 't :=
721 | "" 's :=
722 | { t empty$ not }
723 | { t #1 #1 substring$
724 | t #2 global.max$ substring$ 't :=
725 | duplicate$ is.num
726 | { s swap$ * 's := }
727 | { pop$ "" 't := }
728 | if$
729 | }
730 | while$
731 | s empty$
732 | 'skip$
733 | { pop$ s }
734 | if$
735 | }
736 |
737 | FUNCTION {convert.edition}
738 | { edition extract.num "l" change.case$ 's :=
739 | s "first" = s "1" = or
740 | { bbl.first 't := }
741 | { s "second" = s "2" = or
742 | { bbl.second 't := }
743 | { s "third" = s "3" = or
744 | { bbl.third 't := }
745 | { s "fourth" = s "4" = or
746 | { bbl.fourth 't := }
747 | { s "fifth" = s "5" = or
748 | { bbl.fifth 't := }
749 | { s #1 #1 substring$ is.num
750 | { s eng.ord 't := }
751 | { edition 't := }
752 | if$
753 | }
754 | if$
755 | }
756 | if$
757 | }
758 | if$
759 | }
760 | if$
761 | }
762 | if$
763 | t
764 | }
765 |
766 | FUNCTION {format.edition}
767 | { edition empty$
768 | { "" }
769 | { output.state mid.sentence =
770 | { convert.edition "l" change.case$ " " * bbl.edition * }
771 | { convert.edition "t" change.case$ " " * bbl.edition * }
772 | if$
773 | }
774 | if$
775 | }
776 |
777 | INTEGERS { multiresult }
778 |
779 | FUNCTION {multi.page.check}
780 | { 't :=
781 | #0 'multiresult :=
782 | { multiresult not
783 | t empty$ not
784 | and
785 | }
786 | { t #1 #1 substring$
787 | duplicate$ "-" =
788 | swap$ duplicate$ "," =
789 | swap$ "+" =
790 | or or
791 | { #1 'multiresult := }
792 | { t #2 global.max$ substring$ 't := }
793 | if$
794 | }
795 | while$
796 | multiresult
797 | }
798 |
799 | FUNCTION {format.pages}
800 | { pages empty$
801 | { "" }
802 | { pages multi.page.check
803 | { bbl.pages pages n.dashify tie.or.space.connect }
804 | { bbl.page pages tie.or.space.connect }
805 | if$
806 | }
807 | if$
808 | }
809 |
810 | FUNCTION {format.vol.num.pages}
811 | { volume field.or.null
812 | bolden
813 | pages empty$
814 | 'skip$
815 | { duplicate$ empty$
816 | { pop$ format.pages }
817 | { ": " * pages n.dashify * }
818 | if$
819 | }
820 | if$
821 | }
822 |
823 | FUNCTION {format.chapter.pages}
824 | { chapter empty$
825 | 'format.pages
826 | { type empty$
827 | { bbl.chapter }
828 | { type "l" change.case$ }
829 | if$
830 | chapter tie.or.space.connect
831 | pages empty$
832 | 'skip$
833 | { ", " * format.pages * }
834 | if$
835 | }
836 | if$
837 | }
838 |
839 | FUNCTION {format.in.ed.booktitle}
840 | { booktitle empty$
841 | { "" }
842 | { editor empty$
843 | { word.in booktitle emphasize * }
844 | { word.in booktitle emphasize *
845 | ", " *
846 | bbl.edby
847 | * " " *
848 | format.in.editors *
849 | }
850 | if$
851 | }
852 | if$
853 | }
854 |
855 | FUNCTION {format.thesis.type}
856 | { type empty$
857 | 'skip$
858 | { pop$
859 | type "t" change.case$
860 | }
861 | if$
862 | }
863 |
864 | FUNCTION {format.tr.number}
865 | { type empty$
866 | { bbl.techrep }
867 | 'type
868 | if$
869 | number empty$
870 | { "t" change.case$ }
871 | { number tie.or.space.connect }
872 | if$
873 | }
874 |
875 | FUNCTION {format.article.crossref}
876 | {
877 | word.in
878 | " \cite{" * crossref * "}" *
879 | }
880 |
881 | FUNCTION {format.book.crossref}
882 | { volume empty$
883 | { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
884 | word.in
885 | }
886 | { bbl.volume volume tie.or.space.connect
887 | bbl.of space.word *
888 | }
889 | if$
890 | " \cite{" * crossref * "}" *
891 | }
892 |
893 | FUNCTION {format.incoll.inproc.crossref}
894 | {
895 | word.in
896 | " \cite{" * crossref * "}" *
897 | }
898 |
899 | FUNCTION {article}
900 | { output.bibitem
901 | format.authors "author" output.check
902 | author format.key output
903 | format.date "year" output.check
904 | date.block
905 | format.title "title" output.check
906 | new.sentence
907 | crossref missing$
908 | { journal
909 | "journal" output.check
910 | add.blank
911 | format.vol.num.pages output
912 | }
913 | { format.article.crossref output.nonnull
914 | format.pages output
915 | }
916 | if$
917 | note output
918 | fin.entry
919 | }
920 |
921 | FUNCTION {book}
922 | { output.bibitem
923 | author empty$
924 | { format.editors "author and editor" output.check
925 | editor format.key output
926 | }
927 | { format.authors output.nonnull
928 | crossref missing$
929 | { "author and editor" editor either.or.check }
930 | 'skip$
931 | if$
932 | }
933 | if$
934 | format.date "year" output.check
935 | date.block
936 | format.btitle "title" output.check
937 | crossref missing$
938 | { format.bvolume output
939 | new.sentence
940 | format.number.series output
941 | publisher "publisher" output.check
942 | address output
943 | }
944 | {
945 | new.sentence
946 | format.book.crossref output.nonnull
947 | }
948 | if$
949 | format.edition output
950 | note output
951 | fin.entry
952 | }
953 |
954 | FUNCTION {booklet}
955 | { output.bibitem
956 | format.authors output
957 | author format.key output
958 | format.date "year" output.check
959 | date.block
960 | format.title "title" output.check
961 | new.sentence
962 | howpublished output
963 | address output
964 | note output
965 | fin.entry
966 | }
967 |
968 | %
969 |
970 |
971 | FUNCTION {format.editors.inbook}
972 | {
973 | editor empty$
974 | { "" }
975 | {
976 | bbl.edby
977 | " " *
978 | editor format.names scaps *
979 | }
980 | if$
981 | }
982 |
983 | FUNCTION {format.btitle.inbook}
984 | {
985 | " in " *
986 | format.btitle *
987 | }
988 |
989 | FUNCTION {inbook}
990 | { output.bibitem
991 | author empty$
992 | { format.editors "author and editor" output.check
993 | editor format.key output
994 | }
995 | { format.authors output.nonnull
996 | crossref missing$
997 | { "author and editor" editor either.or.check }
998 | 'skip$
999 | if$
1000 | }
1001 | if$
1002 | format.date "year" output.check
1003 | date.block
1004 |
1005 | %% inbook must be :
1006 | %% Authors, year, chapter, pp, "in" title, "edited by" editors, publisher.
1007 |
1008 | % format.btitle "title" output.check
1009 | % crossref missing$
1010 | % { format.bvolume output
1011 | % format.chapter.pages "chapter and pages" output.check
1012 | % new.sentence
1013 | % format.number.series output
1014 | % publisher "publisher" output.check
1015 | % address output
1016 | % }
1017 | % {
1018 | % format.chapter.pages "chapter and pages" output.check
1019 | % new.sentence
1020 | % format.book.crossref output.nonnull
1021 | % }
1022 | % if$
1023 | % format.edition output
1024 | % note output
1025 | % fin.entry
1026 |
1027 |
1028 | chapter "chapter" output.check
1029 | format.pages "pages" output.check
1030 | format.btitle.inbook "title" output.check
1031 | format.editors.inbook "editors" output.check
1032 | publisher "publisher" output.check
1033 | note output
1034 | fin.entry
1035 | }
1036 |
1037 |
1038 |
1039 | FUNCTION {incollection}
1040 | { output.bibitem
1041 | format.authors "author" output.check
1042 | author format.key output
1043 | format.date "year" output.check
1044 | date.block
1045 | format.title "title" output.check
1046 | new.sentence
1047 | crossref missing$
1048 | { format.in.ed.booktitle "booktitle" output.check
1049 | format.bvolume output
1050 | format.number.series output
1051 | format.chapter.pages output
1052 | publisher "publisher" output.check
1053 | address output
1054 | format.edition output
1055 | }
1056 | { format.incoll.inproc.crossref output.nonnull
1057 | format.chapter.pages output
1058 | }
1059 | if$
1060 | note output
1061 | fin.entry
1062 | }
1063 |
1064 | FUNCTION {inproceedings}
1065 | { output.bibitem
1066 | format.authors "author" output.check
1067 | author format.key output
1068 | format.date "year" output.check
1069 | date.block
1070 | format.title "title" output.check
1071 | new.sentence
1072 | crossref missing$
1073 | { format.in.ed.booktitle "booktitle" output.check
1074 | format.bvolume output
1075 | format.number.series output
1076 | format.pages output
1077 | address output
1078 | organization output
1079 | publisher output
1080 | }
1081 | { format.incoll.inproc.crossref output.nonnull
1082 | format.pages output
1083 | }
1084 | if$
1085 | note output
1086 | fin.entry
1087 | }
1088 |
1089 | FUNCTION {conference} { inproceedings }
1090 |
1091 | FUNCTION {manual}
1092 | { output.bibitem
1093 | format.authors output
1094 | author format.key output
1095 | format.date "year" output.check
1096 | date.block
1097 | format.btitle "title" output.check
1098 | new.sentence
1099 | organization output
1100 | address output
1101 | format.edition output
1102 | note output
1103 | fin.entry
1104 | }
1105 |
1106 | FUNCTION {mastersthesis}
1107 | { output.bibitem
1108 | format.authors "author" output.check
1109 | author format.key output
1110 | format.date "year" output.check
1111 | date.block
1112 | format.btitle "title" output.check
1113 | new.sentence
1114 | bbl.mthesis format.thesis.type output.nonnull
1115 | school "school" output.check
1116 | address output
1117 | note output
1118 | fin.entry
1119 | }
1120 |
1121 | FUNCTION {misc}
1122 | { output.bibitem
1123 | format.authors output
1124 | author format.key output
1125 | format.date "year" output.check
1126 | date.block
1127 | format.title output
1128 | new.sentence
1129 | howpublished output
1130 | note output
1131 | fin.entry
1132 | }
1133 |
1134 | FUNCTION {phdthesis}
1135 | { output.bibitem
1136 | format.authors "author" output.check
1137 | author format.key output
1138 | format.date "year" output.check
1139 | date.block
1140 | format.btitle "title" output.check
1141 | new.sentence
1142 | bbl.phdthesis format.thesis.type output.nonnull
1143 | school "school" output.check
1144 | address output
1145 | note output
1146 | fin.entry
1147 | }
1148 |
1149 | FUNCTION {proceedings}
1150 | { output.bibitem
1151 | format.editors output
1152 | editor format.key output
1153 | format.date "year" output.check
1154 | date.block
1155 | format.btitle "title" output.check
1156 | format.bvolume output
1157 | format.number.series output
1158 | address output
1159 | organization output
1160 | publisher output
1161 | note output
1162 | fin.entry
1163 | }
1164 |
1165 | FUNCTION {techreport}
1166 | { output.bibitem
1167 | format.authors "author" output.check
1168 | author format.key output
1169 | format.date "year" output.check
1170 | date.block
1171 | format.title "title" output.check
1172 | new.sentence
1173 | format.tr.number output.nonnull
1174 | institution "institution" output.check
1175 | address output
1176 | note output
1177 | fin.entry
1178 | }
1179 |
1180 | FUNCTION {unpublished}
1181 | { output.bibitem
1182 | format.authors "author" output.check
1183 | author format.key output
1184 | format.date "year" output.check
1185 | date.block
1186 | format.title "title" output.check
1187 | new.sentence
1188 | note "note" output.check
1189 | fin.entry
1190 | }
1191 |
1192 | FUNCTION {default.type} { misc }
1193 |
1194 | READ
1195 |
1196 | FUNCTION {sortify}
1197 | { purify$
1198 | "l" change.case$
1199 | }
1200 |
1201 | INTEGERS { len }
1202 |
1203 | FUNCTION {chop.word}
1204 | { 's :=
1205 | 'len :=
1206 | s #1 len substring$ =
1207 | { s len #1 + global.max$ substring$ }
1208 | 's
1209 | if$
1210 | }
1211 |
1212 | FUNCTION {format.lab.names}
1213 | { 's :=
1214 | s #1 "{vv~}{ll}" format.name$
1215 | s num.names$ duplicate$
1216 | #2 >
1217 | { pop$ " " * "et~al." emphasize * }
1218 | { #2 <
1219 | 'skip$
1220 | { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1221 | { " " * "et~al." emphasize * }
1222 | { bbl.and
1223 | roman
1224 | space.word * s #2 "{vv~}{ll}" format.name$ * }
1225 | if$
1226 | }
1227 | if$
1228 | }
1229 | if$
1230 | }
1231 |
1232 | FUNCTION {author.key.label}
1233 | { author empty$
1234 | { key empty$
1235 | { cite$ #1 #3 substring$ }
1236 | 'key
1237 | if$
1238 | }
1239 | { author format.lab.names }
1240 | if$
1241 | }
1242 |
1243 | FUNCTION {author.editor.key.label}
1244 | { author empty$
1245 | { editor empty$
1246 | { key empty$
1247 | { cite$ #1 #3 substring$ }
1248 | 'key
1249 | if$
1250 | }
1251 | { editor format.lab.names }
1252 | if$
1253 | }
1254 | { author format.lab.names }
1255 | if$
1256 | }
1257 |
1258 | FUNCTION {editor.key.label}
1259 | { editor empty$
1260 | { key empty$
1261 | { cite$ #1 #3 substring$ }
1262 | 'key
1263 | if$
1264 | }
1265 | { editor format.lab.names }
1266 | if$
1267 | }
1268 |
1269 | FUNCTION {calc.short.authors}
1270 | { type$ "book" =
1271 | type$ "inbook" =
1272 | or
1273 | 'author.editor.key.label
1274 | { type$ "proceedings" =
1275 | 'editor.key.label
1276 | 'author.key.label
1277 | if$
1278 | }
1279 | if$
1280 | scaps
1281 | 'short.list :=
1282 | }
1283 |
1284 | FUNCTION {calc.label}
1285 | { calc.short.authors
1286 | short.list
1287 | "("
1288 | *
1289 | year duplicate$ empty$
1290 | { pop$ "????" }
1291 | 'skip$
1292 | if$
1293 | *
1294 | 'label :=
1295 | }
1296 |
1297 | FUNCTION {sort.format.names}
1298 | { 's :=
1299 | #1 'nameptr :=
1300 | ""
1301 | s num.names$ 'numnames :=
1302 | numnames 'namesleft :=
1303 | { namesleft #0 > }
1304 | { s nameptr
1305 | "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
1306 | format.name$ 't :=
1307 | nameptr #1 >
1308 | {
1309 | " " *
1310 | namesleft #1 = t "others" = and
1311 | { "aaaaa" * }
1312 | { t sortify * }
1313 | if$
1314 | }
1315 | { t sortify * }
1316 | if$
1317 | nameptr #1 + 'nameptr :=
1318 | namesleft #1 - 'namesleft :=
1319 | }
1320 | while$
1321 | }
1322 |
1323 | FUNCTION {sort.format.title}
1324 | { 't :=
1325 | "A " #2
1326 | "An " #3
1327 | "The " #4 t chop.word
1328 | chop.word
1329 | chop.word
1330 | sortify
1331 | #1 global.max$ substring$
1332 | }
1333 |
1334 | FUNCTION {author.sort}
1335 | { author empty$
1336 | { key empty$
1337 | { "to sort, need author or key in " cite$ * warning$
1338 | ""
1339 | }
1340 | { key sortify }
1341 | if$
1342 | }
1343 | { author sort.format.names }
1344 | if$
1345 | }
1346 |
1347 | FUNCTION {author.editor.sort}
1348 | { author empty$
1349 | { editor empty$
1350 | { key empty$
1351 | { "to sort, need author, editor, or key in " cite$ * warning$
1352 | ""
1353 | }
1354 | { key sortify }
1355 | if$
1356 | }
1357 | { editor sort.format.names }
1358 | if$
1359 | }
1360 | { author sort.format.names }
1361 | if$
1362 | }
1363 |
1364 | FUNCTION {editor.sort}
1365 | { editor empty$
1366 | { key empty$
1367 | { "to sort, need editor or key in " cite$ * warning$
1368 | ""
1369 | }
1370 | { key sortify }
1371 | if$
1372 | }
1373 | { editor sort.format.names }
1374 | if$
1375 | }
1376 |
1377 | FUNCTION {presort}
1378 | { calc.label
1379 | label sortify
1380 | " "
1381 | *
1382 | type$ "book" =
1383 | type$ "inbook" =
1384 | or
1385 | 'author.editor.sort
1386 | { type$ "proceedings" =
1387 | 'editor.sort
1388 | 'author.sort
1389 | if$
1390 | }
1391 | if$
1392 | #1 entry.max$ substring$
1393 | 'sort.label :=
1394 | sort.label
1395 | *
1396 | " "
1397 | *
1398 | title field.or.null
1399 | sort.format.title
1400 | *
1401 | #1 entry.max$ substring$
1402 | 'sort.key$ :=
1403 | }
1404 |
1405 | ITERATE {presort}
1406 |
1407 | SORT
1408 |
1409 | STRINGS { last.label next.extra }
1410 |
1411 | INTEGERS { last.extra.num number.label }
1412 |
1413 | FUNCTION {initialize.extra.label.stuff}
1414 | { #0 int.to.chr$ 'last.label :=
1415 | "" 'next.extra :=
1416 | #0 'last.extra.num :=
1417 | #0 'number.label :=
1418 | }
1419 |
1420 | FUNCTION {forward.pass}
1421 | { last.label label =
1422 | { last.extra.num #1 + 'last.extra.num :=
1423 | last.extra.num int.to.chr$ 'extra.label :=
1424 | }
1425 | { "a" chr.to.int$ 'last.extra.num :=
1426 | "" 'extra.label :=
1427 | label 'last.label :=
1428 | }
1429 | if$
1430 | number.label #1 + 'number.label :=
1431 | }
1432 |
1433 | FUNCTION {reverse.pass}
1434 | { next.extra "b" =
1435 | { "a" 'extra.label := }
1436 | 'skip$
1437 | if$
1438 | extra.label 'next.extra :=
1439 | extra.label
1440 | duplicate$ empty$
1441 | 'skip$
1442 | { "{" swap$ * "}" * }
1443 | if$
1444 | 'extra.label :=
1445 | label extra.label * 'label :=
1446 | }
1447 |
1448 | EXECUTE {initialize.extra.label.stuff}
1449 |
1450 | ITERATE {forward.pass}
1451 |
1452 | REVERSE {reverse.pass}
1453 |
1454 | FUNCTION {bib.sort.order}
1455 | { sort.label
1456 | " "
1457 | *
1458 | year field.or.null sortify
1459 | *
1460 | " "
1461 | *
1462 | title field.or.null
1463 | sort.format.title
1464 | *
1465 | #1 entry.max$ substring$
1466 | 'sort.key$ :=
1467 | }
1468 |
1469 | ITERATE {bib.sort.order}
1470 |
1471 | SORT
1472 |
1473 | FUNCTION {begin.bib}
1474 | { preamble$ empty$
1475 | 'skip$
1476 | { preamble$ write$ newline$ }
1477 | if$
1478 | "\begin{thebibliography}{" number.label int.to.str$ * "}" *
1479 | write$ newline$
1480 | }
1481 |
1482 | EXECUTE {begin.bib}
1483 |
1484 | EXECUTE {init.state.consts}
1485 |
1486 | ITERATE {call.type$}
1487 |
1488 | FUNCTION {end.bib}
1489 | { newline$
1490 | "\end{thebibliography}" write$ newline$
1491 | }
1492 |
1493 | EXECUTE {end.bib}
1494 | %% End of customized bst file
--------------------------------------------------------------------------------