diff --git a/Rnotebook-rigcounts.html b/Rnotebook-rigcounts.html new file mode 100644 index 0000000000000000000000000000000000000000..5106d03a45d2e421adab0ac6f142ea466b9ce6ac --- /dev/null +++ b/Rnotebook-rigcounts.html @@ -0,0 +1,2519 @@ + + + + + + + + + + + + + +R Notebook: Evaluation of rig counts + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +

THIS VERSION: 5.12.2024

+ +

Rig count data.

+
+

Weekly data 1.3.2017 to 28.3.2024

+

Explorative data analysis:

+

Number of observations is 365. The mean and variance of the data are: +6.3945205 and 5.7944754.

+
plot(data1$AlaskaL, type="l")
+

+
forecast::Acf(data1$AlaskaL)
+

+
forecast::Pacf(data1$AlaskaL)
+

+

Are there quarterly seasonal effects?

+

Mean counts for quarters 1 to 4:

+
meanq1 <- mean(data1$AlaskaL[data1$Q1 == 1])
+meanq1
+
## [1] 7.988764
+
meanq2 <- mean(data1$AlaskaL[data1$Q2 == 1])
+meanq2
+
## [1] 6.076923
+
meanq3 <- mean(data1$AlaskaL[data1$Q3 == 1])
+meanq3
+
## [1] 5.608696
+
meanq4 <- mean(data1$AlaskaL[data1$Q4 == 1])
+meanq4
+
## [1] 5.956989
+ +
+

Specification 1:

+

I start with the specification used so far, i.e. with a linear trend +and the Q1 dummy.

+
# preparations for regression analysis
+X1 <- data1$AlaskaL
+n1 <- length(X1)
+
+# generate trend variables and quarterly dummies
+trend_1 <- (1:n1 - n1/2) / n1
+const_1 <- rep(1, n1)
+
+q1_1 <- data1$Q1
+

Fitting a GP(2) model with trend and Q1-Dummy (log-link)

+
xreg_1_tq1 <- cbind(const_1, trend_1, q1_1 )
+
+
+fit_1_gp2tq1 <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1 , julia=T)
+
## Starting Julia ...
+
#fit_1_gp2tq1 <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1, link_function = "log" , julia=T)
+summary(fit_1_gp2tq1)
+
## Coefficients:
+##           Estimate   Std. Error          t
+## alpha1      0.0515       0.0077     6.7128
+## alpha2      0.0190       0.0063     3.0179
+## alpha3      0.8758       0.0171    51.3371
+## eta         0.1972       0.0458     4.3111
+## const_1    -1.7628       0.1759   -10.0223
+## trend_1    -2.1621       0.4951    -4.3673
+## q1_1        0.7095       0.2823     2.5135
+## 
+## Type: GP 
+## Order: 2 
+## 
+## Log-likelihood: -455.7017
+

Evaluation of the fitted model:

+
boot <- cocoBoot(fit_1_gp2tq1, rep.Bootstrap=500, conf.alpha = 0.01, julia=TRUE)
+plot(boot)
+

+
pit <- cocoPit(fit_1_gp2tq1,  julia=TRUE)
+plot(pit)
+

+
residuals <- cocoResid(fit_1_gp2tq1, val.num = 1e-10)
+mean(residuals$pe.resid)
+
## [1] 0.05874158
+
var(residuals$pe.resid)
+
## [1] 0.8029447
+
forecast::Acf(residuals$pe.resid)
+

+
plot(residuals$pe.resid,type="l")
+

+

The mean and variance of the Pearson residuals are: 0.0587416 and +0.8029447.

+

Note, that the confidence level in the parametric bootstrap exercise +was set to \(99\%\) in order to include +the SACF of the data.

+

We concluded then, that despite the complex dynamics, this model is +doing pretty ok.

+

Moving on to a one-step-ahead forecasting exercise:

+
k <- 1
+
+trendf <- ((n1+1):(n1+k) - n1/2) / n1 #adjusted to a vector
+q1f   <- 0 
+constf <- 1
+
+xcastk <- cbind(constf, trendf, q1f) #adjusted to create a matrix
+
+
+fc_1_gp2 <- predict(fit_1_gp2tq1,k=1, max=20, simulate_one_step_ahead = F, xcast=xcastk, julia=T)
+
+
+#k=1
+fc_1_gp2[[1]]$mode
+
## [1] 13
+
fc_1_gp2[[1]]$median
+
## [1] 13
+
plot(fc_1_gp2[[1]])
+

+ +
+
+

Specification 2:

+

Include a Dummy for quarter 3 to the above specification:

+
q3_1 <- data1$Q3
+
+xreg_1_tq1q3 <- cbind(const_1, trend_1, q1_1, q3_1 )
+
+
+fit_1_gp2tq1q3 <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1q3 , julia=T)
+
+summary(fit_1_gp2tq1q3)
+
## Coefficients:
+##           Estimate   Std. Error         t
+## alpha1      0.0516       0.0077    6.7187
+## alpha2      0.0192       0.0063    3.0329
+## alpha3      0.8754       0.0171   51.2380
+## eta         0.1968       0.0458    4.2955
+## const_1    -1.7017       0.1990   -8.5514
+## trend_1    -2.1716       0.4958   -4.3799
+## q1_1        0.6474       0.2975    2.1761
+## q3_1       -0.1962       0.3158   -0.6213
+## 
+## Type: GP 
+## Order: 2 
+## 
+## Log-likelihood: -455.505
+

No real improvement. Do not pursue any further.

+ +
+
+

Specification 3:

+

I now try to include some intervention terms in the spirit of +Liboschek et al JSS paper for the tscount package.

+

Data preparation:

+
#intervention dummies
+
+intv1_0 <- rep(0,158)
+intv1_1 <- rep(1,80)
+intv1_2 <- rep(0,127)
+intv_corona <- c(intv1_0,intv1_1,intv1_2)
+# a Covid19 Dummy covering the time span from mid April 2020 to end of Sept. 2021
+
+intv2_1 <- rep(0, 238)  
+intv2_2 <- rep(1,127)
+intv2 <- c(intv2_1,intv2_2) 
+# a Covid19 recovery dummy starting from Oktober 2021 up to the end of the data set
+
+xreg_1_tq1_i = cbind(const_1,q1_1,intv_corona, intv2)
+
+fit_1_gp2tq1_i <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1_i , julia=T, link_function = "log")
+
+summary(fit_1_gp2tq1_i)
+
## Coefficients:
+##               Estimate   Std. Error         t
+## alpha1          0.0516       0.0080    6.4211
+## alpha2          0.0157       0.0067    2.3356
+## alpha3          0.8716       0.0185   47.1573
+## eta             0.1954       0.0461    4.2342
+## const_1        -0.8680       0.2160   -4.0186
+## q1_1            0.5802       0.2752    2.1082
+## intv_corona    -1.3603       0.3739   -3.6385
+## intv2          -1.5686       0.3656   -4.2899
+## 
+## Type: GP 
+## Order: 2 
+## 
+## Log-likelihood: -451.5651
+

The usual diagnostic plots for this specification (note however, that +the confidence level for the parametric bootstrap is 99%)

+
bootrci <- cocoBoot(fit_1_gp2tq1_i, conf.alpha = 0.01, julia=TRUE)
+plot(bootrci)
+

+
pitrci <- cocoPit(fit_1_gp2tq1_i, julia=TRUE)
+plot(pitrci)
+

+
residualsrci <- cocoResid(fit_1_gp2tq1_i, val.num = 1e-10)
+mean(residualsrci$pe.resid)
+
## [1] 0.07594969
+
var(residualsrci$pe.resid)
+
## [1] 0.7723266
+
acf_resrci <- forecast::Acf(residualsrci$pe.resid, lag = 25)
+

+
intv_coronaf <- 0
+intv2f <- 1
+
+xcastki <- cbind(constf, q1f, intv_coronaf, intv2f) #adjusted to create a matrix
+
+
+fc_1_gp2_i <- predict(fit_1_gp2tq1_i,k=1, simulate_one_step_ahead = F, xcast=xcastki, julia=T)
+
+
+#k=1
+fc_1_gp2_i[[1]]$mode
+
## [1] 13
+
fc_1_gp2_i[[1]]$median
+
## [1] 13
+
plot(fc_1_gp2_i[[1]])
+

+ +
+
+

Specification 4:

+

What about bringing back the trend term…

+

Data preparation:

