Skip to content

Instantly share code, notes, and snippets.

View MJacobs1985's full-sized avatar

Marc Jacobs MJacobs1985

View GitHub Profile
VO2i_methode1 = fcast$fcst[1]; VO2i_methode1
x = VO2i_methode1$VO2i_methode1[,1]; x
VO2i_methode1inv =ts(c(mymts[,1], x))
plot(VO2i_methode1inv)
fit = nnetar(mymts[,1]);fit
nnetforecast <- forecast(fit, h = 400, PI = T)
plot(nnetforecast)
fit2 = nnetar(mymts[,1], xreg = mymts[,2])
mymts<-dataset%>%dplyr::select(VO2i_methode1,DO2i_methode1,RQ_methode1)%>%ts(.)
mymts
plot(mymts)
theme_set(theme_bw())
autoplot(mymts) +
ggtitle("Time Series Plot of the `mymts' Time-Series") +
theme(plot.title = element_text(hjust = 0.5)) #for centering the text
class(mymts)
apply(mymts, 2, adf.test)
plot.ts(mymts)
dataset%>%
summarise_by_time(Tijdstip,.by="minute",VO2i_verschil_mean=mean(VO2i_verschil,na.rm=TRUE))%>%
plot_time_series_regression(.date_var = Tijdstip,
.formula = VO2i_verschil_mean~ as.numeric(Tijdstip) +
minute(Tijdstip),
.interactive = FALSE,
.facet_ncol=2)
ggplot(dataset, aes(x=as.factor(ID))) +
geom_boxplot(aes(y=VO2i_methode1, fill="red"),alpha=0.5, color="black") +
geom_boxplot(aes(y=VO2i_methode2, fill="darkgreen"), alpha=0.5, color="black") +
scale_y_continuous("VO2 method 1 (red) & 2 (darkgreen)")+
theme_bw()+ theme(legend.position = "none")
ggplot(dataset, aes(x=as.factor(Meting))) +
geom_boxplot(aes(y=as.numeric(VO2i_methode1-VO2i_methode2))) +
theme_bw() + theme(legend.position = "none")
ggplot(dataset, aes(x=as.factor(ID))) +
geom_boxplot(aes(y=VO2i_methode1-VO2i_methode2, fill="purple"),alpha=0.5, color="black") +
ggplot(dataset, aes(x=Tijdstip, y=PO2art, colour=as.factor(PO2art_bin))) +
geom_point() +
facet_wrap(~ID, scales="free")+
theme_bw()+ theme(legend.position = "bottom")
ggplot(dataset, aes(x=Tijdstip, y=DO2i_methode1, colour=as.factor(DO2i_methode1_gen_bin))) +
geom_point() +
facet_wrap(~ID, scales="free")+
theme_bw()+ theme(legend.position = "bottom")
ggplot(dataset, aes(x=Tijdstip, y=DO2i_methode1,colour=as.factor(DO2i_methode1_cath_bin))) +
geom_point() +
ggplot(dataset, aes(x=as.numeric(ElapsedTime), y=VO2cdi,colour=as.factor(ID))) +
geom_line() +
theme_bw()+ theme(legend.position = "none")
ggplot(dataset, aes(x=as.numeric(ElapsedTime), y=VO2cdi,colour=as.factor(ID))) +
geom_point() +
theme_bw()+ theme(legend.position = "none")
ggplot(dataset, aes(x=Tijdstip, y=Flow, colour=as.factor(ID))) +
geom_line() +
theme_bw()
ggplot(dataset, aes(x=as.numeric(ElapsedTime), y=Flow,colour=as.factor(ID))) +
geom_line() +
theme_bw()+ theme(legend.position = "none")
ggplot(dataset, aes(x=Tijdstip, y=Flow, colour=as.factor(ID))) +
geom_line() +
facet_wrap(~ID, scales="free")+
theme_bw() + theme(legend.position = "none")
library(readxl)
library(skimr)
library(tidyverse)
library(dplyr)
library(ggplot2)
library(caret)
library(car)
library(skimr)
library(forecast)
library(lubridate)
dataset <- read_excel(".xlsx", col_types = c("numeric", "numeric", "date",
"numeric", "numeric", "numeric","numeric", "numeric", "numeric",
"numeric", "numeric", "numeric", "numeric", "numeric", "numeric",
"numeric", "numeric", "numeric", "numeric", "numeric", "numeric",
"numeric", "numeric", "numeric", "numeric", "numeric", "numeric",
"numeric", "numeric"))
str(dataset)
skim(dataset)
attach(dataset)
dataset$ID<-as.factor(dataset$ID)
results <- resamples(list(PR=pm1,
EN=enet1,
NN=brnn1))
summary(results)
bwplot(results)
dotplot(results)