Skip to content

Commit

Permalink
add seminar embed; update site
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Clark committed Jan 16, 2024
1 parent 524c348 commit d4e89f2
Show file tree
Hide file tree
Showing 43 changed files with 197 additions and 43 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,13 @@ importFrom(stats,predict)
importFrom(stats,printCoefmat)
importFrom(stats,qbinom)
importFrom(stats,qcauchy)
importFrom(stats,qlogis)
importFrom(stats,qnorm)
importFrom(stats,qqline)
importFrom(stats,qqnorm)
importFrom(stats,quantile)
importFrom(stats,rbeta)
importFrom(stats,rbinom)
importFrom(stats,reformulate)
importFrom(stats,rgamma)
importFrom(stats,rlnorm)
Expand Down
4 changes: 2 additions & 2 deletions R/families.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' \item \code{nmix} for count data with imperfect detection modeled via a
#' State-Space N-Mixture model. The latent states are Poisson (with log link), capturing the 'true' latent
#' abundance, while the observation process is Binomial to account for imperfect detection. The
#' observation formula in these models is used to set up a linear predictor for the detection
#' observation \code{formula} in these models is used to set up a linear predictor for the detection
#' probability (with logit link). See the example below for a more detailed worked explanation
#' of the `nmix()` family
#' }
Expand Down Expand Up @@ -174,7 +174,7 @@ student_t = function(link = 'identity'){
#' det_plot <- plot(conditional_effects(mod,
#' type = 'detection',
#' effects = 'rainfall'),
#' plot = FALSE
#' plot = FALSE)
#' det_plot[[1]] +
#' ylab('Pr(detection)')
#'
Expand Down
2 changes: 1 addition & 1 deletion R/mvgam.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#'@param trend_knots As for `knots` above, this is an optional \code{list} of knot values for smooth
#'functions within the `trend_formula`
#'@param data A \code{dataframe} or \code{list} containing the model response variable and covariates
#'required by the GAM \code{formula}. Should include columns:
#'required by the GAM \code{formula} and optional \code{trend_formula}. Should include columns:
#'`series` (a \code{factor} index of the series IDs;the number of levels should be identical
#'to the number of unique series labels (i.e. `n_series = length(levels(data$series))`))
#'`time` (\code{numeric} or \code{integer} index of the time point for each observation).
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ A series of [vignettes cover data formatting, forecasting and several extended c

## Installation
Install from `GitHub` using:
`devtools::install_github("nicholasjclark/mvgam")`. Note that to condition models with MCMC sampling, either `JAGS` (along with packages `rjags` and `runjags`) or `Stan` must be installed (along with either `rstan` and/or `cmdstanr`). Please refer to installation links for `JAGS` [here](https://sourceforge.net/projects/mcmc-jags/files/){target="_blank"}, for `Stan` with `rstan` [here](https://mc-stan.org/users/interfaces/rstan){target="_blank"}, or for `Stan` with `cmdstandr` [here](https://mc-stan.org/cmdstanr/){target="_blank"}. You will need a fairly recent version of `Stan` to ensure all syntax is recognized. If you see warnings such as `variable "array" does not exist`, this is usually a sign that you need to update `Stan`. We highly recommend you use `Cmdstan` through the `cmdstanr` interface. This is because `Cmdstan` is easier to install, is more up to date with new features, and uses less memory than `Rstan`. See [this documentation from the `Cmdstan` team for more information](http://mc-stan.org/cmdstanr/articles/cmdstanr.html#comparison-with-rstan){target="_blank"}.
`devtools::install_github("nicholasjclark/mvgam")`. Note that to condition models on observed data, either `JAGS` (along with packages `rjags` and `runjags`) or `Stan` must be installed (along with either `rstan` and/or `cmdstanr`). Please refer to installation links for `JAGS` [here](https://sourceforge.net/projects/mcmc-jags/files/){target="_blank"}, for `Stan` with `rstan` [here](https://mc-stan.org/users/interfaces/rstan){target="_blank"}, or for `Stan` with `cmdstandr` [here](https://mc-stan.org/cmdstanr/){target="_blank"}. You will need a fairly recent version of `Stan` to ensure all syntax is recognized. If you see warnings such as `variable "array" does not exist`, this is usually a sign that you need to update `Stan`. We highly recommend you use `Cmdstan` through the `cmdstanr` interface. This is because `Cmdstan` is easier to install, is more up to date with new features, and uses less memory than `Rstan`. See [this documentation from the `Cmdstan` team for more information](http://mc-stan.org/cmdstanr/articles/cmdstanr.html#comparison-with-rstan){target="_blank"}.

## Citing mvgam and related software
When using any software please make sure to appropriately acknowledge the hard work that developers and maintainers put into making these packages available. Citations are currently the best way to formally acknowledge this work, so we highly encourage you to cite any packages that you rely on for your research.
Expand Down
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ been compiled:

Install from `GitHub` using:
`devtools::install_github("nicholasjclark/mvgam")`. Note that to
condition models with MCMC sampling, either `JAGS` (along with packages
condition models on observed data, either `JAGS` (along with packages
`rjags` and `runjags`) or `Stan` must be installed (along with either
`rstan` and/or `cmdstanr`). Please refer to installation links for
`JAGS` <a href="https://sourceforge.net/projects/mcmc-jags/files/"
Expand Down Expand Up @@ -317,29 +317,29 @@ summary(lynx_mvgam)
#>
#>
#> GAM coefficient (beta) estimates:
#> 2.5% 50% 97.5% Rhat n_eff
#> (Intercept) 6.10 6.600 7.000 1.00 355
#> s(season).1 -0.59 0.046 0.710 1.00 1022
#> s(season).2 -0.26 0.770 1.800 1.00 443
#> s(season).3 -0.12 1.100 2.400 1.00 399
#> s(season).4 -0.51 0.410 1.300 1.00 890
#> s(season).5 -1.20 -0.130 0.950 1.01 503
#> s(season).6 -1.00 -0.011 1.100 1.01 699
#> s(season).7 -0.71 0.340 1.400 1.00 711
#> s(season).8 -0.92 0.180 1.800 1.00 371
#> s(season).9 -1.10 -0.290 0.710 1.00 476
#> s(season).10 -1.30 -0.660 0.027 1.00 595
#> 2.5% 50% 97.5% Rhat n_eff
#> (Intercept) 6.200 6.6000 7.000 1 1020
#> s(season).1 -0.590 0.0500 0.700 1 1094
#> s(season).2 -0.240 0.8100 1.800 1 417
#> s(season).3 -0.057 1.2000 2.500 1 365
#> s(season).4 -0.510 0.4200 1.400 1 951
#> s(season).5 -1.200 -0.1400 1.000 1 538
#> s(season).6 -1.100 0.0074 1.100 1 632
#> s(season).7 -0.790 0.3800 1.400 1 847
#> s(season).8 -1.000 0.2900 1.800 1 413
#> s(season).9 -1.100 -0.2700 0.670 1 574
#> s(season).10 -1.400 -0.6900 -0.025 1 641
#>
#> Approximate significance of GAM observation smooths:
#> edf Chi.sq p-value
#> s(season) 5.08 17751 0.25
#> edf Chi.sq p-value
#> s(season) 5 17851 0.28
#>
#> Latent trend AR parameter estimates:
#> 2.5% 50% 97.5% Rhat n_eff
#> ar1[1] 0.74 1.10 1.400 1 635
#> ar2[1] -0.84 -0.40 0.062 1 1514
#> ar3[1] -0.47 -0.13 0.290 1 540
#> sigma[1] 0.40 0.50 0.640 1 1154
#> ar1[1] 0.74 1.10 1.400 1 695
#> ar2[1] -0.82 -0.41 0.045 1 1630
#> ar3[1] -0.47 -0.12 0.280 1 453
#> sigma[1] 0.40 0.50 0.630 1 1101
#>
#> Stan MCMC diagnostics:
#> n_eff / iter looks reasonable for all parameters
Expand All @@ -348,7 +348,7 @@ summary(lynx_mvgam)
#> 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 Mon Jan 15 8:57:57 AM 2024.
#> Samples were drawn using NUTS(diag_e) at Tue Jan 16 8:42:08 PM 2024.
#> 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)
Expand Down Expand Up @@ -470,7 +470,7 @@ plot(lynx_mvgam, type = 'forecast', newdata = lynx_test)
<img src="man/figures/README-unnamed-chunk-21-1.png" width="60%" style="display: block; margin: auto;" />

#> Out of sample CRPS:
#> [1] 2892.767
#> [1] 2856.97

And the estimated latent trend component, again using the more flexible
`plot_mvgam_...()` option to show first derivatives of the estimated
Expand Down Expand Up @@ -626,7 +626,7 @@ summary(mod, include_betas = FALSE)
#> 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 Mon Jan 15 8:59:01 AM 2024.
#> Samples were drawn using NUTS(diag_e) at Tue Jan 16 8:44:20 PM 2024.
#> 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)
Expand Down
10 changes: 10 additions & 0 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/reference/figures/README-unnamed-chunk-13-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-unnamed-chunk-14-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-unnamed-chunk-15-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-unnamed-chunk-16-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-unnamed-chunk-17-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-unnamed-chunk-18-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-unnamed-chunk-19-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-unnamed-chunk-20-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-unnamed-chunk-21-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-unnamed-chunk-22-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-unnamed-chunk-23-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-unnamed-chunk-24-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/figures/README-unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions docs/reference/get_mvgam_priors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/mvgam.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d4e89f2

Please sign in to comment.