+
trend_1 <- (1:n1 - n1/2) / n1
+#intervention dummies
+
+intv1_0 <- rep(0,158)
+intv1_1 <- rep(1,80)
+intv1_2 <- rep(0,127)
+intv_corona <- c(intv1_0,intv1_1,intv1_2)
+# a Covid19 Dummy covering the time span from mid April 2020 to end of Sept. 2021
+
+intv2_1 <- rep(0, 238)  
+intv2_2 <- rep(1,127)
+intv2 <- c(intv2_1,intv2_2) 
+# a Covid19 recovery dummy starting from Oktober 2021 up to the end of the data set
+
+xreg_1_tq1_it = cbind(const_1,q1_1,intv_corona, trend_1)
+
+fit_1_gp2tq1_it <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1_it , julia=T, link_function = "log")
+
+summary(fit_1_gp2tq1_it)
+
## Coefficients:
+##               Estimate   Std. Error         t
+## alpha1          0.0497       0.0074    6.6845
+## alpha2          0.0176       0.0062    2.8191
+## alpha3          0.8785       0.0168   52.2651
+## eta             0.1945       0.0467    4.1635
+## const_1        -1.6018       0.1971   -8.1250
+## q1_1            0.6673       0.2852    2.3401
+## intv_corona    -0.5984       0.3719   -1.6090
+## trend_1        -1.9307       0.4997   -3.8642
+## 
+## Type: GP 
+## Order: 2 
+## 
+## Log-likelihood: -454.2904
+

The usual diagnostic plots for this specification

+
bootrcit <- cocoBoot(fit_1_gp2tq1_it, conf.alpha = 0.01, julia=TRUE)
+plot(bootrcit)
+

+
pitrcit <- cocoPit(fit_1_gp2tq1_it, julia=TRUE)
+plot(pitrcit)
+

+
residualsrcit <- cocoResid(fit_1_gp2tq1_it, val.num = 1e-10)
+mean(residualsrcit$pe.resid)
+
## [1] 0.06364868
+
var(residualsrcit$pe.resid)
+
## [1] 0.8187228
+
acf_resrcit <- forecast::Acf(residualsrcit$pe.resid, lag = 25)
+

+
plot(residualsrcit$pe.resid,type="l")
+

+

Forecasting one-step-ahead

+
k <- 1
+
+trendf <- ((n1+1):(n1+k) - n1/2) / n1 #adjusted to a vector
+intv_coronaf <- 0
+
+
+xcastkit <- cbind(constf,  q1f, intv_coronaf, trendf) #adjusted to create a matrix
+
+
+fc_1_gp2_it <- predict(fit_1_gp2tq1_i,k=1,  simulate_one_step_ahead = F, xcast=xcastkit, julia=T)
+
+
+#k=1
+fc_1_gp2_it[[1]]$mode
+
## [1] 13
+
fc_1_gp2_it[[1]]$median
+
## [1] 13
+
plot(fc_1_gp2_it[[1]])
+

+ +
+
+

Specification 5:

+

Yet anther twist with the regressors: …

+

Data preparation:

+
trend_1 <- (1:n1 - n1/2) / n1
+#intervention dummies
+
+intv1_0 <- rep(0,158)
+intv1_1 <- rep(1,80)
+intv1_2 <- rep(0,127)
+intv_corona <- c(intv1_0,intv1_1,intv1_2)
+# a Covid19 Dummy covering the time span from mid April 2020 to end of Sept. 2021
+
+intv2_1 <- rep(0, 238)  
+intv2_2 <- rep(1,127)
+intv2 <- c(intv2_1,intv2_2) 
+# a Covid19 recovery dummy starting from Oktober 2021 up to the end of the data set
+
+xreg_1_tq1_it2 = cbind(const_1,q1_1,intv_corona, trend_1*intv2)
+
+fit_1_gp2tq1_it2 <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1_it2 , julia=T, link_function = "log")
+
+summary(fit_1_gp2tq1_it2)
+
## Coefficients:
+##               Estimate   Std. Error         t
+## alpha1          0.0524       0.0080    6.5913
+## alpha2          0.0165       0.0068    2.4401
+## alpha3          0.8706       0.0179   48.5261
+## eta             0.1943       0.0454    4.2757
+## const_1        -0.9064       0.2106   -4.3039
+## q1_1            0.5907       0.2731    2.1626
+## intv_corona    -1.3298       0.3733   -3.5625
+##                -4.6805       1.0593   -4.4185
+## 
+## Type: GP 
+## Order: 2 
+## 
+## Log-likelihood: -451.6935
+

Diagnostic plots for this specification

+
bootrcit2 <- cocoBoot(fit_1_gp2tq1_it2, conf.alpha = 0.01, julia=TRUE)
+plot(bootrcit2)
+

+
pitrcit2 <- cocoPit(fit_1_gp2tq1_it2, julia=TRUE)
+plot(pitrcit2)
+

+
residualsrcit2 <- cocoResid(fit_1_gp2tq1_it2, val.num = 1e-10)
+mean(residualsrcit2$pe.resid)
+
## [1] 0.06974777
+
var(residualsrcit2$pe.resid)
+
## [1] 0.7680785
+
acf_resrcit2 <- forecast::Acf(residualsrcit2$pe.resid, lag = 25)
+

+
plot(residualsrcit2$pe.resid,type="l")
+

+ +
+
+

Specification 6:

+

Yet anther twist with the regressors: …

+

Data preparation:

+
trend_1 <- (1:n1 - n1/2) / n1
+#intervention dummies
+
+intv3_0 <- rep(0,158)
+intv3_1 <- rep(1,207)
+
+intv_corona2 <- c(intv3_0,intv3_1)
+# a Covid19 Dummy covering the time span from mid April 2020 to end of Sept. 2021
+
+intv2_1 <- rep(0, 238)  
+intv2_2 <- rep(1,127)
+intv2 <- c(intv2_1,intv2_2) 
+# a Covid19 recovery dummy starting from Oktober 2021 up to the end of the data set
+
+xreg_1_tq1_it3 = cbind(const_1,q1_1,intv_corona2)
+
+fit_1_gp2tq1_it3 <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1_it3 , julia=T, link_function = "log")
+
+summary(fit_1_gp2tq1_it3)
+
## Coefficients:
+##                Estimate   Std. Error         t
+## alpha1           0.0507       0.0077    6.6253
+## alpha2           0.0155       0.0066    2.3406
+## alpha3           0.8736       0.0177   49.2499
+## eta              0.1949       0.0466    4.1835
+## const_1         -0.8693       0.2161   -4.0224
+## q1_1             0.5714       0.2762    2.0690
+## intv_corona2    -1.4707       0.2951   -4.9836
+## 
+## Type: GP 
+## Order: 2 
+## 
+## Log-likelihood: -451.6711
+

Diagnostic plots for this specification

+
bootrcit3 <- cocoBoot(fit_1_gp2tq1_it3, conf.alpha = 0.01, julia=TRUE)
+plot(bootrcit3)
+

+
pitrcit3 <- cocoPit(fit_1_gp2tq1_it3, julia=TRUE)
+plot(pitrcit3)
+

+
residualsrcit3 <- cocoResid(fit_1_gp2tq1_it3, val.num = 1e-10)
+mean(residualsrcit3$pe.resid)
+
## [1] 0.07573195
+
var(residualsrcit3$pe.resid)
+
## [1] 0.7845895
+
acf_resrcit2 <- forecast::Acf(residualsrcit2$pe.resid, lag = 25)
+

+
plot(residualsrcit2$pe.resid,type="l")
+

+
+
+
+

Summary

+

Table with scoring rule results for the data set 2017 to 2024 (not +comprehensive)

+
rbind(Spez1 = cocoScore(fit_1_gp2tq1, julia = T), Spez3 =  cocoScore(fit_1_gp2tq1_i), Spez4 =  cocoScore(fit_1_gp2tq1_it))
+
##       log.score quad.score rps.score
+## Spez1 1.255377  -0.4363836 0.4862753
+## Spez3 1.243981  -0.4439594 0.4841648
+## Spez4 1.251489  -0.437554  0.4854141
+

I think, I should try a different data span. Without the Covid19 +period.

+ +
+
+

Spezification (II.1) with dataset 2014 to 2020 (March to March)

+
data2 <- read_excel("rigcountsAlaskaL2014-20-march2march.xlsx")
+

Explorative data analysis:

+

Number of observations is 313. The mean and variance of the data are: +7.7955272 and 6.6760056.

+
mean(data2$AlaskaL)
+
## [1] 7.795527
+
var(data2$AlaskaL)
+
## [1] 6.676006
+
plot(data2$AlaskaL, type="l")
+

+
forecast::Acf(data2$AlaskaL)
+

+
forecast::Pacf(data2$AlaskaL)
+

+

Are there quarterly seasonal effects?

+

Mean counts for quarters 1 to 4:

+
meanq1 <- mean(data2$AlaskaL[data2$Q1 == 1])
+meanq1
+
## [1] 9.220779
+
meanq2 <- mean(data2$AlaskaL[data2$Q2 == 1])
+meanq2
+
## [1] 7.743243
+
meanq3 <- mean(data2$AlaskaL[data2$Q3 == 1])
+meanq3
+
## [1] 6.73494
+
meanq4 <- mean(data2$AlaskaL[data2$Q4 == 1])
+meanq4
+
## [1] 7.56962
+

There is no need for a trend and the data seem to be slightly +underdispersed. Preliminary tests show that the \(\eta\) parameter in the GPAR is not +significantly different from zero. So I stick wit a PAR2 model and the +Q1 Dummy.

