diff --git a/docs/articles/mvgam_overview.html b/docs/articles/mvgam_overview.html index b5008e2a..480b2fbf 100644 --- a/docs/articles/mvgam_overview.html +++ b/docs/articles/mvgam_overview.html @@ -77,7 +77,7 @@
vignettes/mvgam_overview.Rmd
mvgam_overview.Rmd
## Rows: 199
## Columns: 10
-## $ moon <int> 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 3…## $ DM <int> 10, 14, 9, NA, 15, NA, NA, 9, 5, 8, NA, 14, 7, NA, NA, 9…## $ DO <int> 6, 8, 1, NA, 8, NA, NA, 3, 3, 4, NA, 3, 8, NA, NA, 3, NA…## $ PP <int> 0, 1, 2, NA, 10, NA, NA, 16, 18, 12, NA, 3, 2, NA, NA, 1…## $ OT <int> 2, 0, 1, NA, 1, NA, NA, 1, 0, 0, NA, 2, 1, NA, NA, 1, NA…## $ year <int> 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 20…## $ month <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6,…## $ mintemp <dbl> -9.710, -5.924, -0.220, 1.931, 6.568, 11.590, 14.370, 16…## $ precipitation <dbl> 37.8, 8.7, 43.5, 23.9, 0.9, 1.4, 20.3, 91.0, 60.5, 25.2,…## $ ndvi <dbl> 1.4658889, 1.5585069, 1.3378172, 1.6589129, 1.8536561, 1…
+## $ moon <int> 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 3…
+## $ DM <int> 10, 14, 9, NA, 15, NA, NA, 9, 5, 8, NA, 14, 7, NA, NA, 9…
+## $ DO <int> 6, 8, 1, NA, 8, NA, NA, 3, 3, 4, NA, 3, 8, NA, NA, 3, NA…
+## $ PP <int> 0, 1, 2, NA, 10, NA, NA, 16, 18, 12, NA, 3, 2, NA, NA, 1…
+## $ OT <int> 2, 0, 1, NA, 1, NA, NA, 1, 0, 0, NA, 2, 1, NA, NA, 1, NA…
+## $ year <int> 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 20…
+## $ month <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6,…
+## $ mintemp <dbl> -9.710, -5.924, -0.220, 1.931, 6.568, 11.590, 14.370, 16…
+## $ precipitation <dbl> 37.8, 8.7, 43.5, 23.9, 0.9, 1.4, 20.3, 91.0, 60.5, 25.2,…
+## $ ndvi <dbl> 1.4658889, 1.5585069, 1.3378172, 1.6589129, 1.8536561, 1…
We will focus analyses on the time series of captures for one specific rodent species, the Desert Pocket Mouse Chaetodipus penicillatus. This species is interesting in that it goes into a @@ -406,17 +415,17 @@
## y season year series time
## 1 0 1 1 series_1 1
-## 2 1 1 1 series_2 1
-## 3 1 1 1 series_3 1
-## 4 1 1 1 series_4 1
-## 5 1 2 1 series_1 2
+## 2 0 1 1 series_2 1
+## 3 2 1 1 series_3 1
+## 4 2 1 1 series_4 1
+## 5 2 2 1 series_1 2
## 6 1 2 1 series_2 2
-## 7 1 2 1 series_3 2
+## 7 2 2 1 series_3 2
## 8 0 2 1 series_4 2
-## 9 1 3 1 series_1 3
-## 10 1 3 1 series_2 3
-## 11 1 3 1 series_3 3
-## 12 0 3 1 series_4 3
+## 9 2 3 1 series_1 3
+## 10 7 3 1 series_2 3
+## 11 8 3 1 series_3 3
+## 12 4 3 1 series_4 3
Notice how we have four different time series in these simulated data, but we do not spread the outcome values into different columns. Rather, there is only a single column for the outcome variable, labelled @@ -471,7 +480,12 @@
## Rows: 199
## Columns: 6
-## $ series <fct> PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP…## $ year <int> 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 20…## $ time <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,…## $ count <int> 0, 1, 2, NA, 10, NA, NA, 16, 18, 12, NA, 3, 2, NA, NA, 13, NA,…## $ mintemp <dbl> -9.710, -5.924, -0.220, 1.931, 6.568, 11.590, 14.370, 16.520, …## $ ndvi <dbl> 1.4658889, 1.5585069, 1.3378172, 1.6589129, 1.8536561, 1.76132…
+## $ series <fct> PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP…
+## $ year <int> 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 20…
+## $ time <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,…
+## $ count <int> 0, 1, 2, NA, 10, NA, NA, 16, 18, 12, NA, 3, 2, NA, NA, 13, NA,…
+## $ mintemp <dbl> -9.710, -5.924, -0.220, 1.931, 6.568, 11.590, 14.370, 16.520, …
+## $ ndvi <dbl> 1.4658889, 1.5585069, 1.3378172, 1.6589129, 1.8536561, 1.76132…
You can also summarize multiple variables, which is helpful to search for data ranges and identify missing values
@@ -547,7 +561,13 @@GLMs with temporal random effectsdplyr::glimpse(model_data)
## Rows: 199
## Columns: 7
-## $ series <fct> PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, P…## $ year <int> 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2…## $ time <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18…## $ count <int> 0, 1, 2, NA, 10, NA, NA, 16, 18, 12, NA, 3, 2, NA, NA, 13, NA…## $ mintemp <dbl> -9.710, -5.924, -0.220, 1.931, 6.568, 11.590, 14.370, 16.520,…## $ ndvi <dbl> 1.4658889, 1.5585069, 1.3378172, 1.6589129, 1.8536561, 1.7613…## $ year_fac <fct> 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2…
+## $ series <fct> PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, PP, P…
+## $ year <int> 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2…
+## $ time <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18…
+## $ count <int> 0, 1, 2, NA, 10, NA, NA, 16, 18, 12, NA, 3, 2, NA, NA, 13, NA…
+## $ mintemp <dbl> -9.710, -5.924, -0.220, 1.931, 6.568, 11.590, 14.370, 16.520,…
+## $ ndvi <dbl> 1.4658889, 1.5585069, 1.3378172, 1.6589129, 1.8536561, 1.7613…
+## $ year_fac <fct> 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2…
levels(model_data$year_fac)
## [1] "2004" "2005" "2006" "2007" "2008" "2009" "2010" "2011" "2012" "2013"
@@ -598,8 +618,8 @@ GLMs with temporal random effects## 1 vector[1] mu_raw; 1 s(year_fac) pop mean
## 2 vector<lower=0>[1] sigma_raw; 1 s(year_fac) pop sd
## prior example_change
-## 1 mu_raw ~ std_normal(); mu_raw ~ normal(0.77, 0.71);
-## 2 sigma_raw ~ student_t(3, 0, 2.5); sigma_raw ~ exponential(0.95);
+## 1 mu_raw ~ std_normal(); mu_raw ~ normal(0.38, 0.41);
+## 2 sigma_raw ~ student_t(3, 0, 2.5); sigma_raw ~ exponential(0.36);
## new_lowerbound new_upperbound
## 1 NA NA
## 2 NA NA
@@ -635,33 +655,33 @@ ## Rows: 2,000
## Columns: 17
-## $ `s(year_fac).1` <dbl> 2.08031, 2.14139, 2.08884, 1.99740, 2.26875, 1.90646,…## $ `s(year_fac).2` <dbl> 2.60488, 2.52888, 2.74309, 2.59697, 2.77037, 2.57275,…## $ `s(year_fac).3` <dbl> 3.08624, 3.18546, 2.96344, 3.07401, 3.12205, 2.95258,…## $ `s(year_fac).4` <dbl> 3.26653, 3.26699, 3.35323, 3.24137, 3.20626, 3.33566,…## $ `s(year_fac).5` <dbl> 2.15022, 2.24475, 2.06944, 2.04412, 2.26502, 2.18564,…## $ `s(year_fac).6` <dbl> 1.67474, 1.97130, 1.56335, 1.72251, 1.77394, 1.62831,…## $ `s(year_fac).7` <dbl> 1.90693, 2.18487, 1.98117, 2.01677, 2.12961, 1.99228,…## $ `s(year_fac).8` <dbl> 2.94260, 2.95542, 2.97893, 3.04033, 2.90723, 3.09810,…## $ `s(year_fac).9` <dbl> 3.24186, 3.22605, 3.21179, 3.29233, 3.23729, 3.28691,…## $ `s(year_fac).10` <dbl> 2.79245, 2.72758, 2.81575, 2.72156, 2.81095, 2.79049,…## $ `s(year_fac).11` <dbl> 3.15032, 3.10892, 3.10850, 3.11659, 3.12006, 3.05922,…## $ `s(year_fac).12` <dbl> 3.23851, 3.21248, 3.16899, 3.25140, 3.28649, 3.14034,…## $ `s(year_fac).13` <dbl> 2.39143, 2.24833, 2.44651, 2.32984, 2.18376, 2.41337,…## $ `s(year_fac).14` <dbl> 2.74540, 2.56089, 2.75172, 2.71387, 2.61187, 2.52972,…## $ `s(year_fac).15` <dbl> 2.21686, 2.17691, 2.37968, 2.21372, 2.12467, 2.09551,…## $ `s(year_fac).16` <dbl> 2.08770, 2.04529, 2.10352, 2.11526, 2.00120, 2.08496,…## $ `s(year_fac).17` <dbl> 1.515040, 1.211260, 1.241590, 1.527410, 0.669471, 0.5…
+## $ `s(year_fac).1` <dbl> 2.08212, 2.13563, 2.09978, 1.96775, 2.10025, 2.00987,…
+## $ `s(year_fac).2` <dbl> 2.71049, 2.76985, 2.78095, 2.64928, 2.71481, 2.71621,…
+## $ `s(year_fac).3` <dbl> 2.99601, 3.19365, 3.13145, 3.07174, 3.07684, 3.09534,…
+## $ `s(year_fac).4` <dbl> 3.17865, 3.34493, 3.26995, 3.28116, 3.15369, 3.35802,…
+## $ `s(year_fac).5` <dbl> 2.20924, 2.07454, 2.19393, 2.10433, 2.20351, 2.14543,…
+## $ `s(year_fac).6` <dbl> 1.75460, 1.86416, 1.84508, 1.72438, 1.73111, 1.92814,…
+## $ `s(year_fac).7` <dbl> 1.88514, 2.06802, 1.95780, 1.82762, 2.08620, 2.19353,…
+## $ `s(year_fac).8` <dbl> 2.96932, 2.98186, 2.82675, 2.82874, 2.86850, 3.05983,…
+## $ `s(year_fac).9` <dbl> 3.30681, 3.24499, 3.21878, 3.21961, 3.16487, 3.34114,…
+## $ `s(year_fac).10` <dbl> 2.79073, 2.62311, 2.83885, 2.70922, 2.73095, 2.66744,…
+## $ `s(year_fac).11` <dbl> 3.10926, 3.03815, 2.98585, 2.97678, 3.08263, 3.04552,…
+## $ `s(year_fac).12` <dbl> 3.13376, 3.28079, 3.18349, 3.20083, 3.13156, 3.30719,…
+## $ `s(year_fac).13` <dbl> 2.13703, 2.50151, 2.21896, 2.07110, 2.27643, 2.23768,…
+## $ `s(year_fac).14` <dbl> 2.58957, 2.79552, 2.63736, 2.65114, 2.62641, 2.75834,…
+## $ `s(year_fac).15` <dbl> 2.16848, 2.24516, 2.33078, 2.17398, 2.17238, 2.16534,…
+## $ `s(year_fac).16` <dbl> 2.10648, 2.07510, 2.07197, 1.92124, 1.93862, 2.05727,…
+## $ `s(year_fac).17` <dbl> 1.251520, 0.866643, 0.770535, 0.742428, 1.040220, 1.4…
With any model fitted in mvgam
, the underlying
Stan
code can be viewed using the code
function:
## [1] -2.37133 3.48166
+## [1] -2.40801 3.46010
Objects of class mvgam_forecast
have an associated plot
function as well:
@@ -875,14 +911,14 @@Automatic forecasting for new dataplot(model1b, type = 'forecast')
## Out of sample DRPS:
-## [1] 182.8079
+## [1] 180.5517
We can also view the test data in the forecast plot to see that the predictions do not capture the temporal variation in the test set
plot(model1b, type = 'forecast', newdata = data_test)
## Out of sample DRPS:
-## [1] 182.8079
+## [1] 180.5517
As with the hindcast
function, we can use the
forecast
function to automatically extract the posterior
distributions for these predictions. This also returns an object of
@@ -910,12 +946,12 @@
coef(model2)
## 2.5% 50% 97.5% Rhat n_eff
-## ndvi 0.3228257 0.391166 0.4593855 1 1661
-## s(year_fac).1 1.1404162 1.400395 1.6634465 1 2466
-## s(year_fac).2 1.7973598 1.995695 2.1988837 1 2410
-## s(year_fac).3 2.1774477 2.376875 2.5715922 1 2149
-## s(year_fac).4 2.3233060 2.502500 2.6789605 1 1994
-## s(year_fac).5 1.1939365 1.422650 1.6418732 1 2250
-## s(year_fac).6 1.0095840 1.274575 1.5165723 1 2659
-## s(year_fac).7 1.1392430 1.411065 1.6643688 1 2015
-## s(year_fac).8 2.0748615 2.265685 2.4505097 1 2224
-## s(year_fac).9 2.7139455 2.856145 2.9870925 1 2627
-## s(year_fac).10 1.9799230 2.187460 2.3882100 1 2601
-## s(year_fac).11 2.2644308 2.433500 2.6032955 1 2050
-## s(year_fac).12 2.5326728 2.687635 2.8342965 1 2144
-## s(year_fac).13 1.3667295 1.612645 1.8541005 1 2548
-## s(year_fac).14 0.5727090 1.957480 3.2950085 1 1089
-## s(year_fac).15 0.6379996 1.997195 3.3552087 1 1517
-## s(year_fac).16 0.5632498 1.956545 3.2594935 1 1509
-## s(year_fac).17 0.6325674 1.982975 3.2627203 1 1021
+## ndvi 0.3254700 0.388940 0.4545993 1 1774
+## s(year_fac).1 1.1324400 1.404140 1.6680297 1 2528
+## s(year_fac).2 1.8013830 2.001210 2.1912828 1 2279
+## s(year_fac).3 2.1858860 2.384775 2.5708725 1 2055
+## s(year_fac).4 2.3185475 2.508285 2.6786000 1 1911
+## s(year_fac).5 1.2007655 1.425115 1.6407507 1 2351
+## s(year_fac).6 1.0184522 1.277490 1.5145570 1 2919
+## s(year_fac).7 1.1476518 1.415705 1.6663517 1 2459
+## s(year_fac).8 2.0888960 2.272105 2.4487602 1 2153
+## s(year_fac).9 2.7135970 2.856790 2.9818367 1 2025
+## s(year_fac).10 1.9795910 2.183405 2.3811530 1 2439
+## s(year_fac).11 2.2688975 2.434785 2.6082938 1 2031
+## s(year_fac).12 2.5372467 2.695205 2.8332955 1 2214
+## s(year_fac).13 1.3754218 1.615400 1.8429202 1 2122
+## s(year_fac).14 0.6519133 1.971190 3.3202952 1 1055
+## s(year_fac).15 0.5373446 1.969180 3.2645155 1 1622
+## s(year_fac).16 0.6892467 1.960490 3.2228937 1 1566
+## s(year_fac).17 0.5975932 2.015125 3.3076672 1 1186
Look at the estimated effect of ndvi
using
plot.mvgam
with type = 'pterms'
@@ -1053,7 +1089,24 @@Adding predictors as “fixed” eff dplyr::glimpse(beta_post)
## Rows: 2,000
## Columns: 18
-## $ ndvi <dbl> 0.387436, 0.409739, 0.394457, 0.431873, 0.396274, 0.3…## $ `s(year_fac).1` <dbl> 1.41734, 1.49543, 1.54026, 1.24608, 1.33257, 1.41159,…## $ `s(year_fac).2` <dbl> 1.95613, 1.97027, 2.00336, 1.94539, 1.92974, 1.98538,…## $ `s(year_fac).3` <dbl> 2.41307, 2.38483, 2.39814, 2.27193, 2.37262, 2.37026,…## $ `s(year_fac).4` <dbl> 2.39442, 2.33973, 2.50900, 2.39682, 2.50362, 2.51380,…## $ `s(year_fac).5` <dbl> 1.38814, 1.35694, 1.33459, 1.48374, 1.35462, 1.59126,…## $ `s(year_fac).6` <dbl> 1.24112, 1.39580, 1.21348, 1.32198, 1.23243, 1.33269,…## $ `s(year_fac).7` <dbl> 1.31151, 1.29583, 1.36247, 1.32749, 1.22643, 1.30892,…## $ `s(year_fac).8` <dbl> 2.28249, 2.24587, 2.33273, 2.13411, 2.34726, 2.30157,…## $ `s(year_fac).9` <dbl> 2.75439, 2.77804, 2.92003, 2.70158, 2.96359, 2.73798,…## $ `s(year_fac).10` <dbl> 2.12669, 2.18653, 2.20835, 2.16660, 2.24748, 2.26067,…## $ `s(year_fac).11` <dbl> 2.50111, 2.43007, 2.41899, 2.39531, 2.33690, 2.52664,…## $ `s(year_fac).12` <dbl> 2.65021, 2.70536, 2.59644, 2.72438, 2.62080, 2.75586,…## $ `s(year_fac).13` <dbl> 1.63676, 1.66940, 1.69642, 1.44458, 1.68236, 1.73516,…## $ `s(year_fac).14` <dbl> 2.00488, 1.86698, 1.72716, 1.33882, 1.50478, 2.20462,…## $ `s(year_fac).15` <dbl> 1.62293, 1.73438, 1.90062, 1.82146, 1.66189, 2.03626,…## $ `s(year_fac).16` <dbl> 1.472810, 1.407540, 1.365660, 1.079730, 1.394120, 2.3…## $ `s(year_fac).17` <dbl> 1.93064, 2.10818, 1.44301, 2.19165, 1.74017, 2.22774,…
+## $ ndvi <dbl> 0.424042, 0.415251, 0.376440, 0.366467, 0.361792, 0.3…
+## $ `s(year_fac).1` <dbl> 1.22925, 1.24749, 1.47788, 1.20037, 1.47978, 1.35059,…
+## $ `s(year_fac).2` <dbl> 1.98318, 1.87325, 1.98441, 2.06521, 2.04639, 2.00794,…
+## $ `s(year_fac).3` <dbl> 2.18793, 2.36020, 2.29305, 2.50610, 2.49024, 2.41114,…
+## $ `s(year_fac).4` <dbl> 2.39819, 2.41437, 2.52095, 2.59109, 2.47269, 2.66913,…
+## $ `s(year_fac).5` <dbl> 1.29312, 1.19872, 1.51329, 1.36905, 1.62790, 1.55644,…
+## $ `s(year_fac).6` <dbl> 1.20561, 1.01872, 1.25503, 1.25678, 1.10984, 1.13588,…
+## $ `s(year_fac).7` <dbl> 1.18002, 1.47339, 1.21908, 1.51392, 1.60791, 1.47573,…
+## $ `s(year_fac).8` <dbl> 1.98866, 2.28440, 2.18800, 2.33697, 2.22476, 2.32740,…
+## $ `s(year_fac).9` <dbl> 2.84229, 2.75877, 2.87801, 2.93136, 2.88772, 2.86256,…
+## $ `s(year_fac).10` <dbl> 2.10992, 2.04506, 2.23292, 2.26566, 2.30330, 2.27192,…
+## $ `s(year_fac).11` <dbl> 2.33570, 2.32394, 2.45942, 2.50878, 2.43429, 2.46903,…
+## $ `s(year_fac).12` <dbl> 2.71171, 2.54388, 2.76026, 2.72311, 2.83329, 2.70795,…
+## $ `s(year_fac).13` <dbl> 1.33811, 1.55696, 1.59988, 1.67098, 1.76702, 1.54182,…
+## $ `s(year_fac).14` <dbl> 1.429890, 2.359990, 2.555390, 2.251150, 2.325550, 2.6…
+## $ `s(year_fac).15` <dbl> 1.1201100, 1.7265900, 2.2085200, 1.2997700, 1.4786000…
+## $ `s(year_fac).16` <dbl> 1.447770, 1.581720, 2.045710, 0.965276, 0.979640, 1.8…
+## $ `s(year_fac).17` <dbl> 1.560560, 2.003960, 1.462440, 2.417490, 2.196010, 2.1…
The posterior distribution for the effect of ndvi
is
stored in the ndvi
column. A quick histogram confirms our
inference that log(counts)
respond positively to increases
@@ -1190,26 +1243,26 @@
mvgam
plot(model3, type = 'forecast', newdata = data_test)
## Out of sample DRPS:
-## [1] 286.0611
+## [1] 287.1214
Why is this happening? The forecasts are driven almost entirely by variation in the temporal spline, which is extrapolating linearly forever beyond the edge of the training data. Any slight @@ -1430,33 +1483,33 @@
mvgam
##
## GAM coefficient (beta) estimates:
## 2.5% 50% 97.5% Rhat n_eff
-## (Intercept) 1.200 2.0000 2.800 1.12 39
-## s(ndvi).1 -0.160 -0.0086 0.083 1.00 476
-## s(ndvi).2 -0.190 0.0170 0.340 1.00 349
-## s(ndvi).3 -0.056 -0.0016 0.052 1.00 738
-## s(ndvi).4 -0.290 0.1200 1.400 1.01 255
-## s(ndvi).5 -0.074 0.1500 0.340 1.00 395
+## (Intercept) 1.100 1.8000 2.400 1.20 18
+## s(ndvi).1 -0.160 -0.0090 0.079 1.01 444
+## s(ndvi).2 -0.130 0.0160 0.240 1.00 518
+## s(ndvi).3 -0.043 -0.0011 0.049 1.00 850
+## s(ndvi).4 -0.230 0.1200 1.100 1.02 288
+## s(ndvi).5 -0.073 0.1500 0.360 1.01 421
##
## Approximate significance of GAM observation smooths:
## edf Chi.sq p-value
-## s(ndvi) 1.25 83.8 0.087 .
+## s(ndvi) 1.09 85.9 0.065 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Latent trend parameter AR estimates:
## 2.5% 50% 97.5% Rhat n_eff
-## ar1[1] 0.70 0.81 0.91 1.01 345
-## sigma[1] 0.67 0.80 0.96 1.00 424
+## ar1[1] 0.71 0.82 0.92 1.03 98
+## sigma[1] 0.67 0.80 0.97 1.02 330
##
## Stan MCMC diagnostics:
## n_eff / iter looks reasonable for all parameters
-## Rhats above 1.05 found for 84 parameters
+## Rhats above 1.05 found for 114 parameters
## *Diagnose further to investigate why the chains have not mixed
## 0 of 2000 iterations ended with a divergence (0%)
## 0 of 2000 iterations saturated the maximum tree depth of 12 (0%)
## E-FMI indicated no pathological behavior
##
-## Samples were drawn using NUTS(diag_e) at Wed Nov 22 12:45:21 PM 2023.
+## Samples were drawn using NUTS(diag_e) at Thu Nov 23 8:38:40 AM 2023.
## For each parameter, n_eff is a crude measure of effective sample size,
## and Rhat is the potential scale reduction factor on split MCMC chains
## (at convergence, Rhat = 1)
@@ -1472,7 +1525,7 @@ mvgam
plot(model4, type = 'forecast', newdata = data_test)
## Out of sample DRPS:
-## [1] 154.5162
+## [1] 149.1606
The trend is evolving as an AR1 process, which we can also view:
plot(model4, type = 'trend', newdata = data_test)
mvgam
## Warning: Some Pareto k diagnostic values are too high. See help('pareto-k-diagnostic') for details.
## elpd_diff se_diff
## model4 0.0 0.0
-## model3 -563.9 66.3
+## model3 -559.8 66.5
The higher estimated log predictive density (ELPD) value for the dynamic model suggests it provides a better fit to the in-sample data.
@@ -1502,7 +1555,7 @@mvgam
score_mod3 <- score(fc_mod3, score = 'drps')
score_mod4 <- score(fc_mod4, score = 'drps')
sum(score_mod4$PP$score, na.rm = TRUE) - sum(score_mod3$PP$score, na.rm = TRUE)
-## [1] -131.5449
+## [1] -137.9608
A strongly negative value here suggests the score for the dynamic model (model 4) is much smaller than the score for the model with a smooth function of time (model 3)
diff --git a/docs/articles/mvgam_overview_files/figure-html/Histogram of NDVI effects-1.png b/docs/articles/mvgam_overview_files/figure-html/Histogram of NDVI effects-1.png index 96a40573..c52d0824 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/Histogram of NDVI effects-1.png and b/docs/articles/mvgam_overview_files/figure-html/Histogram of NDVI effects-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/Plot NDVI effect-1.png b/docs/articles/mvgam_overview_files/figure-html/Plot NDVI effect-1.png index 9d1dc3c5..fa4855a0 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/Plot NDVI effect-1.png and b/docs/articles/mvgam_overview_files/figure-html/Plot NDVI effect-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/Plot extrapolated temporal functions using newdata-1.png b/docs/articles/mvgam_overview_files/figure-html/Plot extrapolated temporal functions using newdata-1.png index 6b797890..88992490 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/Plot extrapolated temporal functions using newdata-1.png and b/docs/articles/mvgam_overview_files/figure-html/Plot extrapolated temporal functions using newdata-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/Plot hindcasts on the linear predictor scale-1.png b/docs/articles/mvgam_overview_files/figure-html/Plot hindcasts on the linear predictor scale-1.png index 8198ada6..84277763 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/Plot hindcasts on the linear predictor scale-1.png and b/docs/articles/mvgam_overview_files/figure-html/Plot hindcasts on the linear predictor scale-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/Plot posterior hindcasts-1.png b/docs/articles/mvgam_overview_files/figure-html/Plot posterior hindcasts-1.png index 2661eac5..d7812f02 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/Plot posterior hindcasts-1.png and b/docs/articles/mvgam_overview_files/figure-html/Plot posterior hindcasts-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/Plot posterior residuals-1.png b/docs/articles/mvgam_overview_files/figure-html/Plot posterior residuals-1.png index 8613326f..d2a4383e 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/Plot posterior residuals-1.png and b/docs/articles/mvgam_overview_files/figure-html/Plot posterior residuals-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/Plot random effect estimates-1.png b/docs/articles/mvgam_overview_files/figure-html/Plot random effect estimates-1.png index 0e444ab2..0d912046 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/Plot random effect estimates-1.png and b/docs/articles/mvgam_overview_files/figure-html/Plot random effect estimates-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/Plot smooth term derivatives-1.png b/docs/articles/mvgam_overview_files/figure-html/Plot smooth term derivatives-1.png index 0eb8a003..f689429d 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/Plot smooth term derivatives-1.png and b/docs/articles/mvgam_overview_files/figure-html/Plot smooth term derivatives-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/Plotting predictions against test data-1.png b/docs/articles/mvgam_overview_files/figure-html/Plotting predictions against test data-1.png index 0b19da6c..a52171f4 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/Plotting predictions against test data-1.png and b/docs/articles/mvgam_overview_files/figure-html/Plotting predictions against test data-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-13-1.png index 722f6e3e..85b2a965 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-13-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-13-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-17-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-17-1.png index 4fcc9737..9513a84f 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-17-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-17-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-18-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-18-1.png index 0b19da6c..a52171f4 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-18-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-18-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-22-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-22-1.png index c5c96c78..7db52031 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-22-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-22-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-23-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-23-1.png index fb94769a..fafdf812 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-23-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-23-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-23-2.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-23-2.png index 25f44845..9272ed7a 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-23-2.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-23-2.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-26-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-26-1.png index 4fb43ca9..eafd467b 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-26-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-26-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-27-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-27-1.png index 42a6da3f..23d205ca 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-27-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-27-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-28-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-28-1.png index 794425fa..39c987a4 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-28-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-28-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-28-2.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-28-2.png index 5bc48393..bac634f0 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-28-2.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-28-2.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-29-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-29-1.png index fbf842e0..0e875560 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-29-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-29-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-29-2.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-29-2.png index 1608d044..42b33af7 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-29-2.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-29-2.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-31-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-31-1.png index 8b9cf83a..745fd8ef 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-31-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-31-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-33-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-33-1.png index c8339a94..7dc03ca5 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-33-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-33-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-34-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-34-1.png index 5b90b7b1..bcdd078c 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-34-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-34-1.png differ diff --git a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-35-1.png b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-35-1.png index 4660a9ed..0ef77f85 100644 Binary files a/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-35-1.png and b/docs/articles/mvgam_overview_files/figure-html/unnamed-chunk-35-1.png differ diff --git a/docs/articles/shared_states.html b/docs/articles/shared_states.html index c8b5d9a1..518cc3c0 100644 --- a/docs/articles/shared_states.html +++ b/docs/articles/shared_states.html @@ -26,7 +26,7 @@ mvgam - 1.0.7 + 1.0.8