-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.Rmd
165 lines (138 loc) · 5.11 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
---
title: |
Application of GLM Advancements \
to Non-Life Insurance Pricing
author: Leonardo Stincone
author-title: Laureando
college: |
Scienze Economiche, Aziendali, Matematiche e Statistiche
degree: Scienze Statistiche e Attuariali
degreedate: May 2021
universityname: Università degli Studi di Trieste
departmentname: |
Scienze Economiche, Aziendali, Matematiche e Statistiche
# university-logo: figures/university-logo.png
university-logo: figures/units-sigillo-pantone-534.pdf
degreedef: Tesi di Laurea Magistrale
degreename: Scienze Statistiche e Attuariali
degreeclass: LM-83
academicyear: 2019 - 2020
advisorname: Prof. Francesco Pauli
# abbreviations: "extra/abbreviations" # path to .tex file with abbreviations
abbreviations: "extra/abbreviations" # path to .tex file with abbreviations
quote: |
\href{https://twitter.com/josh_wills/status/198093512149958656?lang=en}{The data scientist is a person \\
who is better at statistics than any software engineer \\
and better at software engineering than any statistician.}
quote-author: \href{https://twitter.com/josh_wills/status/198093512149958656?lang=en}{Josh Wills}
bibliography: references.bib
bibliography-heading-in-pdf: Bibliography
do-abstract: false
abstract: false
#abstractseparate: false # include front page w/ abstract for examination schools?
acknowledgements: false
bib-humanities: false # set to true if you want in-text references formatted as author-year
doi-in-bibliography: false # set to true if you want DOI's to be shown in the bibliography
url-in-bibliography: false # set to true if you want DOI's to be shown in the bibliography. By default, it is linked under the publication name.
draft: false # add as DRAFT mark in the footer?
# documentclass: book
# page-layout: 'twoside, openright'
# page-layout: 'nobind' #'nobind' for PDF output (equal margins), 'twoside' for two-sided binding (mirror margins and blank pages), leave blank for one-sided binding (left margin > right margin)
hidelinks: false #if false, the PDF output highlights colored links - you will probably want to set this to true for PDF version you wish to physically print
toc-depth: 3 # depth of heading to include in table of contents
lof: true # list of figures in back matter?
lot: true # list of tables in back matter?
mini-toc: false # mini-table of contents at start of each chapter? (this just prepares it; you must also add \minitoc after the chapter titles)
mini-lot: false # mini-list of tables by start of each chapter?
mini-lof: false # mini-list of figures by start of each chapter?
loa: false # list of acronyms
output:
bookdown::pdf_book:
template: templates/template.tex
keep_tex: true
citation_package: biblatex
extra_dependecies: subfig
pandoc_args: ["--lua-filter=scripts_and_filters/custom_filters.lua"]
bookdown::gitbook:
css: templates/style.css
config:
toc:
scroll_highlight: yes
edit:
info: no
sharing:
facebook: yes
twitter: yes
github: yes
linkedin: yes
all: false
bookdown::word_document2:
toc: true
link-citations: true
always_allow_html: true
editor_options:
chunk_output_type: console
---
```{r global_options, include=FALSE}
library(tidyverse)
library(lubridate) # For datetime
library(knitr)
library(kableExtra)
library(scales) # For colors
library(viridis) # For colors
library(ggeasy)
library(ggforce) # For plotting ellipses
library(gridExtra)
library(GGally) # For ggpairs()
library(cowplot)
library(grid)
library(gtable)
library(mgcv)
library(splines)
library(forcats)
library(glmnet) # For Elastic Net
library(LaplacesDemon) # For Laplace density function
# Option for figure position
# knitr::opts_chunk$set(fig.pos = 'hbtp')
knitr::opts_chunk$set(fig.pos = '!hbtp')
# Option for number rendering in inline code
inline_hook <- function(x) {
if (is.numeric(x)) {
format(x, scientific = FALSE, big.mark = " ")
} else x
}
knitr::knit_hooks$set(inline = inline_hook)
# Option for printing '' for NA values in tables
options(knitr.kable.NA = '')
# For changing the font of specific cells in kable
format_cell <- function(df, rows, cols, value = c("italics", "bold", "strikethrough")){
# select the correct markup
# one * for italics, two ** for bold
map <- setNames(c("*", "**", "~~"), c("italics", "bold", "strikethrough"))
markup <- map[value]
for (r in rows){
for(c in cols){
# Make sure values are not factors
df[[c]] <- as.character(df[[c]])
# Update formatting
df[r, c] <- paste0(markup, df[r, c], markup)
}
}
return(df)
}
# ggplot theme
theme_set(theme_bw())
# Color palette
col1 <- hue_pal()(2)[1]
col2 <- hue_pal()(2)[2]
# col1 <- rgb(140, 8, 8, maxColorValue = 255) # Red
# col1 <- rgb(194, 27, 23, maxColorValue = 255) # Brick red
# col2 <- rgb(127, 127, 127, maxColorValue = 255) # Grey
# col2 <- rgb(191, 191, 191, maxColorValue = 255) # Light grey
## Show colors
# show_col(c(col1, col2))
```
```{r create_chunk_options, include=FALSE, eval=knitr::is_latex_output()}
source('scripts_and_filters/create_chunk_options.R')
source('scripts_and_filters/wrap_lines.R')
```