+
# preparations for regression analysis
+X2 <- data2$AlaskaL
+n2 <- length(X2)
+
+# generate trend variables and quarterly dummies
+trend_2 <- (1:n2 - n2/2) / n2
+const_2 <- rep(1, n2)
+
+q1_2 <- data2$Q1
+
+
+
+xreg_2_q1 <- cbind(const_2, q1_2 )
+

Fitting a PAR(2) model with Q1-Dummy only (log-link):

+
fit_2_p2q1 <- cocoReg(order=2, type="Poisson", data=X2, xreg=xreg_2_q1, link_function = "log" , julia=T)
+
+summary(fit_2_p2q1)
+
## Coefficients:
+##           Estimate   Std. Error         t
+## alpha1      0.1002       0.0131    7.6659
+## alpha2      0.0418       0.0125    3.3456
+## alpha3      0.7770       0.0227   34.1635
+## const_2    -0.6315       0.1752   -3.6037
+## q1_2        0.5375       0.1924    2.7942
+## 
+## Type: Poisson 
+## Order: 2 
+## 
+## Log-likelihood: -521.294
+

Evaluation of the fitted model:

+
boot <- cocoBoot(fit_2_p2q1, rep.Bootstrap=500, conf.alpha = 0.05, julia=TRUE)
+plot(boot)
+

+
pit <- cocoPit(fit_2_p2q1,  julia=TRUE)
+plot(pit)
+

+
residuals <- cocoResid(fit_2_p2q1, val.num = 1e-10)
+mean(residuals$pe.resid)
+
## [1] 0.009020904
+
var(residuals$pe.resid)
+
## [1] 1.041562
+
forecast::Acf(residuals$pe.resid)
+

+
plot(residuals$pe.resid,type="l")
+

+

Forecasting one-step-ahead

+
constf2 <- 1
+q1f2 <- 0
+
+xcastk2 <- cbind(constf2, q1f2) #adjusted to create a matrix
+
+
+fc_2_p2 <- predict(fit_2_p2q1, k=1, simulate_one_step_ahead = F, xcast=xcastk2, julia=T)
+
+
+#k=1
+fc_2_p2[[1]]$mode
+
## [1] 9
+
fc_2_p2[[1]]$median
+
## [1] 9
+
plot(fc_2_p2[[1]])
+

+ +
+ +
+

Spezification II.2 mit seasonal components

+
# generate trend variables and quarterly dummies
+X2 <- data2$AlaskaL
+n2 <- length(X2)
+
+sin_x2 <- sin(2*pi*1:n2/52)
+cos_x2 <- cos(2*pi*1:n2/52)
+
+const_2 <- rep(1, n2)
+
+q1_2 <- data2$Q1
+
+xreg_2_q1har <- cbind(const_2, q1_2, sin_x2, cos_x2 )
+

Fitting a PAR(2) model with Q1-Dummy only (log-link)

+
fit_2_p2q1har <- cocoReg(order=2, type="Poisson", data=X2, xreg=xreg_2_q1har, link_function = "log" , julia=T)
+
+summary(fit_2_p2q1har)
+
## Coefficients:
+##           Estimate   Std. Error         t
+## alpha1      0.0999       0.0130    7.6994
+## alpha2      0.0427       0.0125    3.4133
+## alpha3      0.7781       0.0226   34.3622
+## const_2    -0.7227       0.2025   -3.5685
+## q1_2        0.7897       0.3447    2.2912
+## sin_x2      0.0631       0.1713    0.3682
+## cos_x2     -0.2002       0.1982   -1.0100
+## 
+## Type: Poisson 
+## Order: 2 
+## 
+## Log-likelihood: -520.7641
+

Evaluation of the fitted model:

+
boot <- cocoBoot(fit_2_p2q1har, rep.Bootstrap=500, conf.alpha = 0.05, julia=TRUE)
+plot(boot)
+

+
pit <- cocoPit(fit_2_p2q1har,  julia=TRUE)
+plot(pit)
+

+
residuals <- cocoResid(fit_2_p2q1har, val.num = 1e-10)
+mean(residuals$pe.resid)
+
## [1] 0.008739587
+
var(residuals$pe.resid)
+
## [1] 1.047478
+
forecast::Acf(residuals$pe.resid)
+

+
plot(residuals$pe.resid,type="l")
+

+ +
+
+

Spezification (II.3) with dataset 2014 to 2020 (March to March) and +intervention

+

… of course, the intervention has no inferential background, just +eyeballing…

+
# generate trend variables and quarterly dummies
+const_2 <- rep(1, n2)
+
+q1_2 <- data2$Q1
+
+intv2_1 <- rep(0,109)
+intv2_2 <- rep(1,204)
+interv <- c(intv2_1,intv2_2)
+
+xreg_2_q1i <- cbind(const_2, q1_2, interv )
+

Fitting a PAR(2) model with Q1-Dummy and intervention (log-link)

+
fit_2_p2q1i <- cocoReg(order=2, type="Poisson", data=X2, xreg=xreg_2_q1i, link_function = "log" , julia=T)
+
+summary(fit_2_p2q1i)
+
## Coefficients:
+##           Estimate   Std. Error         t
+## alpha1      0.1035       0.0139    7.4571
+## alpha2      0.0427       0.0128    3.3460
+## alpha3      0.7714       0.0240   32.0969
+## const_2    -0.4724       0.2172   -2.1747
+## q1_2        0.5336       0.1910    2.7941
+## interv     -0.2230       0.1927   -1.1573
+## 
+## Type: Poisson 
+## Order: 2 
+## 
+## Log-likelihood: -520.6517
+

The intervention dummy is not significant, but may help to improve +the fit of the model as far as the dynamics is concerned.

+

Evaluation of the fitted model:

+
boot <- cocoBoot(fit_2_p2q1i, rep.Bootstrap=500, conf.alpha = 0.05, julia=TRUE)
+plot(boot)
+

+
pit <- cocoPit(fit_2_p2q1i,  julia=TRUE)
+plot(pit)
+

+
residuals <- cocoResid(fit_2_p2q1i, val.num = 1e-10)
+mean(residuals$pe.resid)
+
## [1] 0.01108528
+
var(residuals$pe.resid)
+
## [1] 1.023794
+
forecast::Acf(residuals$pe.resid)
+

+
plot(residuals$pe.resid,type="l")
+

+

Looks all pretty ok to me.

+

Forecasting one-step-ahead

+
constf2i <- 1
+q1f2i <- 0
+intv2i <- 1
+
+xcastk2i <- cbind(constf2, q1f2, intv2i) #adjusted to create a matrix
+
+
+fc_2_p2i <- predict(fit_2_p2q1i,k=1, simulate_one_step_ahead = F, xcast=xcastk2i, julia=T)
+
+
+#k=1
+fc_2_p2i[[1]]$mode
+
## [1] 9
+
fc_2_p2i[[1]]$median
+
## [1] 9
+
plot(fc_2_p2i[[1]])
+

+
+
+

Spezification (II.4) with dataset 2014 to 2020 (March to March) and +a simple trend

+
# generate trend variables and quarterly dummies
+trend_2 <- (1:n2 - n2/2) / n2
+
+const_2 <- rep(1, n2)
+
+q1_2 <- data2$Q1
+
+
+
+xreg_2_q1t <- cbind(const_2, trend_2, q1_2 )
+

Fitting a PAR(2) model with Q1-Dummy and trend (log-link)

+
fit_2_p2q1t <- cocoReg(order=2, type="Poisson", data=X2, xreg=xreg_2_q1t, link_function = "log" , julia=T)
+
+summary(fit_2_p2q1t)
+
## Coefficients:
+##           Estimate   Std. Error         t
+## alpha1      0.1022       0.0136    7.5267
+## alpha2      0.0432       0.0127    3.3943
+## alpha3      0.7739       0.0235   32.9082
+## const_2    -0.6420       0.1762   -3.6442
+## trend_2    -0.2663       0.3363   -0.7918
+## q1_2        0.5549       0.1936    2.8662
+## 
+## Type: Poisson 
+## Order: 2 
+## 
+## Log-likelihood: -520.9809
+

Evaluation of the fitted model:

+
boot <- cocoBoot(fit_2_p2q1t, rep.Bootstrap=500, conf.alpha = 0.05, julia=TRUE)
+plot(boot)
+

+
pit <- cocoPit(fit_2_p2q1t,  julia=TRUE)
+plot(pit)
+

+
residuals <- cocoResid(fit_2_p2q1t, val.num = 1e-10)
+mean(residuals$pe.resid)
+
## [1] 0.00979969
+
var(residuals$pe.resid)
+
## [1] 1.034343
+
forecast::Acf(residuals$pe.resid)
+

+
plot(residuals$pe.resid,type="l")
+

