Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions Practicals/Aleksandra Dacko/P1/P1_Dacko.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: "P1_Dacko"
author: "Aleksandra Dacko"
date: "9/14/2022"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

```{r, warning=FALSE}
library(future)
library(tidyverse)
library(furrr)
library(DT)
library(ggplot2)
```
## Exercises for the first practical

### a), b)

```{r}

plan(multisession,workers=3)

NEW<-1:100 %>% future_map( function(x){
x <- rnorm(5000,mean=0,sd=1)
M <- mean(x)
AB<-M-0
DF <- length(x) - 1
SE <- 1 / sqrt(length(x))
QT<-(qt(.975, DF) * SE)
return(c(mean=M,
bias=AB,
std_err=SE,
lower=M-QT,
upper=M+QT,
cov = M - QT < 0 & 0 < M + QT))},.options = furrr_options(seed = 123),.progress = TRUE
) %>% do.call("rbind", .) %>% as_tibble

NEW
```
```{r}
NEW%>% colMeans()
```
### c)

```{r}
limits <- aes(ymax = NEW$upper, ymin = NEW$lower)


NEW %>% mutate(covered_by_95_CI = as.factor(cov)) %>%
ggplot(aes(y=mean, x=1:100, colour = covered_by_95_CI)) +
geom_hline(aes(yintercept = 0), color = "black", size = 2) +
geom_pointrange(limits) +
xlab("Simulations") +
ylab("Means and 95% Confidence Intervals")+ggtitle("The Simulation study of the 95% confidence intervals")+scale_color_manual(labels = c("not covered (4/100)","covered (96/100)"), values = c("maroon","lightseagreen"))
```

### d)

```{r}
NEW %>% round(4) %>% filter((lower>0 & upper>0 )| (lower<0 & upper<0) ) %>%select(-cov) %>% DT::datatable()
```
306 changes: 306 additions & 0 deletions Practicals/Aleksandra Dacko/P1/P1_Dacko.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practicals/Aleksandra Dacko/P1/my_puppy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions Practicals/Aleksandra Dacko/P2/P2_Dacko.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: "P2_ADacko"
author: "Aleksandra Dacko"
date: "11/1/2022"
output: html_document
---
# This is my function simulating the multilevel hidden markov model observations and state sequence.

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
require(mHMMbayes)
```


### Specify conditions
```{r}
n_t <- 100
n <- 10
m <- 2
n_dep <- 1
q_emiss <- 3
gamma <- matrix(c(0.8, 0.2,
0.3, 0.7), ncol = m, byrow = TRUE)
emiss_distr <- list(matrix(c(0.5, 0.5, 0.0,
0.1, 0.1, 0.8), nrow = m, ncol = q_emiss, byrow = TRUE))

```
### Run the simulation function
```{r}
set.seed(1234)
data1 <- sim_mHMM(n_t = n_t, n = n, gen = list(m = m, n_dep = n_dep, q_emiss = q_emiss),
gamma = gamma, emiss_distr = emiss_distr, var_gamma = .5, var_emiss = .5)

