From bce11713ce2cc5cf2ff8f7eb41cb4d57e9bfbcb5 Mon Sep 17 00:00:00 2001 From: Pierre Pudlo <37126309+pierrepudlo@users.noreply.github.com> Date: Sat, 31 Aug 2024 15:16:12 +0200 Subject: [PATCH] readme --- README.md | 4 +++- data/.Rhistory | 64 -------------------------------------------------- 2 files changed, 3 insertions(+), 65 deletions(-) delete mode 100644 data/.Rhistory diff --git a/README.md b/README.md index feb6336..3985e70 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,9 @@ Le dépôt contient différents répertoires : - `data` pour les données -- `R`, `Python` et `SAS` pour les sujets et les notebooks à remplir +- `sujet` pour les scripts ayant engendré les sujets + +Il sera mis au jour au cours du semestre. diff --git a/data/.Rhistory b/data/.Rhistory deleted file mode 100644 index a7984ee..0000000 --- a/data/.Rhistory +++ /dev/null @@ -1,64 +0,0 @@ -library(survival) -lung -library(readr) -write_csv(lung, "lung.csv") -knitr::opts_chunk$set(echo = TRUE) -data(mammals) -data(mammals, package = "MASS") -force(mammals) -libary(tidyverse) -library(tidyverse) -ggplot(mammals, aes(x = body, y = brain)) + -geom_point() -ggplot(mammals, aes(x = body, y = brain)) + -geom_point() + theme_classic() -ggplot(mammals, aes(x = body, y = brain)) + -geom_point() + theme_bw() -mammals <- mammals %>% -mutate(log_body = log(body), -log_brain = log(brain)) -ggplot(mammals, aes(x = log_body, y = log_brain)) + -geom_point() + theme_bw() -library(tidyverse) -library(rstan) -options(mc.cores = 4) -rstan_options(auto_write = TRUE) -library(saemix) -theo <- read_csv("theophyllineData.csv", -col_types = cols(id = col_factor())) -theo <- theo %>% -mutate(id_num = as.integer(id)) -bayes_model_ka <- stan_model("bayes_TP2.stan") -init_func_ka <- function(){ -ka_pop <- 1.86 #psi0_hat[1] -ke <- 0.086 #psi0_hat[2] -V <- 33 #psi0_hat[3] -a <- 1 -ka <- rep(1.8, 12) #as.matrix(psi(sfit))[,1] -tau <- 1 #sqrt(diag(sfit@results@omega))[1] -eta <- (ka - ka_pop)/tau -list(ka_pop = ka_pop, ke = ke, V = V, a = a, eta = eta, tau = tau)} -posterior_ka <- sampling(bayes_model_ka, data = stan_data, -init = init_func_ka, -chains = 4, warmup = 5000, -iter = 10000, -refresh = 1000) -stan_data <- list(ntot = nrow(theo), N = 12, y = theo$concentration, -id = as.integer(theo$id), tps = theo$time, D = 320) -posterior_ka <- sampling(bayes_model_ka, data = stan_data, -init = init_func_ka, -chains = 4, warmup = 5000, -iter = 10000, -refresh = 1000) -bayes_model_ka <- stan_model("bayes_mixed_ka.stan") -library(nycflights13) -?flights -head(flights) -write.csv2(flights, row.names = FALSE) -path <- "/Users/ppudlo/git/m1-donnees-tp/data" -setwd(path) -write.csv2(flights, file="fligths.csv", row.names = FALSE) -write.csv2(airlines, file="airlines.csv", row.names = FALSE) -write.csv2(airports, file="airports.csv", row.names = FALSE) -write.csv2(planes, file="planes.csv", row.names = FALSE) -write.csv2(weather, file="weather.csv", row.names = FALSE) -- GitLab