+ +
rbind(spec1 = cocoScore(fit_2_p2q1, julia=T), spec2 = cocoScore(fit_2_p2q1har, julia = T), spec3 = cocoScore(fit_2_p2q1i, julia = T), spec4=cocoScore(fit_2_p2q1t))
+
##       log.score quad.score rps.score
+## spec1 1.676187  -0.2317115 0.7128052
+## spec2 1.674483  -0.2327295 0.7116199
+## spec3 1.674121  -0.2320096 0.7099365
+## spec4 1.67518   -0.2315345 0.7115837
+

All close together.

+ +
+
+

Spezification (III.3) with dataset 2013 to 2020 (March to +March)

+
data3 <- read_excel("rigcountsAlaskaL2013-20-march2march.xlsx")
+#data2 <- read_excel("rigcountsAlaskaL2014-20-march2march.xlsx")
+

Explorative data analysis:

+

Number of observations is 365. The mean and variance of the data are: +8.0465753 and 7.1709017.

+
mean(data3$AlaskaL)
+
## [1] 8.046575
+
var(data3$AlaskaL)
+
## [1] 7.170902
+
plot(data3$AlaskaL, type="l")
+

+
forecast::Acf(data3$AlaskaL)
+

+
forecast::Pacf(data3$AlaskaL)
+

+

Hm dependence looks even more pronounced… Try another data span…

+ +
+
+

Spezification (IV.1) with dataset 2016 to 2020 (March to March)

+
data4 <- read_excel("rigcountsAlaskaL2016-20-march2march.xlsx")
+

Explorative data analysis:

+

Number of observations is 209. The mean and variance of the data are: +6.6124402 and 3.9884983.

+

The data are severely underdisperesed. I think, we should not pursue +this here further.

+
mean(data4$AlaskaL)
+
## [1] 6.61244
+
var(data4$AlaskaL)
+
## [1] 3.988498
+
plot(data4$AlaskaL, type="l")
+

+
forecast::Acf(data4$AlaskaL)
+

+
forecast::Pacf(data4$AlaskaL)
+

+

Are there quarterly seasonal effects?

+

Mean counts for quarters 1 to 4:

+
meanq1 <- mean(data4$AlaskaL[data4$Q1 == 1])
+meanq1
+
## [1] 8.288462
+
meanq2 <- mean(data4$AlaskaL[data4$Q2 == 1])
+meanq2
+
## [1] 6.604167
+
meanq3 <- mean(data4$AlaskaL[data4$Q3 == 1])
+meanq3
+
## [1] 5.578947
+
meanq4 <- mean(data4$AlaskaL[data4$Q4 == 1])
+meanq4
+
## [1] 6.076923
+

There is no need for a trend and the data seem not overdispersed:

+
# preparations for regression analysis
+X4 <- data4$AlaskaL
+n4 <- length(X4)
+
+const_4 <- rep(1, n4)
+
+q1_4 <- data4$Q1
+
+
+xreg_4_q1 <- cbind(const_4, q1_4 )
+

Fitting a GPAR(2) model with Q1-Dummy only (log-link)

+
fit_4_p2q1 <- cocoReg(order=2, type="GP", data=X4, xreg=xreg_4_q1, link_function = "log" , julia=T)
+
+summary(fit_4_p2q1)
+
## Coefficients:
+##           Estimate   Std. Error         t
+## alpha1      0.1210       0.0240    5.0445
+## alpha2      0.0590       0.0207    2.8543
+## alpha3      0.7352       0.0459   16.0286
+## eta         0.0171       0.0729    0.2349
+## const_4    -0.7770       0.2845   -2.7308
+## q1_4        0.6001       0.2424    2.4757
+## 
+## Type: GP 
+## Order: 2 
+## 
+## Log-likelihood: -343.0093
+

Evaluation of the fitted model:

+
boot <- cocoBoot(fit_4_p2q1, rep.Bootstrap=500, conf.alpha = 0.05, julia=TRUE)
+plot(boot)
+

+
pit <- cocoPit(fit_4_p2q1,  julia=TRUE)
+plot(pit)
+

+
residuals <- cocoResid(fit_4_p2q1, val.num = 1e-10)
+mean(residuals$pe.resid)
+
## [1] 0.01748717
+
var(residuals$pe.resid)
+
## [1] 0.9975233
+
forecast::Acf(residuals$pe.resid)
+

+
plot(residuals$pe.resid,type="l")
+

