diff --git a/LaTeX/jss.bst b/LaTeX/jss.bst new file mode 100644 index 0000000..ae75415 --- /dev/null +++ b/LaTeX/jss.bst @@ -0,0 +1,1653 @@ +%% +%% This is file `jss.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `ay,nat,nm-rvx,keyxyr,dt-beg,yr-par,note-yr,tit-qq,atit-u,trnum-it,vol-bf,volp-com,num-xser,pre-edn,isbn,issn,edpar,pp,ed,xedn,xand,etal-it,revdata,eprint,url,url-blk,doi,nfss') +%% +%% ** BibTeX style file for JSS publications (http://www.jstatsoft.org/) +%% +%% License: GPL-2 | GPL-3 + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above, provided + % with kind permission of Patrick W Daly. + % + % This generated file can be redistributed and/or modified under the terms + % of the General Public License (Version 2 or 3). + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2011/11/18 4.33 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is an author-year citation style bibliography. As such, it is + % non-standard LaTeX, and requires a special package file to function properly. + % Such a package is natbib.sty by Patrick W. Daly + % The form of the \bibitem entries is + % \bibitem[Jones et al.(1990)]{key}... + % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}... + % The essential feature is that the label (the part in brackets) consists + % of the author names, as they should appear in the citation, with the year + % in parentheses following. There must be no space before the opening + % parenthesis! + % With natbib v5.3, a full list of authors may also follow the year. + % In natbib.sty, it is possible to define the type of enclosures that is + % really wanted (brackets or parentheses), but in either case, there must + % be parentheses in the label. + % The \cite command functions as follows: + % \citet{key} ==>> Jones et al. (1990) + % \citet*{key} ==>> Jones, Baker, and Smith (1990) + % \citep{key} ==>> (Jones et al., 1990) + % \citep*{key} ==>> (Jones, Baker, and Smith, 1990) + % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) + % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990) + % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., 1990, p. 32) + % \citeauthor{key} ==>> Jones et al. + % \citeauthor*{key} ==>> Jones, Baker, and Smith + % \citeyear{key} ==>> 1990 + %--------------------------------------------------------------------- + +ENTRY + { address + archive + author + booktitle + chapter + collaboration + doi + edition + editor + eid + eprint + howpublished + institution + isbn + issn + journal + key + month + note + number + numpages + organization + pages + publisher + school + series + title + type + url + volume + year + } + {} + { label extra.label sort.label short.list } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {date.block} +{ + new.block +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +FUNCTION {non.stop} +{ duplicate$ + "}" * add.period$ + #-1 #1 substring$ "." = +} + +STRINGS {z} + +FUNCTION {remove.dots} +{ 'z := + "" + { z empty$ not } + { z #1 #2 substring$ + duplicate$ "\." = + { z #3 global.max$ substring$ 'z := * } + { pop$ + z #1 #1 substring$ + z #2 global.max$ substring$ 'z := + duplicate$ "." = 'pop$ + { * } + if$ + } + if$ + } + while$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} +FUNCTION {bolden} +{ duplicate$ empty$ + { pop$ "" } + { "\textbf{" swap$ * "}" * } + if$ +} +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.editors} +{ "eds." } + +FUNCTION {bbl.editor} +{ "ed." } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "edition" } + +FUNCTION {bbl.volume} +{ "volume" } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "number" } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "pp." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.eidpp} +{ "pages" } + +FUNCTION {bbl.chapter} +{ "chapter" } + +FUNCTION {bbl.techrep} +{ "Technical Report" } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +MACRO {jan} {"January"} + +MACRO {feb} {"February"} + +MACRO {mar} {"March"} + +MACRO {apr} {"April"} + +MACRO {may} {"May"} + +MACRO {jun} {"June"} + +MACRO {jul} {"July"} + +MACRO {aug} {"August"} + +MACRO {sep} {"September"} + +MACRO {oct} {"October"} + +MACRO {nov} {"November"} + +MACRO {dec} {"December"} + +MACRO {acmcs} {"ACM Computing Surveys"} + +MACRO {acta} {"Acta Informatica"} + +MACRO {cacm} {"Communications of the ACM"} + +MACRO {ibmjrd} {"IBM Journal of Research and Development"} + +MACRO {ibmsj} {"IBM Systems Journal"} + +MACRO {ieeese} {"IEEE Transactions on Software Engineering"} + +MACRO {ieeetc} {"IEEE Transactions on Computers"} + +MACRO {ieeetcad} + {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} + +MACRO {ipl} {"Information Processing Letters"} + +MACRO {jacm} {"Journal of the ACM"} + +MACRO {jcss} {"Journal of Computer and System Sciences"} + +MACRO {scp} {"Science of Computer Programming"} + +MACRO {sicomp} {"SIAM Journal on Computing"} + +MACRO {tocs} {"ACM Transactions on Computer Systems"} + +MACRO {tods} {"ACM Transactions on Database Systems"} + +MACRO {tog} {"ACM Transactions on Graphics"} + +MACRO {toms} {"ACM Transactions on Mathematical Software"} + +MACRO {toois} {"ACM Transactions on Office Information Systems"} + +MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} + +MACRO {tcs} {"Theoretical Computer Science"} +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {format.eprint} +{ eprint duplicate$ empty$ + 'skip$ + { "\eprint" + archive empty$ + 'skip$ + { "[" * archive * "]" * } + if$ + "{" * swap$ * "}" * + } + if$ +} +FUNCTION {format.url} +{ + url + duplicate$ empty$ + { pop$ "" } + { "\urlprefix\url{" swap$ * "}" * } + if$ +} + +INTEGERS { nameptr namesleft numnames } + + +STRINGS { bibinfo} + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}{ jj}{ f{}}" + format.name$ + remove.dots + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + "," * + t "others" = + { + " " * bbl.etal emphasize * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.names.ed} +{ + 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{f{}~}{vv~}{ll}{ jj}" + format.name$ + remove.dots + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + "," * + t "others" = + { + + " " * bbl.etal emphasize * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author "author" format.names + duplicate$ empty$ 'skip$ + { collaboration "collaboration" bibinfo.check + duplicate$ empty$ 'skip$ + { " (" swap$ * ")" * } + if$ + * + } + if$ +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.editor + "(" swap$ * ")" * + * + } + if$ +} +FUNCTION {format.isbn} +{ isbn "isbn" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + "ISBN " swap$ * + } + if$ +} + +FUNCTION {format.issn} +{ issn "issn" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + "ISSN " swap$ * + } + if$ +} + +FUNCTION {format.doi} +{ doi empty$ + { "" } + { + new.block + "\doi{" doi * "}" * + } + if$ +} +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + "\enquote{" swap$ * + add.period$ "}" * + } + if$ +} +FUNCTION {format.full.names} +{'s := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal emphasize * + } + { + numnames #2 > + { "," * } + 'skip$ + if$ + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {author.editor.key.full} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.key.full} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {editor.key.full} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.full + { type$ "proceedings" = + 'editor.key.full + 'author.key.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[{" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "}]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in capitalize + " " * } + +FUNCTION {format.date} +{ year "year" bibinfo.check duplicate$ empty$ + { + "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" + } + 'skip$ + if$ + extra.label * + before.all 'output.state := + " (" swap$ * ")" * +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + emphasize + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ bbl.of space.word * swap$ + emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ", " * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.journal.eid} +{ eid "eid" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ 'skip$ + { + ", " * + } + if$ + swap$ * + numpages empty$ 'skip$ + { bbl.eidpp numpages tie.or.space.prefix + "numpages" bibinfo.check * * + " (" swap$ * ")" * * + } + if$ + } + if$ +} +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + bolden + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * + eid empty$ + { format.journal.pages } + { format.journal.eid } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check + emphasize +} +FUNCTION {format.in.ed.booktitle} +{ format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + " " * + get.bbl.editor + "(" swap$ * "), " * + * swap$ + * } + if$ + word.in swap$ * + } + if$ +} +FUNCTION {format.thesis.type} +{ type duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + capitalize + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + address empty$ t empty$ and + 'skip$ + { + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + } + if$ +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.block + crossref missing$ + { + journal + "journal" bibinfo.check + emphasize + "journal" output.check + format.vol.num.pages output + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + format.issn output + format.doi output + new.block + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + new.block + format.number.series output + format.edition output + new.sentence + format.publisher.address output + } + { + new.block + format.book.crossref output.nonnull + } + if$ + format.isbn output + format.doi output + new.block + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.block + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.isbn output + format.doi output + new.block + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.date "year" output.check + date.block + format.btitle "title" output.check + crossref missing$ + { + format.bvolume output + format.chapter.pages "chapter and pages" output.check + new.block + format.number.series output + format.edition output + new.sentence + format.publisher.address output + } + { + format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + } + if$ + crossref missing$ + { format.isbn output } + 'skip$ + if$ + format.doi output + new.block + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.edition output + format.chapter.pages output + new.sentence + format.publisher.address output + format.isbn output + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + format.doi output + new.block + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.pages output + new.sentence + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.isbn output + format.issn output + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + format.doi output + new.block + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + organization address new.block.checkb + organization "organization" bibinfo.check output + address "address" bibinfo.check output + format.edition output + format.doi output + new.block + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.btitle + "title" output.check + new.block + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.doi output + new.block + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + author format.key output + format.date "year" output.check + date.block + format.title output + new.block + howpublished "howpublished" bibinfo.check output + format.doi output + new.block + format.note output + format.eprint output + format.url output + fin.entry +} +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.btitle + "title" output.check + new.block + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.doi output + new.block + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output + format.date "year" output.check + date.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + new.sentence + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.isbn output + format.issn output + format.doi output + new.block + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title + "title" output.check + new.block + format.tr.number emphasize output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + format.doi output + new.block + format.note output + format.eprint output + format.url output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + author format.key output + format.date "year" output.check + date.block + format.title "title" output.check + format.doi output + new.block + format.note "note" output.check + format.eprint output + format.url output + fin.entry +} + +FUNCTION {default.type} { misc } +READ +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} +INTEGERS { len } +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} +FUNCTION {format.lab.names} +{ 's := + "" 't := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ + " " * bbl.etal emphasize * + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * bbl.etal emphasize * + } + { bbl.and space.word * s #2 "{vv~}{ll}" format.name$ + * } + if$ + } + if$ + } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.label + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + year duplicate$ empty$ + short.list key field.or.null = or + { pop$ "" } + 'skip$ + if$ + * + 'label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" + format.name$ 't := + nameptr #1 > + { + " " * + namesleft #1 = t "others" = and + { "zzzzz" 't := } + 'skip$ + if$ + t sortify * + } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} +FUNCTION {presort} +{ calc.label + label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.sort + 'author.sort + if$ + } + if$ + #1 entry.max$ substring$ + 'sort.label := + sort.label + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} +SORT +STRINGS { last.label next.extra } +INTEGERS { last.extra.num last.extra.num.extended last.extra.num.blank number.label } +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := + "a" chr.to.int$ #1 - 'last.extra.num.blank := + last.extra.num.blank 'last.extra.num.extended := + #0 'number.label := +} +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num "z" chr.to.int$ > + { "a" chr.to.int$ 'last.extra.num := + last.extra.num.extended #1 + 'last.extra.num.extended := + } + 'skip$ + if$ + last.extra.num.extended last.extra.num.blank > + { last.extra.num.extended int.to.chr$ + last.extra.num int.to.chr$ + * 'extra.label := } + { last.extra.num int.to.chr$ 'extra.label := } + if$ + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + 'skip$ + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := +} +EXECUTE {initialize.extra.label.stuff} +ITERATE {forward.pass} +REVERSE {reverse.pass} +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} +ITERATE {bib.sort.order} +SORT +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\newcommand{\enquote}[1]{``#1''}" + write$ newline$ + "\providecommand{\natexlab}[1]{#1}" + write$ newline$ + "\providecommand{\url}[1]{\texttt{#1}}" + write$ newline$ + "\providecommand{\urlprefix}{URL }" + write$ newline$ + "\expandafter\ifx\csname urlstyle\endcsname\relax" + write$ newline$ + " \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else" + write$ newline$ + " \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi" + write$ newline$ + "\providecommand{\eprint}[2][]{\url{#2}}" + write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `jss.bst'. diff --git a/LaTeX/jss.cls b/LaTeX/jss.cls new file mode 100644 index 0000000..2a5ba18 --- /dev/null +++ b/LaTeX/jss.cls @@ -0,0 +1,490 @@ +%% +%% This is file `jss.cls' +\def\fileversion{3.2} +\def\filename{jss} +\def\filedate{2020/12/09} +%% +%% Package `jss' to use with LaTeX2e for JSS publications (http://www.jstatsoft.org/) +%% License: GPL-2 | GPL-3 +%% Copyright: (C) Achim Zeileis +%% Please report errors to Achim.Zeileis@R-project.org +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{jss}[\filedate\space\fileversion\space jss class by Achim Zeileis] +%% options +\newif\if@article +\newif\if@codesnippet +\newif\if@bookreview +\newif\if@softwarereview +\newif\if@review +\newif\if@shortnames +\newif\if@nojss +\newif\if@notitle +\newif\if@noheadings +\newif\if@nofooter + +\@articletrue +\@codesnippetfalse +\@bookreviewfalse +\@softwarereviewfalse +\@reviewfalse +\@shortnamesfalse +\@nojssfalse +\@notitlefalse +\@noheadingsfalse +\@nofooterfalse + +\DeclareOption{article}{\@articletrue% + \@codesnippetfalse \@bookreviewfalse \@softwarereviewfalse} +\DeclareOption{codesnippet}{\@articlefalse% + \@codesnippettrue \@bookreviewfalse \@softwarereviewfalse} +\DeclareOption{bookreview}{\@articlefalse% + \@codesnippetfalse \@bookreviewtrue \@softwarereviewfalse} +\DeclareOption{softwarereview}{\@articlefalse% + \@codesnippetfalse \@bookreviewfalse \@softwarereviewtrue} +\DeclareOption{shortnames}{\@shortnamestrue} +\DeclareOption{nojss}{\@nojsstrue} +\DeclareOption{notitle}{\@notitletrue} +\DeclareOption{noheadings}{\@noheadingstrue} +\DeclareOption{nofooter}{\@nofootertrue} + +\ProcessOptions +\LoadClass[11pt,a4paper,twoside]{article} +%% required packages +\RequirePackage{graphicx,color,ae,fancyvrb} +\RequirePackage[T1]{fontenc} +\IfFileExists{upquote.sty}{\RequirePackage{upquote}}{} +\IfFileExists{lmodern.sty}{\RequirePackage{lmodern}}{} +%% bibliography +\if@shortnames + \usepackage[authoryear,round]{natbib} +\else + \usepackage[authoryear,round,longnamesfirst]{natbib} +\fi +\bibpunct{(}{)}{;}{a}{}{,} +\bibliographystyle{jss} +%% page layout +\topmargin 0pt +\textheight 46\baselineskip +\advance\textheight by \topskip +\oddsidemargin 0.1in +\evensidemargin 0.15in +\marginparwidth 1in +\oddsidemargin 0.125in +\evensidemargin 0.125in +\marginparwidth 0.75in +\textwidth 6.125in +%% paragraphs +\setlength{\parskip}{0.7ex plus0.1ex minus0.1ex} +\setlength{\parindent}{0em} +%% for all publications +\newcommand{\Address}[1]{\def\@Address{#1}} +\newcommand{\Plaintitle}[1]{\def\@Plaintitle{#1}} +\newcommand{\Shorttitle}[1]{\def\@Shorttitle{#1}} +\newcommand{\Plainauthor}[1]{\def\@Plainauthor{#1}} +\newcommand{\Volume}[1]{\def\@Volume{#1}} +\newcommand{\Year}[1]{\def\@Year{#1}} +\newcommand{\Month}[1]{\def\@Month{#1}} +\newcommand{\Issue}[1]{\def\@Issue{#1}} +\newcommand{\Submitdate}[1]{\def\@Submitdate{#1}} +%% for articles and code snippets +\newcommand{\Acceptdate}[1]{\def\@Acceptdate{#1}} +\newcommand{\Abstract}[1]{\def\@Abstract{#1}} +\newcommand{\Keywords}[1]{\def\@Keywords{#1}} +\newcommand{\Plainkeywords}[1]{\def\@Plainkeywords{#1}} +%% for book and software reviews +\newcommand{\Reviewer}[1]{\def\@Reviewer{#1}} +\newcommand{\Booktitle}[1]{\def\@Booktitle{#1}} +\newcommand{\Bookauthor}[1]{\def\@Bookauthor{#1}} +\newcommand{\Publisher}[1]{\def\@Publisher{#1}} +\newcommand{\Pubaddress}[1]{\def\@Pubaddress{#1}} +\newcommand{\Pubyear}[1]{\def\@Pubyear{#1}} +\newcommand{\ISBN}[1]{\def\@ISBN{#1}} +\newcommand{\Pages}[1]{\def\@Pages{#1}} +\newcommand{\Price}[1]{\def\@Price{#1}} +\newcommand{\Plainreviewer}[1]{\def\@Plainreviewer{#1}} +\newcommand{\Softwaretitle}[1]{\def\@Softwaretitle{#1}} +\newcommand{\URL}[1]{\def\@URL{#1}} +\newcommand{\DOI}[1]{\def\@DOI{#1}} +%% for internal use +\newcommand{\Seriesname}[1]{\def\@Seriesname{#1}} +\newcommand{\Hypersubject}[1]{\def\@Hypersubject{#1}} +\newcommand{\Hyperauthor}[1]{\def\@Hyperauthor{#1}} +\newcommand{\Footername}[1]{\def\@Footername{#1}} +\newcommand{\Firstdate}[1]{\def\@Firstdate{#1}} +\newcommand{\Seconddate}[1]{\def\@Seconddate{#1}} +\newcommand{\Reviewauthor}[1]{\def\@Reviewauthor{#1}} +%% defaults +\author{Firstname Lastname\\Affiliation} +\title{Title} +\Abstract{---!!!---an abstract is required---!!!---} +\Plainauthor{\@author} +\Volume{VV} +\Year{YYYY} +\Month{MMMMMM} +\Issue{II} +\Submitdate{yyyy-mm-dd} +\Acceptdate{yyyy-mm-dd} +\Address{ + Firstname Lastname\\ + Affiliation\\ + Address, Country\\ + E-mail: \email{name@address}\\ + URL: \url{http://link/to/webpage/} +} + +\Reviewer{Firstname Lastname\\Affiliation} +\Plainreviewer{Firstname Lastname} +\Booktitle{Book Title} +\Bookauthor{Book Author} +\Publisher{Publisher} +\Pubaddress{Publisher's Address} +\Pubyear{YYY} +\ISBN{x-xxxxx-xxx-x} +\Pages{xv + 123} +\Price{USD 69.95 (P)} +\URL{http://link/to/webpage/} +\DOI{10.18637/jss.v000.i00} +\if@article + \Seriesname{Issue} + \Hypersubject{Journal of Statistical Software} + \Plaintitle{\@title} + \Shorttitle{\@title} + \Plainkeywords{\@Keywords} +\fi + +\if@codesnippet + \Seriesname{Code Snippet} + \Hypersubject{Journal of Statistical Software -- Code Snippets} + \Plaintitle{\@title} + \Shorttitle{\@title} + \Plainkeywords{\@Keywords} +\fi + +\if@bookreview + \Seriesname{Book Review} + \Hypersubject{Journal of Statistical Software -- Book Reviews} + \Plaintitle{\@Booktitle} + \Shorttitle{\@Booktitle} + \Reviewauthor{\@Bookauthor\\ + \@Publisher, \@Pubaddress, \@Pubyear.\\ + ISBN~\@ISBN. \@Pages~pp. \@Price.\\ + \url{\@URL}} + \Plainkeywords{} + \@reviewtrue +\fi + +\if@softwarereview + \Seriesname{Software Review} + \Hypersubject{Journal of Statistical Software -- Software Reviews} + \Plaintitle{\@Softwaretitle} + \Shorttitle{\@Softwaretitle} + \Booktitle{\@Softwaretitle} + \Reviewauthor{\@Publisher, \@Pubaddress. \@Price.\\ + \url{\@URL}} + \Plainkeywords{} + \@reviewtrue +\fi + +\if@review + \Hyperauthor{\@Plainreviewer} + \Keywords{} + \Footername{Reviewer} + \Firstdate{\textit{Published:} \@Submitdate} + \Seconddate{} +\else + \Hyperauthor{\@Plainauthor} + \Keywords{---!!!---at least one keyword is required---!!!---} + \Footername{Affiliation} + \Firstdate{\textit{Submitted:} \@Submitdate} + \Seconddate{\textit{Accepted:} \@Acceptdate} +\fi +%% Sweave(-like) +\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl} +\DefineVerbatimEnvironment{Soutput}{Verbatim}{} +\DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl} +\newenvironment{Schunk}{}{} +\DefineVerbatimEnvironment{Code}{Verbatim}{} +\DefineVerbatimEnvironment{CodeInput}{Verbatim}{fontshape=sl} +\DefineVerbatimEnvironment{CodeOutput}{Verbatim}{} +\newenvironment{CodeChunk}{}{} +\setkeys{Gin}{width=0.8\textwidth} +%% footer +\newlength{\footerskip} +\setlength{\footerskip}{2.5\baselineskip plus 2ex minus 0.5ex} + +\newcommand{\makefooter}{% + \vspace{\footerskip} + + \if@nojss + \begin{samepage} + \textbf{\large \@Footername: \nopagebreak}\\[.3\baselineskip] \nopagebreak + \@Address \nopagebreak + \end{samepage} + \else + \begin{samepage} + \textbf{\large \@Footername: \nopagebreak}\\[.3\baselineskip] \nopagebreak + \@Address \nopagebreak + \vfill + \hrule \nopagebreak + \vspace{.1\baselineskip} + {\fontfamily{pzc} \fontsize{13}{15} \selectfont Journal of Statistical Software} + \hfill + \url{http://www.jstatsoft.org/}\\ \nopagebreak + published by the Foundation for Open Access Statistics + \hfill + \url{http://www.foastat.org/}\\[.3\baselineskip] \nopagebreak + {\@Month{} \@Year, Volume~\@Volume, \@Seriesname~\@Issue} + \hfill + \@Firstdate\\ \nopagebreak + {\href{https://doi.org/\@DOI}{\tt doi:\@DOI}} + \hfill + \@Seconddate \nopagebreak + \vspace{.3\baselineskip} + \hrule + \end{samepage} + \fi +} +\if@nofooter + %% \AtEndDocument{\makefooter} +\else + \AtEndDocument{\makefooter} +\fi +%% required packages +\RequirePackage{hyperref} +%% new \maketitle +\def\@myoddhead{ + {\color{white} JSS}\\[-1.42cm] + \hspace{-2em} \includegraphics[height=23mm,keepaspectratio]{jsslogo} \hfill + \parbox[b][23mm]{118mm}{\hrule height 3pt + \center{ + {\fontfamily{pzc} \fontsize{28}{32} \selectfont Journal of Statistical Software} + \vfill + {\it \small \@Month{} \@Year, Volume~\@Volume, \@Seriesname~\@Issue.% + \hfill \href{https://doi.org/\@DOI}{doi:\,\@DOI}}}\\[0.1cm] + \hrule height 3pt}} +\if@review + \renewcommand{\maketitle}{ + \if@nojss + %% \@oddhead{\@myoddhead}\\[3\baselineskip] + \else + \@oddhead{\@myoddhead}\\[3\baselineskip] + \fi + {\large + \noindent + Reviewer: \@Reviewer + \vspace{\baselineskip} + \hrule + \vspace{\baselineskip} + \textbf{\@Booktitle} + \begin{quotation} \noindent + \@Reviewauthor + \end{quotation} + \vspace{0.7\baselineskip} + \hrule + \vspace{1.3\baselineskip} + } + + \thispagestyle{empty} + \if@nojss + \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hyperauthor}} + \else + \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hypersubject}} + \fi + \pagestyle{myheadings} + } +\else + \def\maketitle{ + \if@nojss + %% \@oddhead{\@myoddhead} \par + \else + \@oddhead{\@myoddhead} \par + \fi + \begingroup + \def\thefootnote{\fnsymbol{footnote}} + \def\@makefnmark{\hbox to 0pt{$^{\@thefnmark}$\hss}} + \long\def\@makefntext##1{\parindent 1em\noindent + \hbox to1.8em{\hss $\m@th ^{\@thefnmark}$}##1} + \@maketitle \@thanks + \endgroup + \setcounter{footnote}{0} + + \if@noheadings + %% \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hypersubject}} + \else + \thispagestyle{empty} + \if@nojss + \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hyperauthor}} + \else + \markboth{\centerline{\@Shorttitle}}{\centerline{\@Hypersubject}} + \fi + \pagestyle{myheadings} + \fi + + \let\maketitle\relax \let\@maketitle\relax + \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax + } + + \def\@maketitle{\vbox{\hsize\textwidth \linewidth\hsize + \if@nojss + %% \vskip 1in + \else + \vskip 1in + \fi + {\centering + {\LARGE\bf \@title\par} + \vskip 0.2in plus 1fil minus 0.1in + { + \def\and{\unskip\enspace{\rm and}\enspace}% + \def\And{\end{tabular}\hss \egroup \hskip 1in plus 2fil + \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\large\bf\rule{\z@}{24pt}\ignorespaces}% + \def\AND{\end{tabular}\hss\egroup \hfil\hfil\egroup + \vskip 0.1in plus 1fil minus 0.05in + \hbox to \linewidth\bgroup\rule{\z@}{10pt} \hfil\hfil + \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\large\bf\rule{\z@}{24pt}\ignorespaces} + \hbox to \linewidth\bgroup\rule{\z@}{10pt} \hfil\hfil + \hbox to 0pt\bgroup\hss \begin{tabular}[t]{c}\large\bf\rule{\z@}{24pt}\@author + \end{tabular}\hss\egroup + \hfil\hfil\egroup} + \vskip 0.3in minus 0.1in + \hrule + \begin{abstract} + \@Abstract + \end{abstract}} + \textit{Keywords}:~\@Keywords. + \vskip 0.1in minus 0.05in + \hrule + \vskip 0.2in minus 0.1in + }} +\fi +%% sections, subsections, and subsubsections +\newlength{\preXLskip} +\newlength{\preLskip} +\newlength{\preMskip} +\newlength{\preSskip} +\newlength{\postMskip} +\newlength{\postSskip} +\setlength{\preXLskip}{1.8\baselineskip plus 0.5ex minus 0ex} +\setlength{\preLskip}{1.5\baselineskip plus 0.3ex minus 0ex} +\setlength{\preMskip}{1\baselineskip plus 0.2ex minus 0ex} +\setlength{\preSskip}{.8\baselineskip plus 0.2ex minus 0ex} +\setlength{\postMskip}{.5\baselineskip plus 0ex minus 0.1ex} +\setlength{\postSskip}{.3\baselineskip plus 0ex minus 0.1ex} + +\newcommand{\jsssec}[2][default]{\vskip \preXLskip% + \pdfbookmark[1]{#1}{Section.\thesection.#1}% + \refstepcounter{section}% + \centerline{\textbf{\Large \thesection. #2}} \nopagebreak + \vskip \postMskip \nopagebreak} +\newcommand{\jsssecnn}[1]{\vskip \preXLskip% + \centerline{\textbf{\Large #1}} \nopagebreak + \vskip \postMskip \nopagebreak} + +\newcommand{\jsssubsec}[2][default]{\vskip \preMskip% + \pdfbookmark[2]{#1}{Subsection.\thesubsection.#1}% + \refstepcounter{subsection}% + \textbf{\large \thesubsection. #2} \nopagebreak + \vskip \postSskip \nopagebreak} +\newcommand{\jsssubsecnn}[1]{\vskip \preMskip% + \textbf{\large #1} \nopagebreak + \vskip \postSskip \nopagebreak} + +\newcommand{\jsssubsubsec}[2][default]{\vskip \preSskip% + \pdfbookmark[3]{#1}{Subsubsection.\thesubsubsection.#1}% + \refstepcounter{subsubsection}% + {\large \textit{#2}} \nopagebreak + \vskip \postSskip \nopagebreak} +\newcommand{\jsssubsubsecnn}[1]{\vskip \preSskip% + {\textit{\large #1}} \nopagebreak + \vskip \postSskip \nopagebreak} + +\newcommand{\jsssimplesec}[2][default]{\vskip \preLskip% +%% \pdfbookmark[1]{#1}{Section.\thesection.#1}% + \refstepcounter{section}% + \textbf{\large #1} \nopagebreak + \vskip \postSskip \nopagebreak} +\newcommand{\jsssimplesecnn}[1]{\vskip \preLskip% + \textbf{\large #1} \nopagebreak + \vskip \postSskip \nopagebreak} + +\if@review + \renewcommand{\section}{\secdef \jsssimplesec \jsssimplesecnn} + \renewcommand{\subsection}{\secdef \jsssimplesec \jsssimplesecnn} + \renewcommand{\subsubsection}{\secdef \jsssimplesec \jsssimplesecnn} +\else + \renewcommand{\section}{\secdef \jsssec \jsssecnn} + \renewcommand{\subsection}{\secdef \jsssubsec \jsssubsecnn} + \renewcommand{\subsubsection}{\secdef \jsssubsubsec \jsssubsubsecnn} +\fi +%% colors +\definecolor{Red}{rgb}{0.5,0,0} +\definecolor{Blue}{rgb}{0,0,0.5} +\if@review + \hypersetup{% + hyperindex = {true}, + colorlinks = {true}, + linktocpage = {true}, + plainpages = {false}, + linkcolor = {Blue}, + citecolor = {Blue}, + urlcolor = {Red}, + pdfstartview = {Fit}, + pdfpagemode = {None}, + pdfview = {XYZ null null null} + } +\else + \hypersetup{% + hyperindex = {true}, + colorlinks = {true}, + linktocpage = {true}, + plainpages = {false}, + linkcolor = {Blue}, + citecolor = {Blue}, + urlcolor = {Red}, + pdfstartview = {Fit}, + pdfpagemode = {UseOutlines}, + pdfview = {XYZ null null null} + } +\fi +\if@nojss + \AtBeginDocument{ + \hypersetup{% + pdfauthor = {\@Hyperauthor}, + pdftitle = {\@Plaintitle}, + pdfkeywords = {\@Plainkeywords} + } + } +\else + \AtBeginDocument{ + \hypersetup{% + pdfauthor = {\@Hyperauthor}, + pdftitle = {\@Plaintitle}, + pdfsubject = {\@Hypersubject}, + pdfkeywords = {\@Plainkeywords} + } + } +\fi +\if@notitle + %% \AtBeginDocument{\maketitle} +\else + \@ifundefined{AddToHook}{\AtBeginDocument{\maketitle}}{\AddToHook{begindocument}[maketitle]{\maketitle}} +\fi +%% commands +\newcommand\code{\bgroup\@makeother\_\@makeother\~\@makeother\$\@codex} +\def\@codex#1{{\normalfont\ttfamily\hyphenchar\font=-1 #1}\egroup} +%%\let\code=\texttt +\let\proglang=\textsf +\newcommand{\pkg}[1]{{\fontseries{m}\fontseries{b}\selectfont #1}} +\newcommand{\email}[1]{\href{mailto:#1}{\normalfont\texttt{#1}}} +\ifx\csname urlstyle\endcsname\relax + \newcommand\@doi[1]{doi:\discretionary{}{}{}#1}\else + \newcommand\@doi{doi:\discretionary{}{}{}\begingroup +\urlstyle{tt}\Url}\fi +\newcommand{\doi}[1]{\href{https://doi.org/#1}{\normalfont\texttt{\@doi{#1}}}} +\newcommand{\E}{\mathsf{E}} +\newcommand{\VAR}{\mathsf{VAR}} +\newcommand{\COV}{\mathsf{COV}} +\newcommand{\Prob}{\mathsf{P}} +\endinput +%% +%% End of file `jss.cls'. diff --git a/LaTeX/jsslogo.jpg b/LaTeX/jsslogo.jpg new file mode 100644 index 0000000..dd099db --- /dev/null +++ b/LaTeX/jsslogo.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9f97c51e25b2fe013c89751788aa71ea6958050b3993993cc2e4fcb0cbcf90c +size 22731 diff --git a/LaTeX/main.Rnw b/LaTeX/main.Rnw new file mode 100644 index 0000000..a6566a4 --- /dev/null +++ b/LaTeX/main.Rnw @@ -0,0 +1,152 @@ +\documentclass[article]{jss} + +\usepackage{thumbpdf, lmodern} % recommended by `JSS` +\usepackage{amsmath, amssymb, amstext} +% Configure `Sweave` +% Prevent `Sweave` to include its styles (line as is, already in `JSS` styles) +%% need no \usepackage{Sweave.sty} +%\SweaveUTF8 +<>= +options(prompt = "R> ", continue = "+ ", width = 70, useFancyQuotes = FALSE) +set.seed(1729) # taxicab number +@ + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Typesetting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \newcommand{\class}[1]{`\code{#1}'} +% \newcommand{\fct}[1]{\code{#1()}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Operators %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\renewcommand{\t}[1]{{#1}^{T}} +\renewcommand{\epsilon}{\varepsilon} +\renewcommand{\E}{\operatorname{\mathbb{E}}} +\newcommand{\var}{\operatorname{Var}} +% \newcommand{\sd}{\operatorname{sd}} +% \newcommand{\independent}{\operatorname{\bot\!\!\!\bot}} +% \newcommand{\stiefel}[2]{\operatorname{St_{#2}}(\mathbb{R}^{#1})} +% \newcommand{\grassmann}[2]{\operatorname{Gr_{#2}}(\mathbb{R}^{#1})} +% \newcommand{\orthogonalGroup}[1]{\operatorname{O}(#1)} +% \newcommand{\argmin}{\operatorname*{arg\,min}} +% \newcommand{\argmax}{\operatorname*{arg\,max}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Meta Information %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\author{Daniel Kapla\\TU Wien + \And Lukas Fertl\\TU Wien + \And Efstathia Bura\\TU Wien} +\Plainauthor{Daniel Kapla, Lukas Fertl, Efstathia Bura} + +%% - \title{} in title case +%% - \Plaintitle{} without LaTeX markup (if any) +%% - \Shorttitle{} with LaTeX markup (if any), used as running title +\title{Conditional Variance Estimation With the \pkg{CVE} Package in \proglang{R}} +\Plaintitle{Conditional Variance Estimation With the CVE Package in R} +\Shorttitle{The \pkg{CVE} Package} + +\Abstract{ + Conditional variance estimation (CVE) is a novel sufficient dimension + reduction (SDR) method for regressions satisfying $\E(Y | X) = \E(Y | \t{B} X)$, + where $\t{B}X$ is a lower dimensional projection of the predictors. CVE, + similarly to its main competitor, the mean average variance estimation (MAVE), + is not based on inverse regression, and does not require the restrictive + linearity and constant variance conditions of moment based SDR methods. CVE + is data-driven and applies to additive error regressions with continuous + predictors and link function. Let $Y$ be a real univariate response and $X$ + a real $p$-dimensional covariate vector. We assume that the dependence of + $Y$ and $X$ is modelled by + \begin{displaymath} + Y = g(\t{B}X) + \epsilon + \end{displaymath} + where $X$ is independent of $\epsilon$ with positive definite variance-covariance + matrix $\var(X) = \Sigma_X$. $\epsilon$ is a mean zero random variable with + finite $\var(\epsilon) = \E(\epsilon^2)$, $g$ is an unknown, continuous + non-constant function, and $B = (b_1 , ..., b_k)$ is a real $p \times k$ + matrix of rank $k \leq p$. Without loss of generality $B$ is assumed to be + orthonormal. +} + +%% - \Keywords{} with LaTeX markup, at least one required +%% - \Plainkeywords{} without LaTeX markup (if necessary) +%% - Should be comma-separated and in sentence case. +\Keywords{Dimension reduction, \proglang{R}} +\Plainkeywords{Dimension reduction, R} + +%% - \Address{} of at least one author +%% - May contain multiple affiliations for each author +%% (in extra lines, separated by \emph{and}\\). +%% - May contain multiple authors for the same affiliation +%% (in the same first line, separated by comma). +\Address{ + Daniel Kapla\\ + Technische Universit\"at Wien\\ + Institute of Statistics and Mathematical Methods in Economics\\ + Faculty of Mathematics and Geoinformation\\ + TU Wien, Vienna, Austria\\ + E-mail: \email{daniel.kapla@tuwien.ac.at}\\ + URL: \url{https://kapla.at}\\ + \\ + Lukas Fertl\\ + Technische Universit\"at Wien\\ + Institute of Statistics and Mathematical Methods in Economics\\ + Faculty of Mathematics and Geoinformation\\ + TU Wien, Vienna, Austria\\ + E-mail: \email{lukas.fertl@tuwien.ac.at}\\ + \\ + Efstathia Bura\\ + Technische Universit\"at Wien\\ + Institute of Statistics and Mathematical Methods in Economics\\ + Faculty of Mathematics and Geoinformation\\ + TU Wien, Vienna, Austria +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Document %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} + +\section[Introduction: Sufficient dimension reduction in R]{Introduction: Sufficient dimension reduction in \proglang{R}}\label{sec:intro} + +A bit of text +<<>>= +library(CVE) + +dataset <- function(n, p = 20, p.mix = 0.5, lambda = 1, sd = 0.5) { + B <- rep(1 / sqrt(p), p) + # B <- c(rep(1 / sqrt(p), p / 2), rep(-1 / sqrt(p), p / 2)) + X <- matrix(rnorm(n * p), n, p) + X <- X + lambda * (2 * rbinom(n, 1, p.mix) - 1) + Y <- abs(X %*% B) + rnorm(n, 0, sd) + list(B = B, X = X, Y = Y) +} + +ds <- dataset(100) +ds.test <- dataset(100) +@ +Then we apply both methods, the \code{CVE} and the \code{MAVE} methods +<<>>= +fit.cve <- with(ds, cve(Y ~ X, k = 1)) +fit.mave <- with(ds, MAVE::mave(Y ~ X, max.dim = 1, method = "meanMAVE")) +@ +Get the estimated reduction matrices +<<>>= +B.cve <- coef(fit.cve, 1) +B.mave <- coef(fit.mave, 1) +@ +and compute the prediction errors +<<>>= +Y.hat.cve <- with(ds.test, predict(fit.cve, X, 1)) +Y.hat.mave <- with(ds.test, predict(fit.mave, X, 1)) +# MSE - cve +mean((ds.test$Y - Y.hat.cve)^2) +# MSE - mave +mean((ds.test$Y - Y.hat.mave)^2) +@ +and another bit of text + + +\newpage % required! Fixes vertical spacing problems with code chunks (last page) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Bibliography %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% - References need to be provided in a .bib BibTeX database. +%% - All references should be made with \cite, \citet, \citep, \citealp etc. +%% - `JSS` - specific markup (\proglang, \pkg, \code) should be used in the .bib. +%% - Titles in the .bib should be in title case. +%% - DOIs should be included where available. +\bibliography{refs} + +\end{document} diff --git a/LaTeX/refs.bib b/LaTeX/refs.bib new file mode 100644 index 0000000..e4fe954 --- /dev/null +++ b/LaTeX/refs.bib @@ -0,0 +1,35 @@ +@Manual{R, + title = {\proglang{R}: {A} Language and Environment for Statistical Computing}, + author = {{\proglang{R} Core Team}}, + organization = {\proglang{R} Foundation for Statistical Computing}, + address = {Vienna, Austria}, + year = {2020}, + url = {https://www.R-project.org/}, +} + +@Manual{pkg:MAVE, + title = {\pkg{MAVE}: Methods for Dimension Reduction}, + author = {Hang Weiqiang and Xia Yingcun}, + year = {2019}, + note = {\proglang{R} package version 1.3.10}, + url = {https://CRAN.R-project.org/package=MAVE} +} + +@Book{pkg:MASS, + title = {Modern Applied Statistics with S}, + author = {W. N. Venables and B. D. Ripley}, + publisher = {Springer}, + edition = {Fourth}, + address = {New York}, + year = {2002}, + note = {ISBN 0-387-95457-0}, + url = {http://www.stats.ox.ac.uk/pub/MASS4/} +} + +@Manual{pkg:mda, + title = {\pkg{mda}: Mixture and Flexible Discriminant Analysis}, + author = {S original by Trevor Hastie & Robert Tibshirani. Original R port by Friedrich Leisch and Kurt Hornik and Brian D. Ripley.}, + year = {2017}, + note = {\proglang{R} package version 0.4-10}, + url = {https://CRAN.R-project.org/package=mda} +}