From c3d8052e38965bedbce540930c4a2af288d0954c Mon Sep 17 00:00:00 2001 From: ericward-noaa Date: Mon, 22 Jan 2024 10:16:25 -0800 Subject: [PATCH] links / spacing and re-doc --- README.Rmd | 2 +- README.md | 4 +- docs/articles/a01_fitting.html | 28 ++++++------ docs/index.html | 3 +- docs/pkgdown.yml | 2 +- docs/reference/fit_zoid.html | 82 +++++++++++++++++----------------- docs/reference/get_fitted.html | 30 ++++++------- docs/reference/get_pars.html | 22 ++++----- 8 files changed, 87 insertions(+), 86 deletions(-) diff --git a/README.Rmd b/README.Rmd index bed1be8..c09e25e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -21,7 +21,7 @@ knitr::opts_chunk$set( zoid implements zero-and-one inflated Dirichlet regression (also known as trinomial mixture models) in a Bayesian framework (Stan) -You can view the pkgdown package information here:[https://noaa-nwfsc.github.io/zoid/](https://noaa-nwfsc.github.io/zoid/) +You can view the pkgdown package information here: [https://noaa-nwfsc.github.io/zoid/](https://noaa-nwfsc.github.io/zoid/) You can install the development version of the package with: diff --git a/README.md b/README.md index 7efc1b8..54c32a6 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ zoid implements zero-and-one inflated Dirichlet regression (also known as trinomial mixture models) in a Bayesian framework (Stan) -You can view the pkgdown package information -here: +You can view the pkgdown package information here: + You can install the development version of the package with: diff --git a/docs/articles/a01_fitting.html b/docs/articles/a01_fitting.html index 2795ad7..20d8d70 100644 --- a/docs/articles/a01_fitting.html +++ b/docs/articles/a01_fitting.html @@ -208,26 +208,26 @@

Summarizing estimates fitted_vals = get_fitted(fit_1) head(fitted_vals) -
##   obs group       mean     median         lo         hi
-## 1   1     1 0.03328127 0.03315307 0.03151279 0.03509031
-## 2   2     1 0.03328127 0.03315307 0.03151279 0.03509031
-## 3   3     1 0.03328127 0.03315307 0.03151279 0.03509031
-## 4   4     1 0.03328127 0.03315307 0.03151279 0.03509031
-## 5   5     1 0.03328127 0.03315307 0.03151279 0.03509031
-## 6   6     1 0.03328127 0.03315307 0.03151279 0.03509031
+
##   obs group       mean    median         lo         hi
+## 1   1     1 0.03311415 0.0329826 0.03161169 0.03523394
+## 2   2     1 0.03311415 0.0329826 0.03161169 0.03523394
+## 3   3     1 0.03311415 0.0329826 0.03161169 0.03523394
+## 4   4     1 0.03311415 0.0329826 0.03161169 0.03523394
+## 5   5     1 0.03311415 0.0329826 0.03161169 0.03523394
+## 6   6     1 0.03311415 0.0329826 0.03161169 0.03523394

Second, we can return all parameters (including betas for coefficients and \(\phi\), the overdispersion term)

 fitted_vals = get_pars(fit_1)
 head(fitted_vals$betas)
-
##   m cov         par         mean        median          lo         hi
-## 1 1   1 (Intercept) -0.003560550 -0.0038690074 -0.05207903 0.04997014
-## 2 2   1 (Intercept) -0.015810989 -0.0086503675 -0.08457123 0.05672444
-## 3 3   1 (Intercept) -0.004083677 -0.0009522793 -0.05567129 0.04460668
-## 4 4   1 (Intercept) -0.014416716 -0.0162513228 -0.06703304 0.03740511
-## 5 5   1 (Intercept) -0.016439159 -0.0091538651 -0.06154763 0.03013460
-## 6 6   1 (Intercept) -0.009760563 -0.0080342907 -0.09782504 0.07198219
+
##   m cov         par         mean       median          lo         hi
+## 1 1   1 (Intercept) -0.008802153 -0.017167978 -0.05964580 0.05494550
+## 2 2   1 (Intercept) -0.010361087 -0.004366175 -0.07964858 0.04754372
+## 3 3   1 (Intercept) -0.010413629 -0.012791217 -0.07726201 0.04417725
+## 4 4   1 (Intercept) -0.010216399 -0.008846927 -0.05633023 0.03669548
+## 5 5   1 (Intercept) -0.015234386 -0.012214700 -0.06023355 0.03678638
+## 6 6   1 (Intercept) -0.013964539 -0.011279908 -0.08013811 0.03441358

Random effects diff --git a/docs/index.html b/docs/index.html index d8e60fd..d7da549 100644 --- a/docs/index.html +++ b/docs/index.html @@ -93,6 +93,7 @@

zoid implements zero-and-one inflated Dirichlet regression (also known as trinomial mixture models) in a Bayesian framework (Stan)

+

You can view the pkgdown package information here: https://noaa-nwfsc.github.io/zoid/

You can install the development version of the package with:

 remotes::install_github("noaa-nwfsc/zoid")
@@ -146,7 +147,7 @@

Developers

Dev status

    -
  • R build status
  • +
  • R-CMD-check
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index e9e7f31..c72f4fc 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -6,5 +6,5 @@ articles: a02_simulating: a02_simulating.html a03_beta_priors: a03_beta_priors.html a04_priors: a04_priors.html -last_built: 2024-01-22T17:25Z +last_built: 2024-01-22T18:14Z diff --git a/docs/reference/fit_zoid.html b/docs/reference/fit_zoid.html index e263dfc..e256909 100644 --- a/docs/reference/fit_zoid.html +++ b/docs/reference/fit_zoid.html @@ -155,8 +155,8 @@

Examples

#> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 1). #> Chain 1: -#> Chain 1: Gradient evaluation took 4.8e-05 seconds -#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.48 seconds. +#> Chain 1: Gradient evaluation took 4.9e-05 seconds +#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.49 seconds. #> Chain 1: Adjust your expectations accordingly! #> Chain 1: #> Chain 1: @@ -173,9 +173,9 @@

Examples

#> Chain 1: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 1: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 1: -#> Chain 1: Elapsed Time: 0.09 seconds (Warm-up) -#> Chain 1: 0.099 seconds (Sampling) -#> Chain 1: 0.189 seconds (Total) +#> Chain 1: Elapsed Time: 0.087 seconds (Warm-up) +#> Chain 1: 0.101 seconds (Sampling) +#> Chain 1: 0.188 seconds (Total) #> Chain 1: #> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 2). @@ -198,15 +198,15 @@

Examples

#> Chain 2: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 2: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 2: -#> Chain 2: Elapsed Time: 0.088 seconds (Warm-up) -#> Chain 2: 0.087 seconds (Sampling) -#> Chain 2: 0.175 seconds (Total) +#> Chain 2: Elapsed Time: 0.087 seconds (Warm-up) +#> Chain 2: 0.084 seconds (Sampling) +#> Chain 2: 0.171 seconds (Total) #> Chain 2: #> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 3). #> Chain 3: -#> Chain 3: Gradient evaluation took 2.1e-05 seconds -#> Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 0.21 seconds. +#> Chain 3: Gradient evaluation took 2e-05 seconds +#> Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 0.2 seconds. #> Chain 3: Adjust your expectations accordingly! #> Chain 3: #> Chain 3: @@ -223,9 +223,9 @@

Examples

#> Chain 3: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 3: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 3: -#> Chain 3: Elapsed Time: 0.091 seconds (Warm-up) -#> Chain 3: 0.1 seconds (Sampling) -#> Chain 3: 0.191 seconds (Total) +#> Chain 3: Elapsed Time: 0.09 seconds (Warm-up) +#> Chain 3: 0.094 seconds (Sampling) +#> Chain 3: 0.184 seconds (Total) #> Chain 3: # fit a model with 1 factor @@ -234,8 +234,8 @@

Examples

#> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 1). #> Chain 1: -#> Chain 1: Gradient evaluation took 2.4e-05 seconds -#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.24 seconds. +#> Chain 1: Gradient evaluation took 2.3e-05 seconds +#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.23 seconds. #> Chain 1: Adjust your expectations accordingly! #> Chain 1: #> Chain 1: @@ -252,15 +252,15 @@

Examples

#> Chain 1: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 1: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 1: -#> Chain 1: Elapsed Time: 0.191 seconds (Warm-up) -#> Chain 1: 0.199 seconds (Sampling) -#> Chain 1: 0.39 seconds (Total) +#> Chain 1: Elapsed Time: 0.186 seconds (Warm-up) +#> Chain 1: 0.194 seconds (Sampling) +#> Chain 1: 0.38 seconds (Total) #> Chain 1: #> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 2). #> Chain 2: -#> Chain 2: Gradient evaluation took 2.1e-05 seconds -#> Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.21 seconds. +#> Chain 2: Gradient evaluation took 2.2e-05 seconds +#> Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.22 seconds. #> Chain 2: Adjust your expectations accordingly! #> Chain 2: #> Chain 2: @@ -277,15 +277,15 @@

Examples

#> Chain 2: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 2: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 2: -#> Chain 2: Elapsed Time: 0.193 seconds (Warm-up) -#> Chain 2: 0.182 seconds (Sampling) -#> Chain 2: 0.375 seconds (Total) +#> Chain 2: Elapsed Time: 0.203 seconds (Warm-up) +#> Chain 2: 0.199 seconds (Sampling) +#> Chain 2: 0.402 seconds (Total) #> Chain 2: #> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 3). #> Chain 3: -#> Chain 3: Gradient evaluation took 2.1e-05 seconds -#> Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 0.21 seconds. +#> Chain 3: Gradient evaluation took 4.8e-05 seconds +#> Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 0.48 seconds. #> Chain 3: Adjust your expectations accordingly! #> Chain 3: #> Chain 3: @@ -302,9 +302,9 @@

Examples

#> Chain 3: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 3: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 3: -#> Chain 3: Elapsed Time: 0.206 seconds (Warm-up) -#> Chain 3: 0.205 seconds (Sampling) -#> Chain 3: 0.411 seconds (Total) +#> Chain 3: Elapsed Time: 0.189 seconds (Warm-up) +#> Chain 3: 0.184 seconds (Sampling) +#> Chain 3: 0.373 seconds (Total) #> Chain 3: # } # try a model with random effects @@ -317,8 +317,8 @@

Examples

#> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 1). #> Chain 1: -#> Chain 1: Gradient evaluation took 0.000182 seconds -#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 1.82 seconds. +#> Chain 1: Gradient evaluation took 0.000181 seconds +#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 1.81 seconds. #> Chain 1: Adjust your expectations accordingly! #> Chain 1: #> Chain 1: @@ -335,15 +335,15 @@

Examples

#> Chain 1: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 1: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 1: -#> Chain 1: Elapsed Time: 2.599 seconds (Warm-up) -#> Chain 1: 2.188 seconds (Sampling) -#> Chain 1: 4.787 seconds (Total) +#> Chain 1: Elapsed Time: 2.669 seconds (Warm-up) +#> Chain 1: 3.37 seconds (Sampling) +#> Chain 1: 6.039 seconds (Total) #> Chain 1: #> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 2). #> Chain 2: -#> Chain 2: Gradient evaluation took 0.00015 seconds -#> Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 1.5 seconds. +#> Chain 2: Gradient evaluation took 0.000151 seconds +#> Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 1.51 seconds. #> Chain 2: Adjust your expectations accordingly! #> Chain 2: #> Chain 2: @@ -360,9 +360,9 @@

Examples

#> Chain 2: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 2: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 2: -#> Chain 2: Elapsed Time: 2.768 seconds (Warm-up) -#> Chain 2: 35.395 seconds (Sampling) -#> Chain 2: 38.163 seconds (Total) +#> Chain 2: Elapsed Time: 3.073 seconds (Warm-up) +#> Chain 2: 35.753 seconds (Sampling) +#> Chain 2: 38.826 seconds (Total) #> Chain 2: #> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 3). @@ -385,9 +385,9 @@

Examples

#> Chain 3: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 3: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 3: -#> Chain 3: Elapsed Time: 2.063 seconds (Warm-up) -#> Chain 3: 2.754 seconds (Sampling) -#> Chain 3: 4.817 seconds (Total) +#> Chain 3: Elapsed Time: 2.101 seconds (Warm-up) +#> Chain 3: 2.787 seconds (Sampling) +#> Chain 3: 4.888 seconds (Total) #> Chain 3: #> Warning: There were 3 divergent transitions after warmup. See #> https://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup diff --git a/docs/reference/get_fitted.html b/docs/reference/get_fitted.html index 8da6a24..6ce2315 100644 --- a/docs/reference/get_fitted.html +++ b/docs/reference/get_fitted.html @@ -108,8 +108,8 @@

Examples

#> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 1). #> Chain 1: -#> Chain 1: Gradient evaluation took 2.4e-05 seconds -#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.24 seconds. +#> Chain 1: Gradient evaluation took 2.3e-05 seconds +#> Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0.23 seconds. #> Chain 1: Adjust your expectations accordingly! #> Chain 1: #> Chain 1: @@ -126,15 +126,15 @@

Examples

#> Chain 1: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 1: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 1: -#> Chain 1: Elapsed Time: 0.122 seconds (Warm-up) -#> Chain 1: 0.106 seconds (Sampling) -#> Chain 1: 0.228 seconds (Total) +#> Chain 1: Elapsed Time: 0.095 seconds (Warm-up) +#> Chain 1: 0.092 seconds (Sampling) +#> Chain 1: 0.187 seconds (Total) #> Chain 1: #> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 2). #> Chain 2: -#> Chain 2: Gradient evaluation took 2.2e-05 seconds -#> Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.22 seconds. +#> Chain 2: Gradient evaluation took 2.3e-05 seconds +#> Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 0.23 seconds. #> Chain 2: Adjust your expectations accordingly! #> Chain 2: #> Chain 2: @@ -151,15 +151,15 @@

Examples

#> Chain 2: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 2: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 2: -#> Chain 2: Elapsed Time: 0.091 seconds (Warm-up) -#> Chain 2: 0.102 seconds (Sampling) -#> Chain 2: 0.193 seconds (Total) +#> Chain 2: Elapsed Time: 0.119 seconds (Warm-up) +#> Chain 2: 0.095 seconds (Sampling) +#> Chain 2: 0.214 seconds (Total) #> Chain 2: #> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 3). #> Chain 3: -#> Chain 3: Gradient evaluation took 2.2e-05 seconds -#> Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 0.22 seconds. +#> Chain 3: Gradient evaluation took 2.4e-05 seconds +#> Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 0.24 seconds. #> Chain 3: Adjust your expectations accordingly! #> Chain 3: #> Chain 3: @@ -176,9 +176,9 @@

Examples

#> Chain 3: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 3: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 3: -#> Chain 3: Elapsed Time: 0.106 seconds (Warm-up) -#> Chain 3: 0.103 seconds (Sampling) -#> Chain 3: 0.209 seconds (Total) +#> Chain 3: Elapsed Time: 0.095 seconds (Warm-up) +#> Chain 3: 0.101 seconds (Sampling) +#> Chain 3: 0.196 seconds (Total) #> Chain 3: p_hat <- get_fitted(fit) # } diff --git a/docs/reference/get_pars.html b/docs/reference/get_pars.html index c9f3d34..8fb9c14 100644 --- a/docs/reference/get_pars.html +++ b/docs/reference/get_pars.html @@ -128,9 +128,9 @@

Examples

#> Chain 1: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 1: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 1: -#> Chain 1: Elapsed Time: 0.123 seconds (Warm-up) -#> Chain 1: 0.124 seconds (Sampling) -#> Chain 1: 0.247 seconds (Total) +#> Chain 1: Elapsed Time: 0.088 seconds (Warm-up) +#> Chain 1: 0.095 seconds (Sampling) +#> Chain 1: 0.183 seconds (Total) #> Chain 1: #> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 2). @@ -153,15 +153,15 @@

Examples

#> Chain 2: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 2: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 2: -#> Chain 2: Elapsed Time: 0.091 seconds (Warm-up) -#> Chain 2: 0.098 seconds (Sampling) -#> Chain 2: 0.189 seconds (Total) +#> Chain 2: Elapsed Time: 0.089 seconds (Warm-up) +#> Chain 2: 0.103 seconds (Sampling) +#> Chain 2: 0.192 seconds (Total) #> Chain 2: #> #> SAMPLING FOR MODEL 'dirichregmod' NOW (CHAIN 3). #> Chain 3: -#> Chain 3: Gradient evaluation took 2.1e-05 seconds -#> Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 0.21 seconds. +#> Chain 3: Gradient evaluation took 2e-05 seconds +#> Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 0.2 seconds. #> Chain 3: Adjust your expectations accordingly! #> Chain 3: #> Chain 3: @@ -178,9 +178,9 @@

Examples

#> Chain 3: Iteration: 1800 / 2000 [ 90%] (Sampling) #> Chain 3: Iteration: 2000 / 2000 [100%] (Sampling) #> Chain 3: -#> Chain 3: Elapsed Time: 0.088 seconds (Warm-up) -#> Chain 3: 0.098 seconds (Sampling) -#> Chain 3: 0.186 seconds (Total) +#> Chain 3: Elapsed Time: 0.116 seconds (Warm-up) +#> Chain 3: 0.095 seconds (Sampling) +#> Chain 3: 0.211 seconds (Total) #> Chain 3: p_hat <- get_pars(fit) # }