+ +
+ + + + +
+ + + + + + + + + + + + + + + diff --git a/Rnotebook-rigcounts.md b/Rnotebook-rigcounts.md new file mode 100644 index 0000000000000000000000000000000000000000..7c0a0ba478998c36dc9e8febfe5a8a95c42e384d --- /dev/null +++ b/Rnotebook-rigcounts.md @@ -0,0 +1,1163 @@ +THIS VERSION: 5.12.2024 + + + +Rig count data. + +In this document I present analyses for different time spans of the +data. I start with the time span 2017 to 2024, which we looked at during +your visit to Hohenheim. I use different specifications, but argue in +the end in favour of not including the after Covid19 period. + +Then I analyse the time span from 2014 to 2020. This turns out to be my +favourite time span to be included into the JSS paper. Despite the fact +that the second order SACF of the residuals is significant in the usual +sense. + +Other time spans discussed here: 2013 to 2020 - the dependence is even +more pronounced in this time span. + +Finally 2016 to 2020. Very short time period, very small sample size. +Dynamics look very good, but the marignal underdispersion is +considerable. I do not think, we should open this discussion here. + +# Weekly data 1.3.2017 to 28.3.2024 + +**Explorative data analysis:** + +Number of observations is 365. The mean and variance of the data are: +6.3945205 and 5.7944754. + + plot(data1$AlaskaL, type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/2-1.png) + + forecast::Acf(data1$AlaskaL) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/2-2.png) + + forecast::Pacf(data1$AlaskaL) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/3-1.png) + +Are there quarterly seasonal effects? + +Mean counts for quarters 1 to 4: + + meanq1 <- mean(data1$AlaskaL[data1$Q1 == 1]) + meanq1 + + ## [1] 7.988764 + + meanq2 <- mean(data1$AlaskaL[data1$Q2 == 1]) + meanq2 + + ## [1] 6.076923 + + meanq3 <- mean(data1$AlaskaL[data1$Q3 == 1]) + meanq3 + + ## [1] 5.608696 + + meanq4 <- mean(data1$AlaskaL[data1$Q4 == 1]) + meanq4 + + ## [1] 5.956989 + + + +## Specification 1: + +I start with the specification used so far, i.e. with a linear trend and +the Q1 dummy. + + # preparations for regression analysis + X1 <- data1$AlaskaL + n1 <- length(X1) + + # generate trend variables and quarterly dummies + trend_1 <- (1:n1 - n1/2) / n1 + const_1 <- rep(1, n1) + + q1_1 <- data1$Q1 + +Fitting a GP(2) model with trend and Q1-Dummy (log-link) + + xreg_1_tq1 <- cbind(const_1, trend_1, q1_1 ) + + + fit_1_gp2tq1 <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1 , julia=T) + + ## Starting Julia ... + + #fit_1_gp2tq1 <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1, link_function = "log" , julia=T) + summary(fit_1_gp2tq1) + + ## Coefficients: + ## Estimate Std. Error t + ## alpha1 0.0515 0.0077 6.7128 + ## alpha2 0.0190 0.0063 3.0179 + ## alpha3 0.8758 0.0171 51.3371 + ## eta 0.1972 0.0458 4.3111 + ## const_1 -1.7628 0.1759 -10.0223 + ## trend_1 -2.1621 0.4951 -4.3673 + ## q1_1 0.7095 0.2823 2.5135 + ## + ## Type: GP + ## Order: 2 + ## + ## Log-likelihood: -455.7017 + +Evaluation of the fitted model: + + boot <- cocoBoot(fit_1_gp2tq1, rep.Bootstrap=500, conf.alpha = 0.01, julia=TRUE) + plot(boot) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-1.png) + + pit <- cocoPit(fit_1_gp2tq1, julia=TRUE) + plot(pit) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-2.png) + + residuals <- cocoResid(fit_1_gp2tq1, val.num = 1e-10) + mean(residuals$pe.resid) + + ## [1] 0.05874158 + + var(residuals$pe.resid) + + ## [1] 0.8029447 + + forecast::Acf(residuals$pe.resid) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-3.png) + + plot(residuals$pe.resid,type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-4.png) + +The mean and variance of the Pearson residuals are: 0.0587416 and +0.8029447. + +Note, that the confidence level in the parametric bootstrap exercise was +set to 99% in order to include the SACF of the data. + +We concluded then, that despite the complex dynamics, this model is +doing pretty ok. + +Moving on to a one-step-ahead forecasting exercise: + + k <- 1 + + trendf <- ((n1+1):(n1+k) - n1/2) / n1 #adjusted to a vector + q1f <- 0 + constf <- 1 + + xcastk <- cbind(constf, trendf, q1f) #adjusted to create a matrix + + + fc_1_gp2 <- predict(fit_1_gp2tq1,k=1, max=20, simulate_one_step_ahead = F, xcast=xcastk, julia=T) + + + #k=1 + fc_1_gp2[[1]]$mode + + ## [1] 13 + + fc_1_gp2[[1]]$median + + ## [1] 13 + + plot(fc_1_gp2[[1]]) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_f-1.png) + + + +## Specification 2: + +Include a Dummy for quarter 3 to the above specification: + + q3_1 <- data1$Q3 + + xreg_1_tq1q3 <- cbind(const_1, trend_1, q1_1, q3_1 ) + + + fit_1_gp2tq1q3 <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1q3 , julia=T) + + summary(fit_1_gp2tq1q3) + + ## Coefficients: + ## Estimate Std. Error t + ## alpha1 0.0516 0.0077 6.7187 + ## alpha2 0.0192 0.0063 3.0329 + ## alpha3 0.8754 0.0171 51.2380 + ## eta 0.1968 0.0458 4.2955 + ## const_1 -1.7017 0.1990 -8.5514 + ## trend_1 -2.1716 0.4958 -4.3799 + ## q1_1 0.6474 0.2975 2.1761 + ## q3_1 -0.1962 0.3158 -0.6213 + ## + ## Type: GP + ## Order: 2 + ## + ## Log-likelihood: -455.505 + +No real improvement. Do not pursue any further. + + + +## Specification 3: + +I now try to include some intervention terms in the spirit of Liboschek +et al JSS paper for the tscount package. + +Data preparation: + + #intervention dummies + + intv1_0 <- rep(0,158) + intv1_1 <- rep(1,80) + intv1_2 <- rep(0,127) + intv_corona <- c(intv1_0,intv1_1,intv1_2) + # a Covid19 Dummy covering the time span from mid April 2020 to end of Sept. 2021 + + intv2_1 <- rep(0, 238) + intv2_2 <- rep(1,127) + intv2 <- c(intv2_1,intv2_2) + # a Covid19 recovery dummy starting from Oktober 2021 up to the end of the data set + + xreg_1_tq1_i = cbind(const_1,q1_1,intv_corona, intv2) + + fit_1_gp2tq1_i <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1_i , julia=T, link_function = "log") + + summary(fit_1_gp2tq1_i) + + ## Coefficients: + ## Estimate Std. Error t + ## alpha1 0.0516 0.0080 6.4211 + ## alpha2 0.0157 0.0067 2.3356 + ## alpha3 0.8716 0.0185 47.1573 + ## eta 0.1954 0.0461 4.2342 + ## const_1 -0.8680 0.2160 -4.0186 + ## q1_1 0.5802 0.2752 2.1082 + ## intv_corona -1.3603 0.3739 -3.6385 + ## intv2 -1.5686 0.3656 -4.2899 + ## + ## Type: GP + ## Order: 2 + ## + ## Log-likelihood: -451.5651 + +The usual diagnostic plots for this specification (note however, that +the confidence level for the parametric bootstrap is 99%) + + bootrci <- cocoBoot(fit_1_gp2tq1_i, conf.alpha = 0.01, julia=TRUE) + plot(bootrci) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_eval-1.png) + + pitrci <- cocoPit(fit_1_gp2tq1_i, julia=TRUE) + plot(pitrci) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_eval-2.png) + + residualsrci <- cocoResid(fit_1_gp2tq1_i, val.num = 1e-10) + mean(residualsrci$pe.resid) + + ## [1] 0.07594969 + + var(residualsrci$pe.resid) + + ## [1] 0.7723266 + + acf_resrci <- forecast::Acf(residualsrci$pe.resid, lag = 25) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_eval-3.png) + + intv_coronaf <- 0 + intv2f <- 1 + + xcastki <- cbind(constf, q1f, intv_coronaf, intv2f) #adjusted to create a matrix + + + fc_1_gp2_i <- predict(fit_1_gp2tq1_i,k=1, simulate_one_step_ahead = F, xcast=xcastki, julia=T) + + + #k=1 + fc_1_gp2_i[[1]]$mode + + ## [1] 13 + + fc_1_gp2_i[[1]]$median + + ## [1] 13 + + plot(fc_1_gp2_i[[1]]) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_f-1.png) + + + +## Specification 4: + +What about bringing back the trend term… + +Data preparation: + + trend_1 <- (1:n1 - n1/2) / n1 + #intervention dummies + + intv1_0 <- rep(0,158) + intv1_1 <- rep(1,80) + intv1_2 <- rep(0,127) + intv_corona <- c(intv1_0,intv1_1,intv1_2) + # a Covid19 Dummy covering the time span from mid April 2020 to end of Sept. 2021 + + intv2_1 <- rep(0, 238) + intv2_2 <- rep(1,127) + intv2 <- c(intv2_1,intv2_2) + # a Covid19 recovery dummy starting from Oktober 2021 up to the end of the data set + + xreg_1_tq1_it = cbind(const_1,q1_1,intv_corona, trend_1) + + fit_1_gp2tq1_it <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1_it , julia=T, link_function = "log") + + summary(fit_1_gp2tq1_it) + + ## Coefficients: + ## Estimate Std. Error t + ## alpha1 0.0497 0.0074 6.6845 + ## alpha2 0.0176 0.0062 2.8191 + ## alpha3 0.8785 0.0168 52.2651 + ## eta 0.1945 0.0467 4.1635 + ## const_1 -1.6018 0.1971 -8.1250 + ## q1_1 0.6673 0.2852 2.3401 + ## intv_corona -0.5984 0.3719 -1.6090 + ## trend_1 -1.9307 0.4997 -3.8642 + ## + ## Type: GP + ## Order: 2 + ## + ## Log-likelihood: -454.2904 + +The usual diagnostic plots for this specification + + bootrcit <- cocoBoot(fit_1_gp2tq1_it, conf.alpha = 0.01, julia=TRUE) + plot(bootrcit) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-1.png) + + pitrcit <- cocoPit(fit_1_gp2tq1_it, julia=TRUE) + plot(pitrcit) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-2.png) + + residualsrcit <- cocoResid(fit_1_gp2tq1_it, val.num = 1e-10) + mean(residualsrcit$pe.resid) + + ## [1] 0.06364868 + + var(residualsrcit$pe.resid) + + ## [1] 0.8187228 + + acf_resrcit <- forecast::Acf(residualsrcit$pe.resid, lag = 25) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-3.png) + + plot(residualsrcit$pe.resid,type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-4.png) + +Forecasting one-step-ahead + + k <- 1 + + trendf <- ((n1+1):(n1+k) - n1/2) / n1 #adjusted to a vector + intv_coronaf <- 0 + + + xcastkit <- cbind(constf, q1f, intv_coronaf, trendf) #adjusted to create a matrix + + + fc_1_gp2_it <- predict(fit_1_gp2tq1_i,k=1, simulate_one_step_ahead = F, xcast=xcastkit, julia=T) + + + #k=1 + fc_1_gp2_it[[1]]$mode + + ## [1] 13 + + fc_1_gp2_it[[1]]$median + + ## [1] 13 + + plot(fc_1_gp2_it[[1]]) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_f-1.png) + + + +## Specification 5: + +Yet anther twist with the regressors: … + +Data preparation: + + trend_1 <- (1:n1 - n1/2) / n1 + #intervention dummies + + intv1_0 <- rep(0,158) + intv1_1 <- rep(1,80) + intv1_2 <- rep(0,127) + intv_corona <- c(intv1_0,intv1_1,intv1_2) + # a Covid19 Dummy covering the time span from mid April 2020 to end of Sept. 2021 + + intv2_1 <- rep(0, 238) + intv2_2 <- rep(1,127) + intv2 <- c(intv2_1,intv2_2) + # a Covid19 recovery dummy starting from Oktober 2021 up to the end of the data set + + xreg_1_tq1_it2 = cbind(const_1,q1_1,intv_corona, trend_1*intv2) + + fit_1_gp2tq1_it2 <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1_it2 , julia=T, link_function = "log") + + summary(fit_1_gp2tq1_it2) + + ## Coefficients: + ## Estimate Std. Error t + ## alpha1 0.0524 0.0080 6.5913 + ## alpha2 0.0165 0.0068 2.4401 + ## alpha3 0.8706 0.0179 48.5261 + ## eta 0.1943 0.0454 4.2757 + ## const_1 -0.9064 0.2106 -4.3039 + ## q1_1 0.5907 0.2731 2.1626 + ## intv_corona -1.3298 0.3733 -3.5625 + ## -4.6805 1.0593 -4.4185 + ## + ## Type: GP + ## Order: 2 + ## + ## Log-likelihood: -451.6935 + +Diagnostic plots for this specification + + bootrcit2 <- cocoBoot(fit_1_gp2tq1_it2, conf.alpha = 0.01, julia=TRUE) + plot(bootrcit2) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-1.png) + + pitrcit2 <- cocoPit(fit_1_gp2tq1_it2, julia=TRUE) + plot(pitrcit2) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-2.png) + + residualsrcit2 <- cocoResid(fit_1_gp2tq1_it2, val.num = 1e-10) + mean(residualsrcit2$pe.resid) + + ## [1] 0.06974777 + + var(residualsrcit2$pe.resid) + + ## [1] 0.7680785 + + acf_resrcit2 <- forecast::Acf(residualsrcit2$pe.resid, lag = 25) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-3.png) + + plot(residualsrcit2$pe.resid,type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-4.png) + + + +## Specification 6: + +Yet anther twist with the regressors: … + +Data preparation: + + trend_1 <- (1:n1 - n1/2) / n1 + #intervention dummies + + intv3_0 <- rep(0,158) + intv3_1 <- rep(1,207) + + intv_corona2 <- c(intv3_0,intv3_1) + # a Covid19 Dummy covering the time span from mid April 2020 to end of Sept. 2021 + + intv2_1 <- rep(0, 238) + intv2_2 <- rep(1,127) + intv2 <- c(intv2_1,intv2_2) + # a Covid19 recovery dummy starting from Oktober 2021 up to the end of the data set + + xreg_1_tq1_it3 = cbind(const_1,q1_1,intv_corona2) + + fit_1_gp2tq1_it3 <- cocoReg(order=2, type="GP", data=X1, xreg=xreg_1_tq1_it3 , julia=T, link_function = "log") + + summary(fit_1_gp2tq1_it3) + + ## Coefficients: + ## Estimate Std. Error t + ## alpha1 0.0507 0.0077 6.6253 + ## alpha2 0.0155 0.0066 2.3406 + ## alpha3 0.8736 0.0177 49.2499 + ## eta 0.1949 0.0466 4.1835 + ## const_1 -0.8693 0.2161 -4.0224 + ## q1_1 0.5714 0.2762 2.0690 + ## intv_corona2 -1.4707 0.2951 -4.9836 + ## + ## Type: GP + ## Order: 2 + ## + ## Log-likelihood: -451.6711 + +Diagnostic plots for this specification + + bootrcit3 <- cocoBoot(fit_1_gp2tq1_it3, conf.alpha = 0.01, julia=TRUE) + plot(bootrcit3) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-1.png) + + pitrcit3 <- cocoPit(fit_1_gp2tq1_it3, julia=TRUE) + plot(pitrcit3) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-2.png) + + residualsrcit3 <- cocoResid(fit_1_gp2tq1_it3, val.num = 1e-10) + mean(residualsrcit3$pe.resid) + + ## [1] 0.07573195 + + var(residualsrcit3$pe.resid) + + ## [1] 0.7845895 + + acf_resrcit2 <- forecast::Acf(residualsrcit2$pe.resid, lag = 25) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-3.png) + + plot(residualsrcit2$pe.resid,type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-4.png) + +# Summary + +Table with scoring rule results for the data set 2017 to 2024 (not +comprehensive) + + rbind(Spez1 = cocoScore(fit_1_gp2tq1, julia = T), Spez3 = cocoScore(fit_1_gp2tq1_i), Spez4 = cocoScore(fit_1_gp2tq1_it)) + + ## log.score quad.score rps.score + ## Spez1 1.255377 -0.4363836 0.4862753 + ## Spez3 1.243981 -0.4439594 0.4841648 + ## Spez4 1.251489 -0.437554 0.4854141 + +I think, I should try a different data span. Without the Covid19 period. + + + +# Spezification (II.1) with dataset 2014 to 2020 (March to March) + + data2 <- read_excel("rigcountsAlaskaL2014-20-march2march.xlsx") + +**Explorative data analysis:** + +Number of observations is 313. The mean and variance of the data are: +7.7955272 and 6.6760056. + + mean(data2$AlaskaL) + + ## [1] 7.795527 + + var(data2$AlaskaL) + + ## [1] 6.676006 + + plot(data2$AlaskaL, type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/8-1.png) + + forecast::Acf(data2$AlaskaL) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/8-2.png) + + forecast::Pacf(data2$AlaskaL) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/8-3.png) + +Are there quarterly seasonal effects? + +Mean counts for quarters 1 to 4: + + meanq1 <- mean(data2$AlaskaL[data2$Q1 == 1]) + meanq1 + + ## [1] 9.220779 + + meanq2 <- mean(data2$AlaskaL[data2$Q2 == 1]) + meanq2 + + ## [1] 7.743243 + + meanq3 <- mean(data2$AlaskaL[data2$Q3 == 1]) + meanq3 + + ## [1] 6.73494 + + meanq4 <- mean(data2$AlaskaL[data2$Q4 == 1]) + meanq4 + + ## [1] 7.56962 + +There is no need for a trend and the data seem to be slightly +underdispersed. Preliminary tests show that the *η* parameter in the +GPAR is not significantly different from zero. So I stick wit a PAR2 +model and the Q1 Dummy. + + # preparations for regression analysis + X2 <- data2$AlaskaL + n2 <- length(X2) + + # generate trend variables and quarterly dummies + trend_2 <- (1:n2 - n2/2) / n2 + const_2 <- rep(1, n2) + + q1_2 <- data2$Q1 + + + + xreg_2_q1 <- cbind(const_2, q1_2 ) + +Fitting a PAR(2) model with Q1-Dummy only (log-link): + + fit_2_p2q1 <- cocoReg(order=2, type="Poisson", data=X2, xreg=xreg_2_q1, link_function = "log" , julia=T) + + summary(fit_2_p2q1) + + ## Coefficients: + ## Estimate Std. Error t + ## alpha1 0.1002 0.0131 7.6659 + ## alpha2 0.0418 0.0125 3.3456 + ## alpha3 0.7770 0.0227 34.1635 + ## const_2 -0.6315 0.1752 -3.6037 + ## q1_2 0.5375 0.1924 2.7942 + ## + ## Type: Poisson + ## Order: 2 + ## + ## Log-likelihood: -521.294 + +Evaluation of the fitted model: + + boot <- cocoBoot(fit_2_p2q1, rep.Bootstrap=500, conf.alpha = 0.05, julia=TRUE) + plot(boot) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-1.png) + + pit <- cocoPit(fit_2_p2q1, julia=TRUE) + plot(pit) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-2.png) + + residuals <- cocoResid(fit_2_p2q1, val.num = 1e-10) + mean(residuals$pe.resid) + + ## [1] 0.009020904 + + var(residuals$pe.resid) + + ## [1] 1.041562 + + forecast::Acf(residuals$pe.resid) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-3.png) + + plot(residuals$pe.resid,type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-4.png) + +Forecasting one-step-ahead + + constf2 <- 1 + q1f2 <- 0 + + xcastk2 <- cbind(constf2, q1f2) #adjusted to create a matrix + + + fc_2_p2 <- predict(fit_2_p2q1, k=1, simulate_one_step_ahead = F, xcast=xcastk2, julia=T) + + + #k=1 + fc_2_p2[[1]]$mode + + ## [1] 9 + + fc_2_p2[[1]]$median + + ## [1] 9 + + plot(fc_2_p2[[1]]) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_f-1.png) + + + +# Spezification II.1a an identiy link instead of the log link: + +Fitting a PAR(2) model with Q1-Dummy only (relu-link): + +Stopped this, as it did not converge. + + + +# Spezification II.2 mit seasonal components + + # generate trend variables and quarterly dummies + X2 <- data2$AlaskaL + n2 <- length(X2) + + sin_x2 <- sin(2*pi*1:n2/52) + cos_x2 <- cos(2*pi*1:n2/52) + + const_2 <- rep(1, n2) + + q1_2 <- data2$Q1 + + xreg_2_q1har <- cbind(const_2, q1_2, sin_x2, cos_x2 ) + +Fitting a PAR(2) model with Q1-Dummy only (log-link) + + fit_2_p2q1har <- cocoReg(order=2, type="Poisson", data=X2, xreg=xreg_2_q1har, link_function = "log" , julia=T) + + summary(fit_2_p2q1har) + + ## Coefficients: + ## Estimate Std. Error t + ## alpha1 0.0999 0.0130 7.6994 + ## alpha2 0.0427 0.0125 3.4133 + ## alpha3 0.7781 0.0226 34.3622 + ## const_2 -0.7227 0.2025 -3.5685 + ## q1_2 0.7897 0.3447 2.2912 + ## sin_x2 0.0631 0.1713 0.3682 + ## cos_x2 -0.2002 0.1982 -1.0100 + ## + ## Type: Poisson + ## Order: 2 + ## + ## Log-likelihood: -520.7641 + +Evaluation of the fitted model: + + boot <- cocoBoot(fit_2_p2q1har, rep.Bootstrap=500, conf.alpha = 0.05, julia=TRUE) + plot(boot) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-1.png) + + pit <- cocoPit(fit_2_p2q1har, julia=TRUE) + plot(pit) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-2.png) + + residuals <- cocoResid(fit_2_p2q1har, val.num = 1e-10) + mean(residuals$pe.resid) + + ## [1] 0.008739587 + + var(residuals$pe.resid) + + ## [1] 1.047478 + + forecast::Acf(residuals$pe.resid) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-3.png) + + plot(residuals$pe.resid,type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-4.png) + + + +# Spezification (II.3) with dataset 2014 to 2020 (March to March) and intervention + +… of course, the intervention has no inferential background, just +eyeballing… + + # generate trend variables and quarterly dummies + const_2 <- rep(1, n2) + + q1_2 <- data2$Q1 + + intv2_1 <- rep(0,109) + intv2_2 <- rep(1,204) + interv <- c(intv2_1,intv2_2) + + xreg_2_q1i <- cbind(const_2, q1_2, interv ) + +Fitting a PAR(2) model with Q1-Dummy and intervention (log-link) + + fit_2_p2q1i <- cocoReg(order=2, type="Poisson", data=X2, xreg=xreg_2_q1i, link_function = "log" , julia=T) + + summary(fit_2_p2q1i) + + ## Coefficients: + ## Estimate Std. Error t + ## alpha1 0.1035 0.0139 7.4571 + ## alpha2 0.0427 0.0128 3.3460 + ## alpha3 0.7714 0.0240 32.0969 + ## const_2 -0.4724 0.2172 -2.1747 + ## q1_2 0.5336 0.1910 2.7941 + ## interv -0.2230 0.1927 -1.1573 + ## + ## Type: Poisson + ## Order: 2 + ## + ## Log-likelihood: -520.6517 + +The intervention dummy is not significant, but may help to improve the +fit of the model as far as the dynamics is concerned. + +Evaluation of the fitted model: + + boot <- cocoBoot(fit_2_p2q1i, rep.Bootstrap=500, conf.alpha = 0.05, julia=TRUE) + plot(boot) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-1.png) + + pit <- cocoPit(fit_2_p2q1i, julia=TRUE) + plot(pit) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-2.png) + + residuals <- cocoResid(fit_2_p2q1i, val.num = 1e-10) + mean(residuals$pe.resid) + + ## [1] 0.01108528 + + var(residuals$pe.resid) + + ## [1] 1.023794 + + forecast::Acf(residuals$pe.resid) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-3.png) + + plot(residuals$pe.resid,type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-4.png) + +Looks all pretty ok to me. + +Forecasting one-step-ahead + + constf2i <- 1 + q1f2i <- 0 + intv2i <- 1 + + xcastk2i <- cbind(constf2, q1f2, intv2i) #adjusted to create a matrix + + + fc_2_p2i <- predict(fit_2_p2q1i,k=1, simulate_one_step_ahead = F, xcast=xcastk2i, julia=T) + + + #k=1 + fc_2_p2i[[1]]$mode + + ## [1] 9 + + fc_2_p2i[[1]]$median + + ## [1] 9 + + plot(fc_2_p2i[[1]]) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_f-1.png) + +# Spezification (II.4) with dataset 2014 to 2020 (March to March) and a simple trend + + # generate trend variables and quarterly dummies + trend_2 <- (1:n2 - n2/2) / n2 + + const_2 <- rep(1, n2) + + q1_2 <- data2$Q1 + + + + xreg_2_q1t <- cbind(const_2, trend_2, q1_2 ) + +Fitting a PAR(2) model with Q1-Dummy and trend (log-link) + + fit_2_p2q1t <- cocoReg(order=2, type="Poisson", data=X2, xreg=xreg_2_q1t, link_function = "log" , julia=T) + + summary(fit_2_p2q1t) + + ## Coefficients: + ## Estimate Std. Error t + ## alpha1 0.1022 0.0136 7.5267 + ## alpha2 0.0432 0.0127 3.3943 + ## alpha3 0.7739 0.0235 32.9082 + ## const_2 -0.6420 0.1762 -3.6442 + ## trend_2 -0.2663 0.3363 -0.7918 + ## q1_2 0.5549 0.1936 2.8662 + ## + ## Type: Poisson + ## Order: 2 + ## + ## Log-likelihood: -520.9809 + +Evaluation of the fitted model: + + boot <- cocoBoot(fit_2_p2q1t, rep.Bootstrap=500, conf.alpha = 0.05, julia=TRUE) + plot(boot) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-1.png) + + pit <- cocoPit(fit_2_p2q1t, julia=TRUE) + plot(pit) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-2.png) + + residuals <- cocoResid(fit_2_p2q1t, val.num = 1e-10) + mean(residuals$pe.resid) + + ## [1] 0.00979969 + + var(residuals$pe.resid) + + ## [1] 1.034343 + + forecast::Acf(residuals$pe.resid) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-3.png) + + plot(residuals$pe.resid,type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-4.png) + + + + rbind(spec1 = cocoScore(fit_2_p2q1, julia=T), spec2 = cocoScore(fit_2_p2q1har, julia = T), spec3 = cocoScore(fit_2_p2q1i, julia = T), spec4=cocoScore(fit_2_p2q1t)) + + ## log.score quad.score rps.score + ## spec1 1.676187 -0.2317115 0.7128052 + ## spec2 1.674483 -0.2327295 0.7116199 + ## spec3 1.674121 -0.2320096 0.7099365 + ## spec4 1.67518 -0.2315345 0.7115837 + +All close together. + + + +# Spezification (III.3) with dataset 2013 to 2020 (March to March) + + data3 <- read_excel("rigcountsAlaskaL2013-20-march2march.xlsx") + #data2 <- read_excel("rigcountsAlaskaL2014-20-march2march.xlsx") + +**Explorative data analysis:** + +Number of observations is 365. The mean and variance of the data are: +8.0465753 and 7.1709017. + + mean(data3$AlaskaL) + + ## [1] 8.046575 + + var(data3$AlaskaL) + + ## [1] 7.170902 + + plot(data3$AlaskaL, type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/13-1.png) + + forecast::Acf(data3$AlaskaL) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/13-2.png) + + forecast::Pacf(data3$AlaskaL) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/13-3.png) + +Hm dependence looks even more pronounced… Try another data span… + + + +# Spezification (IV.1) with dataset 2016 to 2020 (March to March) + + data4 <- read_excel("rigcountsAlaskaL2016-20-march2march.xlsx") + +**Explorative data analysis:** + +Number of observations is 209. The mean and variance of the data are: +6.6124402 and 3.9884983. + +The data are severely underdisperesed. I think, we should not pursue +this here further. + + mean(data4$AlaskaL) + + ## [1] 6.61244 + + var(data4$AlaskaL) + + ## [1] 3.988498 + + plot(data4$AlaskaL, type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/15-1.png) + + forecast::Acf(data4$AlaskaL) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/15-2.png) + + forecast::Pacf(data4$AlaskaL) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/15-3.png) + +Are there quarterly seasonal effects? + +Mean counts for quarters 1 to 4: + + meanq1 <- mean(data4$AlaskaL[data4$Q1 == 1]) + meanq1 + + ## [1] 8.288462 + + meanq2 <- mean(data4$AlaskaL[data4$Q2 == 1]) + meanq2 + + ## [1] 6.604167 + + meanq3 <- mean(data4$AlaskaL[data4$Q3 == 1]) + meanq3 + + ## [1] 5.578947 + + meanq4 <- mean(data4$AlaskaL[data4$Q4 == 1]) + meanq4 + + ## [1] 6.076923 + +There is no need for a trend and the data seem not overdispersed: + + # preparations for regression analysis + X4 <- data4$AlaskaL + n4 <- length(X4) + + const_4 <- rep(1, n4) + + q1_4 <- data4$Q1 + + + xreg_4_q1 <- cbind(const_4, q1_4 ) + +Fitting a GPAR(2) model with Q1-Dummy only (log-link) + + fit_4_p2q1 <- cocoReg(order=2, type="GP", data=X4, xreg=xreg_4_q1, link_function = "log" , julia=T) + + summary(fit_4_p2q1) + + ## Coefficients: + ## Estimate Std. Error t + ## alpha1 0.1210 0.0240 5.0445 + ## alpha2 0.0590 0.0207 2.8543 + ## alpha3 0.7352 0.0459 16.0286 + ## eta 0.0171 0.0729 0.2349 + ## const_4 -0.7770 0.2845 -2.7308 + ## q1_4 0.6001 0.2424 2.4757 + ## + ## Type: GP + ## Order: 2 + ## + ## Log-likelihood: -343.0093 + +Evaluation of the fitted model: + + boot <- cocoBoot(fit_4_p2q1, rep.Bootstrap=500, conf.alpha = 0.05, julia=TRUE) + plot(boot) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-1.png) + + pit <- cocoPit(fit_4_p2q1, julia=TRUE) + plot(pit) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-2.png) + + residuals <- cocoResid(fit_4_p2q1, val.num = 1e-10) + mean(residuals$pe.resid) + + ## [1] 0.01748717 + + var(residuals$pe.resid) + + ## [1] 0.9975233 + + forecast::Acf(residuals$pe.resid) + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-3.png) + + plot(residuals$pe.resid,type="l") + +![](Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-4.png) + + diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/13-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/13-1.png new file mode 100644 index 0000000000000000000000000000000000000000..69034b6abf9a23a77f04f6c94016f4cc4265763b Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/13-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/13-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/13-2.png new file mode 100644 index 0000000000000000000000000000000000000000..67e8d5d60588c5a4c52bbd96ed836192feea0fd1 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/13-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/13-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/13-3.png new file mode 100644 index 0000000000000000000000000000000000000000..34fe7c9f323ec57c70ba9465af5abc269f4636aa Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/13-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/15-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/15-1.png new file mode 100644 index 0000000000000000000000000000000000000000..9cce825efc86ae839ff3a70a507729594a541588 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/15-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/15-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/15-2.png new file mode 100644 index 0000000000000000000000000000000000000000..16a227943dc5fae1e6ada7e223c8e66e8457715b Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/15-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/15-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/15-3.png new file mode 100644 index 0000000000000000000000000000000000000000..993ec4b2e985d0c6c40a93ab623e26ed7b57a53d Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/15-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/2-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/2-1.png new file mode 100644 index 0000000000000000000000000000000000000000..767fe9b0c58ae5603c3ca8f911f064c36daaf441 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/2-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/2-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/2-2.png new file mode 100644 index 0000000000000000000000000000000000000000..aa36ea53972a580d124be808c75d11f760df5580 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/2-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/3-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/3-1.png new file mode 100644 index 0000000000000000000000000000000000000000..a3630612f972a7e01d62fa0efa06ba479e9a09f4 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/3-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/8-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/8-1.png new file mode 100644 index 0000000000000000000000000000000000000000..0948f9cb9fafa0b7949cef41e2b48a43785ac230 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/8-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/8-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/8-2.png new file mode 100644 index 0000000000000000000000000000000000000000..cee1132951364c7813e85fd7b2cf0b792f500ea8 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/8-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/8-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/8-3.png new file mode 100644 index 0000000000000000000000000000000000000000..37b483ffdd97d4709ce280833c831c716574ee3e Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/8-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-1.png new file mode 100644 index 0000000000000000000000000000000000000000..152d9086479e4f135dc99c7f310dfdeb57f99556 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-2.png new file mode 100644 index 0000000000000000000000000000000000000000..3c7ec51350490686a51364b5b60638f83fc79b00 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-3.png new file mode 100644 index 0000000000000000000000000000000000000000..34f8e4afc4b904b8b9d24d058ab0161febcc9078 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-4.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-4.png new file mode 100644 index 0000000000000000000000000000000000000000..b181fb892d76fdcee2509738d3e6189ae87945a4 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_eval-4.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_f-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_f-1.png new file mode 100644 index 0000000000000000000000000000000000000000..99204f800468d8c9ce55bc78d669a74adf021891 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec1_f-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_eval-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_eval-1.png new file mode 100644 index 0000000000000000000000000000000000000000..5430e98f1fc4b54a49d40085ca2b1cd538908d13 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_eval-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_eval-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_eval-2.png new file mode 100644 index 0000000000000000000000000000000000000000..b3b978af60bc57df35a9b2c17810fe69aabd2a58 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_eval-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_eval-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_eval-3.png new file mode 100644 index 0000000000000000000000000000000000000000..d60c384f42462704c135dfa71b9e20d2e301e850 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_eval-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_f-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_f-1.png new file mode 100644 index 0000000000000000000000000000000000000000..c4e15fdc13ac1b9d027b9098b97c2e1d55f287f8 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec3_f-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-1.png new file mode 100644 index 0000000000000000000000000000000000000000..1f49d13a014dd224a0667c1359a0bf4848e16138 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-2.png new file mode 100644 index 0000000000000000000000000000000000000000..addcd887c7c743613ad63ce1ab014861cb0bf40f Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-3.png new file mode 100644 index 0000000000000000000000000000000000000000..f6784a40d4a1d7775a22b6972ac39222f1b955b6 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-4.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-4.png new file mode 100644 index 0000000000000000000000000000000000000000..d4bbbe5435b118a3a19af5c415a8acc00c91c2d1 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_eval-4.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_f-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_f-1.png new file mode 100644 index 0000000000000000000000000000000000000000..5af99b15b177c3b6a882138610d503704b62ef3e Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec4_f-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-1.png new file mode 100644 index 0000000000000000000000000000000000000000..38186d5fbed06290d7f781c38f8fdc6d87ac5bf1 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-2.png new file mode 100644 index 0000000000000000000000000000000000000000..11f6e1d5f214cc8f42e4bc54c35963cb80514e35 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-3.png new file mode 100644 index 0000000000000000000000000000000000000000..9fbe88ee2f534df5fb26d73c4bad056c0a318ecc Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-4.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-4.png new file mode 100644 index 0000000000000000000000000000000000000000..b7e452988c58a46f0474c16533edb8c298527db8 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec5_eval-4.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-1.png new file mode 100644 index 0000000000000000000000000000000000000000..961b75f05579429706847107b0f2f9a5526843f5 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-2.png new file mode 100644 index 0000000000000000000000000000000000000000..46eb4fe7bc81018e24f94e26ec64f027dd8f8821 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-3.png new file mode 100644 index 0000000000000000000000000000000000000000..9fbe88ee2f534df5fb26d73c4bad056c0a318ecc Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-4.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-4.png new file mode 100644 index 0000000000000000000000000000000000000000..b7e452988c58a46f0474c16533edb8c298527db8 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data1_spec6_eval-4.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-1.png new file mode 100644 index 0000000000000000000000000000000000000000..56e26f3edb3bd31266cbe88658f539da425edb4d Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-2.png new file mode 100644 index 0000000000000000000000000000000000000000..d31ba50cdd7f92e9476c3a2c97ea615d05e034ec Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-3.png new file mode 100644 index 0000000000000000000000000000000000000000..b89f46387394a2703d67d6e98bde63d5013cbbad Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-4.png b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-4.png new file mode 100644 index 0000000000000000000000000000000000000000..530da5d4adb1b283fc24aa754bad5c5c02080535 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/GP2_data4_spec1_eval-4.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-1.png new file mode 100644 index 0000000000000000000000000000000000000000..340c868052b5e76d3039a235e033a1ed13b680fb Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-2.png new file mode 100644 index 0000000000000000000000000000000000000000..f516d09d8ab7cd3afde6ca4452159bf32b8c6d69 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-3.png new file mode 100644 index 0000000000000000000000000000000000000000..f33e259011c23587302fb09ccc2bb8c847bcfdd7 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-4.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-4.png new file mode 100644 index 0000000000000000000000000000000000000000..cd5106a1a377860563e74f59aa71428442b8a0b8 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_eval-4.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_f-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_f-1.png new file mode 100644 index 0000000000000000000000000000000000000000..4ff9654f2dae3eb277103248dac24d714a98155f Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec1_f-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-1.png new file mode 100644 index 0000000000000000000000000000000000000000..8aa3891540076922455e68d20e3139c166c92ce4 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-2.png new file mode 100644 index 0000000000000000000000000000000000000000..aef6746275765f2eb9824e5929dcbd644ef49568 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-3.png new file mode 100644 index 0000000000000000000000000000000000000000..cd51afbcb2eea36ee86f035e05732c9b8728d1d3 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-4.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-4.png new file mode 100644 index 0000000000000000000000000000000000000000..ea17dd78aae733750bec25fd6c90feeea144591c Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec2_eval-4.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-1.png new file mode 100644 index 0000000000000000000000000000000000000000..92ca5fb112352d06ff777a6f118be6c8150f34f3 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-2.png new file mode 100644 index 0000000000000000000000000000000000000000..dd5bae5da20f4e18909295edd307eb8389ac74bb Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-3.png new file mode 100644 index 0000000000000000000000000000000000000000..8a25e28cb1a72992dc70ce1f261761979f5b5e29 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-4.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-4.png new file mode 100644 index 0000000000000000000000000000000000000000..c34a2926de65a5c36c3d59551c77218ef0d9df80 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_eval-4.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_f-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_f-1.png new file mode 100644 index 0000000000000000000000000000000000000000..68ae34ef68c448189e38e60cd208763dbe5d9839 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec3_f-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-1.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-1.png new file mode 100644 index 0000000000000000000000000000000000000000..22a68cedc738c3f044c100f4dae43a3fdab1f5c6 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-1.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-2.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-2.png new file mode 100644 index 0000000000000000000000000000000000000000..39bf3a16a0084ce9c77fc009ecfc78f7c09ab1e4 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-2.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-3.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-3.png new file mode 100644 index 0000000000000000000000000000000000000000..c0032760b78210837cbef98ee5093a52ab82d8b1 Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-3.png differ diff --git a/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-4.png b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-4.png new file mode 100644 index 0000000000000000000000000000000000000000..1bfba672e14b8bac3c9cdb564a4cc81cb80254fd Binary files /dev/null and b/Rnotebook-rigcounts_files/figure-markdown_strict/P2_data2_spec4_eval-4.png differ