```
### Run mhmm() function over the sumulated data set
```{r, results='hide'}
out_2st_sim <- mHMM(s_data = data1$obs,
gen = list(m = m, n_dep = n_dep, q_emiss = q_emiss),
start_val = c(list(gamma), emiss_distr),
mcmc = list(J = 100, burn_in = 10))
```
### Plot the gamma estimations and obtain the group-level gamma estimations
```{r}
plot(out_2st_sim)
obtain_gamma(out_2st_sim)
```
### Add the session informations
```{r}
sessionInfo()
```


296 changes: 296 additions & 0 deletions Practicals/Aleksandra Dacko/P2/P2_Dacko.html

Large diffs are not rendered by default.

Binary file not shown.
13 changes: 13 additions & 0 deletions Practicals/Aleksandra Dacko/P4/P4.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX
13 changes: 13 additions & 0 deletions Practicals/Aleksandra Dacko/P5/P5.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX
68 changes: 68 additions & 0 deletions Practicals/Aleksandra Dacko/P5/bh.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: "Fibonacci sequence"
author: "Aleksandra Dacko"
date: "1/3/2023"
output: ioslides_presentation
logo: "images/logo.png"
bibliography: "references.bib"
---
<style>
div.footnotes {
position: absolute;
bottom: 0;
margin-bottom: 25px;
margin-left: 40px;
width: 80%;
font-size: 0.6em;
}
</style>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

<script>
$(document).ready(function() {
$('slide:not(.backdrop):not(.title-slide)').append('<div class=\"footnotes\">');

$('footnote').each(function(index) {
var text = $(this).html();
var fnNum = (index+1).toString().sup();
$(this).html(text + fnNum);

var footnote = fnNum + ': ' + $(this).attr('content') + '<br/>';
var oldContent = $(this).parents('slide').children('div.footnotes').html();
var newContent = oldContent + footnote;
$(this).parents('slide').children('div.footnotes').html(newContent);
});
});
</script>

<style>

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

## R Markdown

This is an R Markdown presentation. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.

## Slide with Bullets

- Bullet 1
- Bullet 2
- Bullet 3

## Slide with R Output

```{r cars, echo = TRUE}
summary(cars)
```

## Slide with Plot

```{r pressure}
plot(pressure)
```

291 changes: 291 additions & 0 deletions Practicals/Aleksandra Dacko/P5/bh.html

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions Practicals/Aleksandra Dacko/P5/citations.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Authors,Title,Publication,Volume,Number,Pages,Year,Publisher
"Falcon, Sergio; Plaza, Ángel; ",The k-Fibonacci sequence and the Pascal 2-triangle,"Chaos, Solitons & Fractals",33,1,38-49,2007,Elsevier
"Horadam, AF; ",A generalized Fibonacci sequence,The American Mathematical Monthly,68,5,455-459,1961,Taylor & Francis
"Waddill, Marcellus E; Sacks, Louis; ",Another generalized Fibonacci sequence,The Fibonacci Quarterly,5,3,209-222,1967,Citeseer
"Catarino, Paula; ",On some identities for k-Fibonacci sequence,Int. J. Contemp. Math. Sci,9,1,37-42,2014,
"Park, Andrew E; Fernandez, John J; Schmedders, Karl; Cohen, Mark S; ",The Fibonacci sequence: relationship to the human hand,The journal of hand surgery,28,1,157-160,2003,Elsevier
"Edson, Marcia; Yayenie, Omer; ",A New Generalization of Fibonacci Sequence & Extended Binet's Formula,,,,,2009,Walter de Gruyter GmbH & Co. KG
"Scott, Tony C; Marketos, Pan; ",On the origin of the Fibonacci Sequence,MacTutor History of Mathematics,23,,,2014,
"Yayenie, Omer; ",A note on generalized Fibonacci sequences,Applied Mathematics and Computation,217,12,5603-5611,2011,Elsevier
"Atanassov, K; Atanassova, L; Sasselov, D; ",A new perspective to the generalization of the Fibonacci sequence,The Fibonacci Quarterly,23,1,21-28,1985,
"Viswanath, Divakar; ",Random Fibonacci sequences and the number 1.13198824…,Mathematics of Computation,69,231,1131-1155,2000,
"Bravo, Jhon J; Luca, Florian; ",Powers of two in generalized Fibonacci sequences,Revista Colombiana de Matemáticas,46,1,67-79,2012,Universidad Nacional de Colombia y Sociedad Colombiana de Matemáticas
"Falcon, Sergio; Plaza, Ángel; ",On k-Fibonacci sequences and polynomials and their derivatives,"Chaos, Solitons & Fractals",39,3,1005-1019,2009,Elsevier
"Jun, Wang; ",k-step Fibonacci sequence modulo m,Utilitas Mathematica,71,,,2006,
"Wilcox, Howard J; ",Fibonacci sequences of period n in groups,Fibonacci Quart,24,4,356-361,1986,
"Gupta, VK; Panwar, Yashwant K; Sikhwal, Omprakash; ",Generalized Fibonacci Sequences,Theoretical Mathematics and Applications,2,2,115-124,2012,
Binary file added Practicals/Aleksandra Dacko/P5/images/fibo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Practicals/Aleksandra Dacko/P5/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading