Debian Codegraph @

texmf-dist/source/latex/lstbayes/lstbayes.dtx

raw
1 %%%%%%%%% \iffalse meta-comment
2 %
3 % Copyright (C) 2018 by Jeffrey B. Arnold <[email protected]>
4 % ---------------------------------------------------------------------------
5 % This work may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either version 1.3
7 % of this license or (at your option) any later version.
8 % The latest version of this license is in
9 % http://www.latex-project.org/lppl.txt
10 % and version 1.3 or later is part of all distributions of LaTeX
11 % version 2005/12/01 or later.
12 %
13 % This work has the LPPL maintenance status `maintained'.
14 %
15 % The Current Maintainer of this work is Jeffrey B. Arnold.
16 %
17 % This work consists of the files lstbayes.dtx and lstbayes.ins
18 % and the derived filebase lstbayes.sty.
19 %
20 % \fi
21 %
22 % \iffalse
23 %<*driver>
24 \ProvidesFile{lstbayes.dtx}
25 %</driver>
26 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
27 %<package>\ProvidesPackage{lstbayes}
28 %<*package>
29 [2018/07/06 lstbayes listings language drivers for BUGS, JAGS, and Stan]
30 %</package>
31 %
32 %<*driver>
33 \documentclass{ltxdoc}
34 \usepackage{lstbayes}
35 \usepackage{hyperref}
36 \EnableCrossrefs
37 \CodelineIndex
38 \RecordChanges
39 \begin{document}
40 \DocInput{lstbayes.dtx}
41 \PrintChanges
42 \PrintIndex
43 \end{document}
44 %</driver>
45 % \fi
46 %
47 % \CheckSum{12}
48 %
49 % \CharacterTable
50 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
51 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
52 % Digits \0\1\2\3\4\5\6\7\8\9
53 % Exclamation \! Double quote \" Hash (number) \#
54 % Dollar \$ Percent \% Ampersand \&
55 % Acute accent \' Left paren \( Right paren \)
56 % Asterisk \* Plus \+ Comma \,
57 % Minus \- Point \. Solidus \/
58 % Colon \: Semicolon \; Less than \<
59 % Equals \= Greater than \> Question mark \?
60 % Commercial at \@ Left bracket \[ Backslash \\
61 % Right bracket \] Circumflex \^ Underscore \_
62 % Grave accent \` Left brace \{ Vertical bar \|
63 % Right brace \} Tilde \~}
64 %
65 %
66 % \changes{2015-09-26}{2015/09/26}{Converted to DTX file}
67 % \changes{2015-09-27}{2015/09/27}{Fix README}
68 % \changes{2015-09-28}{2015/09/27}{Fix README. Add keywords for all built-in functions that are in Stan v2.8.0.}
69 %
70 % \DoNotIndex{\newcommand,\newenvironment}
71 %
72 % \providecommand*{\url}{\texttt}
73 % \GetFileInfo{lstbayes.dtx}
74 % \title{The \textsf{lstbayes} package}
75 % \author{Jeffrey B. Arnold \\ \url{[email protected]}}
76 % \date{\fileversion~from \filedate}
77 %
78 % \maketitle
79 %
80 % \section{Introduction}
81 %
82 % This package provides language drivers for the \href{https://www.ctan.org/tex-archive/macros/latex/contrib/listings/}{\textsf{listings}} package for the several Bayesian modeling languages: BUGS, JAGS, and Stan.
83 %
84 % \section{Usage}
85 %
86 % % See the documentation of the \textsf{listings} package.
87 %
88
89 %
90 % \StopEventually{}
91 %
92 % \section{Implementation}
93 %
94 % \iffalse
95 %<*package>
96 % \fi
97 %
98 % \begin{macrocode}
99 \RequirePackage{listings}
100 % \end{macrocode}
101 %
102 % \subsection{BUGS}
103 %
104 % Language driver for BUGS, including \href{http://www.openbugs.net/w/FrontPage}{WinBUGS} and \href{http://openbugs.net}{OpenBUGS}.
105 % The driver is based on \href{http://www.openbugs.net/Manuals/Manual.html}{OpenBUGS v. 3.2.3}.
106 %
107 % \begin{macrocode}
108 \lstdefinelanguage{BUGS}{
109 morekeywords=[1]{for,in,model,T,I,C},%
110 morecomment=[l]{\#},%
111 sensitive=true,%
112 alsoletter={.},%
113 otherkeywords={<-,~},%
114 literate={<-}{{$\leftarrow$}}1 {~}{{$\sim$}}1%
115 }
116 \lstalias[]{OpenBUGS}[]{BUGS}
117 \lstalias[]{WinBUGS}[]{BUGS}
118 % \end{macrocode}
119 %
120 % \subsection{JAGS}
121 %
122 % Language driver for \href{http://mcmc-jags.sourceforge.net/}{JAGS}.
123 % The driver is based on JAGS version 3.4.0 (Sept 4, 2013).
124 %
125 %
126 % \begin{macrocode}
127 \lstdefinelanguage[]{JAGS}[]{BUGS}{
128 morekeywords=[1]{data,var,const},%
129 morecomment=[n]{/*}{*/}%
130 }
131 % \end{macrocode}
132 %
133 % \subsection{Stan}
134 %
135 % Language driver for \href{http://mc-stan.org/}{Stan}.
136 % The driver is based on Stan modeling language version \href{https://github.com/stan-dev/stan/releases/download/v2.17.0/stan-reference-2.17.0.pdf}{2.17.0}.
137 %
138 % \begin{macrocode}
139 \lstdefinelanguage{Stan}{
140 morekeywords=[1]{%
141 functions,%
142 data,%
143 else,%
144 for,%
145 generated,%
146 if,%
147 in,%
148 increment_log_prob,%
149 integrate_ode_bdf,%
150 integrate_ode_rk45,%
151 integrate_ode,%
152 lower,%
153 model,%
154 parameters,%
155 print,%
156 quantities,%
157 reject,%
158 return,%
159 T,%
160 target,%
161 transformed,%
162 upper,%
163 while%
164 },%
165 morekeywords=[2]{%
166 cholesky_factor_corr,%
167 cholesky_factor_cov,%
168 corr_matrix,%
169 cov_matrix,%
170 int,%
171 matrix,%
172 ordered,%
173 positive_ordered,%
174 real,%
175 row_vector,%
176 simplex,%
177 unit_vector,%
178 vector,%
179 void%
180 },%
181 morekeywords=[3]{%
182 Phi,%
183 Phi_approx,%
184 abs,%
185 acos,%
186 acosh,%
187 algebra_solver,%
188 append_array,%
189 append_col,%
190 append_row,%
191 asin,%
192 asinh,%
193 atan,%
194 atan2,%
195 atanh,%
196 bernoulli,%
197 bernoulli_cdf,%
198 bernoulli_lccdf,%
199 bernoulli_lcdf,%
200 bernoulli_logit,%
201 bernoulli_logit_lpmf,%
202 bernoulli_logit_rng,%
203 bernoulli_lpmf,%
204 bernoulli_rng,%
205 bessel_first_kind,%
206 bessel_second_kind,%
207 beta,%
208 beta_binomial,%
209 beta_binomial_cdf,%
210 beta_binomial_lccdf,%
211 beta_binomial_lcdf,%
212 beta_binomial_lpmf,%
213 beta_binomial_rng,%
214 beta_cdf,%
215 beta_lccdf,%
216 beta_lcdf,%
217 beta_lpdf,%
218 beta_rng,%
219 binary_log_loss,%
220 binomial,%
221 binomial_cdf,%
222 binomial_coefficient_log,%
223 binomial_lccdf,%
224 binomial_lcdf,%
225 binomial_logit,%
226 binomial_logit_lpmf,%
227 binomial_lpmf,%
228 binomial_rng,%
229 block,%
230 categorical,%
231 categorical_logit,%
232 categorical_logit_lpmf,%
233 categorical_logit_rng,%
234 categorical_lpmf,%
235 categorical_rng,%
236 cauchy,%
237 cauchy_cdf,%
238 cauchy_lccdf,%
239 cauchy_lcdf,%
240 cauchy_lpdf,%
241 cauchy_rng,%
242 cbrt,%
243 ceil,%
244 chi_square,%
245 chi_square_cdf,%
246 chi_square_lccdf,%
247 chi_square_lcdf,%
248 chi_square_lpdf,%
249 chi_square_rng,%
250 cholesky_decompose,%
251 choose,%
252 col,%
253 cols,%
254 columns_dot_product,%
255 columns_dot_self,%
256 cos,%
257 cosh,%
258 cov_exp_quad,%
259 crossprod,%
260 csr_extract_u,%
261 csr_extract_v,%
262 csr_extract_w,%
263 csr_matrix_times_vector,%
264 csr_to_dense_matrix,%
265 cumulative_sum,%
266 determinant,%
267 diag_matrix,%
268 diag_post_multiply,%
269 diag_pre_multiply,%
270 diagonal,%
271 digamma,%
272 dims,%
273 dirichlet,%
274 dirichlet_lpdf,%
275 dirichlet_rng,%
276 distance,%
277 dot_product,%
278 dot_self,%
279 double_exponential,%
280 double_exponential_cdf,%
281 double_exponential_lccdf,%
282 double_exponential_lcdf,%
283 double_exponential_lpdf,%
284 double_exponential_rng,%
285 e,%
286 eigenvalues_sym,%
287 eigenvectors_sym,%
288 erf,%
289 erfc,%
290 exp,%
291 exp2,%
292 exp_mod_normal,%
293 exp_mod_normal_cdf,%
294 exp_mod_normal_lccdf,%
295 exp_mod_normal_lcdf,%
296 exp_mod_normal_lpdf,%
297 exp_mod_normal_rng,%
298 expm1,%
299 exponential,%
300 exponential_cdf,%
301 exponential_lccdf,%
302 exponential_lcdf,%
303 exponential_lpdf,%
304 exponential_rng,%
305 fabs,%
306 falling_factorial,%
307 fdim,%
308 floor,%
309 fma,%
310 fmax,%
311 fmin,%
312 fmod,%
313 frechet,%
314 frechet_cdf,%
315 frechet_lccdf,%
316 frechet_lcdf,%
317 frechet_lpdf,%
318 frechet_rng,%
319 gamma,%
320 gamma_cdf,%
321 gamma_lccdf,%
322 gamma_lcdf,%
323 gamma_lpdf,%
324 gamma_p,%
325 gamma_q,%
326 gamma_rng,%
327 gaussian_dlm_obs,%
328 gaussian_dlm_obs_lpdf,%
329 get_lp,%
330 gumbel,%
331 gumbel_cdf,%
332 gumbel_lccdf,%
333 gumbel_lcdf,%
334 gumbel_lpdf,%
335 gumbel_rng,%
336 head,%
337 hypergeometric,%
338 hypergeometric_lpmf,%
339 hypergeometric_rng,%
340 hypot,%
341 inc_beta,%
342 int_step,%
343 integrate_ode,%
344 integrate_ode_bdf,%
345 integrate_ode_rk45,%
346 inv,%
347 inv_Phi,%
348 inv_chi_square,%
349 inv_chi_square_cdf,%
350 inv_chi_square_lccdf,%
351 inv_chi_square_lcdf,%
352 inv_chi_square_lpdf,%
353 inv_chi_square_rng,%
354 inv_cloglog,%
355 inv_gamma,%
356 inv_gamma_cdf,%
357 inv_gamma_lccdf,%
358 inv_gamma_lcdf,%
359 inv_gamma_lpdf,%
360 inv_gamma_rng,%
361 inv_logit,%
362 inv_sqrt,%
363 inv_square,%
364 inv_wishart,%
365 inv_wishart_lpdf,%
366 inv_wishart_rng,%
367 inverse,%
368 inverse_spd,%
369 is_inf,%
370 is_nan,%
371 lbeta,%
372 lchoose,%
373 lgamma,%
374 lkj_corr,%
375 lkj_corr_cholesky,%
376 lkj_corr_cholesky_lpdf,%
377 lkj_corr_cholesky_rng,%
378 lkj_corr_lpdf,%
379 lkj_corr_rng,%
380 lmgamma,%
381 lmultiply,%
382 log,%
383 log10,%
384 log1m,%
385 log1m_exp,%
386 log1m_inv_logit,%
387 log1p,%
388 log1p_exp,%
389 log2,%
390 log_determinant,%
391 log_diff_exp,%
392 log_falling_factorial,%
393 log_inv_logit,%
394 log_mix,%
395 log_rising_factorial,%
396 log_softmax,%
397 log_sum_exp,%
398 logistic,%
399 logistic_cdf,%
400 logistic_lccdf,%
401 logistic_lcdf,%
402 logistic_lpdf,%
403 logistic_rng,%
404 logit,%
405 lognormal,%
406 lognormal_cdf,%
407 lognormal_lccdf,%
408 lognormal_lcdf,%
409 lognormal_lpdf,%
410 lognormal_rng,%
411 machine_precision,%
412 matrix_exp,%
413 max,%
414 mdivide_left_spd,%
415 mdivide_left_tri_low,%
416 mdivide_right_spd,%
417 mdivide_right_tri_low,%
418 mean,%
419 min,%
420 modified_bessel_first_kind,%
421 modified_bessel_second_kind,%
422 multi_gp,%
423 multi_gp_cholesky,%
424 multi_gp_cholesky_lpdf,%
425 multi_gp_lpdf,%
426 multi_normal,%
427 multi_normal_cholesky,%
428 multi_normal_cholesky_lpdf,%
429 multi_normal_cholesky_rng,%
430 multi_normal_lpdf,%
431 multi_normal_prec,%
432 multi_normal_prec_lpdf,%
433 multi_normal_rng,%
434 multi_student_t,%
435 multi_student_t_lpdf,%
436 multi_student_t_rng,%
437 multinomial,%
438 multinomial_lpmf,%
439 multinomial_rng,%
440 multiply_log,%
441 multiply_lower_tri_self_transpose,%
442 neg_binomial,%
443 neg_binomial_2,%
444 neg_binomial_2_cdf,%
445 neg_binomial_2_lccdf,%
446 neg_binomial_2_lcdf,%
447 neg_binomial_2_log,%
448 neg_binomial_2_log_lpmf,%
449 neg_binomial_2_log_rng,%
450 neg_binomial_2_lpmf,%
451 neg_binomial_2_rng,%
452 neg_binomial_cdf,%
453 neg_binomial_lccdf,%
454 neg_binomial_lcdf,%
455 neg_binomial_lpmf,%
456 neg_binomial_rng,%
457 negative_infinity,%
458 normal,%
459 normal_cdf,%
460 normal_lccdf,%
461 normal_lcdf,%
462 normal_lpdf,%
463 normal_rng,%
464 not_a_number,%
465 num_elements,%
466 ordered_logistic,%
467 ordered_logistic_lpmf,%
468 ordered_logistic_rng,%
469 owens_t,%
470 pareto,%
471 pareto_cdf,%
472 pareto_lccdf,%
473 pareto_lcdf,%
474 pareto_lpdf,%
475 pareto_rng,%
476 pareto_type_2,%
477 pareto_type_2_cdf,%
478 pareto_type_2_lccdf,%
479 pareto_type_2_lcdf,%
480 pareto_type_2_lpdf,%
481 pareto_type_2_rng,%
482 pi,%
483 poisson,%
484 poisson_cdf,%
485 poisson_lccdf,%
486 poisson_lcdf,%
487 poisson_log,%
488 poisson_log_lpmf,%
489 poisson_log_rng,%
490 poisson_lpmf,%
491 poisson_rng,%
492 positive_infinity,%
493 pow,%
494 print,%
495 prod,%
496 qr_Q,%
497 qr_R,%
498 quad_form,%
499 quad_form_diag,%
500 quad_form_sym,%
501 rank,%
502 rayleigh,%
503 rayleigh_cdf,%
504 rayleigh_lccdf,%
505 rayleigh_lcdf,%
506 rayleigh_lpdf,%
507 rayleigh_rng,%
508 reject,%
509 rep_array,%
510 rep_matrix,%
511 rep_row_vector,%
512 rep_vector,%
513 rising_factorial,%
514 round,%
515 row,%
516 rows,%
517 rows_dot_product,%
518 rows_dot_self,%
519 scaled_inv_chi_square,%
520 scaled_inv_chi_square_cdf,%
521 scaled_inv_chi_square_lccdf,%
522 scaled_inv_chi_square_lcdf,%
523 scaled_inv_chi_square_lpdf,%
524 scaled_inv_chi_square_rng,%
525 sd,%
526 segment,%
527 sin,%
528 singular_values,%
529 sinh,%
530 size,%
531 skew_normal,%
532 skew_normal_cdf,%
533 skew_normal_lccdf,%
534 skew_normal_lcdf,%
535 skew_normal_lpdf,%
536 skew_normal_rng,%
537 softmax,%
538 sort_asc,%
539 sort_desc,%
540 sort_indices_asc,%
541 sort_indices_desc,%
542 sqrt,%
543 sqrt2,%
544 square,%
545 squared_distance,%
546 step,%
547 student_t,%
548 student_t_cdf,%
549 student_t_lccdf,%
550 student_t_lcdf,%
551 student_t_lpdf,%
552 student_t_rng,%
553 sub_col,%
554 sub_row,%
555 sum,%
556 tail,%
557 tan,%
558 tanh,%
559 target,%
560 tcrossprod,%
561 tgamma,%
562 to_array_1d,%
563 to_array_2d,%
564 to_matrix,%
565 to_row_vector,%
566 to_vector,%
567 trace,%
568 trace_gen_quad_form,%
569 trace_quad_form,%
570 trigamma,%
571 trunc,%
572 uniform,%
573 uniform_cdf,%
574 uniform_lccdf,%
575 uniform_lcdf,%
576 uniform_lpdf,%
577 uniform_rng,%
578 variance,%
579 von_mises,%
580 von_mises_lpdf,%
581 von_mises_rng,%
582 weibull,%
583 weibull_cdf,%
584 weibull_lccdf,%
585 weibull_lcdf,%
586 weibull_lpdf,%
587 weibull_rng,%
588 wiener,%
589 wiener_lpdf,%
590 wishart,%
591 wishart_lpdf,%
592 wishart_rng
593 },%
594 otherkeywords={.*=,./=,+=,-=,*=,/=,<-,~},%
595 sensitive=true,%
596 morecomment=[l]{\#},%
597 morecomment=[l]{//},%
598 morecomment=[n]{/*}{*/},%
599 string=[d]"%,
600 literate={<-}{{$\leftarrow$}}1 {~}{{$\sim$}}1%
601 }
602 % \end{macrocode}
603
604 %
605 % \iffalse
606 %</package>
607 % \fi
608 %
609 % \Finale