From 933c5e3d6351b3e39355b2cb72265860b833c279 Mon Sep 17 00:00:00 2001 From: XueqingYin <83759494+XueqingYin@users.noreply.github.com> Date: Wed, 4 Oct 2023 10:40:26 +0100 Subject: [PATCH 1/3] Update parameter labels for consistency and the temporal priors description Update the parameter names on the left side of the App to ensure consistency with the descriptions provided in the Help section. Update the temporal priors description under the help tab. --- R/shiny_priors.R | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/R/shiny_priors.R b/R/shiny_priors.R index 35cba0c4..c54ed60d 100644 --- a/R/shiny_priors.R +++ b/R/shiny_priors.R @@ -27,12 +27,11 @@ priors_shiny <- function(spatial_data, prior_sigma_text <- "A length 2 vector, with (sigma0, Psigma) specifying that P(σ > σ_0)=p_σ, where σ is the marginal standard deviation of the field." - control_group_text <- "Temporal priors are set using alpha and PG alpha. These are passed used to create alphaprior. - We use pass this to the control.group argument, control.group = list(model = 'ar1', hyper = alphaprior). This specifies that across time, - the process evolves according to an AR(1) process where the prior for the autocorrelation - parameter α is given by alphaprior. We define alphaprior with the prior 'pccor1' which is a PC - prior for the autocorrelation parameter a where α=1 is the base model." - + control_group_text <- "Temporal priors for the temporal autocorrelation parameter α are set using prior_alpha and pg_alpha, in the relation that P(α > prior_alpha) = pg_alpha, indicating that the probability of α greater than prior_alpha is pg_alpha. + These values are used to create alphaprior, which is then passed to the control.group argument, control.group = list(model = 'ar1', hyper = alphaprior). + It specifies that across time, the process evolves according to an AR(1) process where the prior for the autocorrelation parameter α is given by alphaprior. + We define alphaprior with the prior 'pccor1' which is a PC prior for the temporal autocorrelation parameter α." + citation_priors <- "Spatial and field prior explanation taken from https://rdrr.io/github/INBO-BMK/INLA/man/inla.spde2.pcmatern.html" citation_control_group <- "Prior explanation text modified from https://www.paulamoraga.com/book-geospatial/sec-geostatisticaldataexamplest.html" @@ -78,33 +77,33 @@ priors_shiny <- function(spatial_data, shiny::h3("Priors"), shiny::sliderInput( inputId = "prior_range", - label = "Spatial range:", + label = "range0:", min = 0.05, value = 0.05, max = 1 ), shiny::sliderInput( inputId = "ps_range", - label = "Range probabilty:", + label = "Prange:", min = 0.1, value = 0.1, max = 1 ), shiny::sliderInput( inputId = "prior_sigma", - label = "Standard deviation:", + label = "sigma0:", min = 0.05, value = 0.05, max = 2 ), shiny::sliderInput( inputId = "pg_sigma", - label = "Standard dev. probability:", + label = "Psigma:", min = 0.1, value = 0.2, max = 1 ), shiny::h3("Temporal priors"), shiny::sliderInput( inputId = "prior_ar1", - label = "Alpha:", + label = "prior_alpha:", min = -1, value = -0.2, max = 1.0, step = 0.1, ), shiny::sliderInput( inputId = "pg_ar1", - label = "PG Alpha:", + label = "pg_alpha:", min = 0, value = 0.8, max = 1 ), shiny::textOutput(outputId = "status") From 3f591043b0f210bb3adbe5aeee298b62a014f714 Mon Sep 17 00:00:00 2001 From: XueqingYin <83759494+XueqingYin@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:02:55 +0100 Subject: [PATCH 2/3] Update help descriptions for spatial priors and field priors Update the help descriptions for spatial priors and field priors to ensure clarity --- R/shiny_priors.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/shiny_priors.R b/R/shiny_priors.R index c54ed60d..e1afe873 100644 --- a/R/shiny_priors.R +++ b/R/shiny_priors.R @@ -21,11 +21,11 @@ priors_shiny <- function(spatial_data, } # Text for priors help - prior_range_text <- "A length 2 vector, with (range0, Prange) specifying that P(ρ < ρ_0)=p_ρ, - where ρ is the spatial range of the random field." + prior_range_text <- "A length 2 vector, with (range0, Prange) specifying that P(ρ < ρ_0)=p_ρ, + where ρ is the spatial range of the random field. P(ρ < ρ_0)=p_ρ indicates that the probability of ρ smaller than ρ_0 (range0) is p_ρ (Prange)." - prior_sigma_text <- "A length 2 vector, with (sigma0, Psigma) specifying that P(σ > σ_0)=p_σ, - where σ is the marginal standard deviation of the field." + prior_sigma_text <- "A length 2 vector, with (sigma0, Psigma) specifying that P(σ > σ_0)=p_σ, + where σ is the marginal standard deviation of the field. P(σ > σ_0)=p_σ indicates that the probability of σ greater than σ_0 (sigma0) is p_σ (Psigma)." control_group_text <- "Temporal priors for the temporal autocorrelation parameter α are set using prior_alpha and pg_alpha, in the relation that P(α > prior_alpha) = pg_alpha, indicating that the probability of α greater than prior_alpha is pg_alpha. These values are used to create alphaprior, which is then passed to the control.group argument, control.group = list(model = 'ar1', hyper = alphaprior). From 8cf637fb91bf9c59ed52b09feec72b58fbe5414a Mon Sep 17 00:00:00 2001 From: XueqingYin <83759494+XueqingYin@users.noreply.github.com> Date: Thu, 5 Oct 2023 16:29:52 +0100 Subject: [PATCH 3/3] Update the help descriptions for the temporal priors Update the help descriptions for the temporal priors --- R/shiny_priors.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/shiny_priors.R b/R/shiny_priors.R index e1afe873..3cd7ac04 100644 --- a/R/shiny_priors.R +++ b/R/shiny_priors.R @@ -30,7 +30,7 @@ priors_shiny <- function(spatial_data, control_group_text <- "Temporal priors for the temporal autocorrelation parameter α are set using prior_alpha and pg_alpha, in the relation that P(α > prior_alpha) = pg_alpha, indicating that the probability of α greater than prior_alpha is pg_alpha. These values are used to create alphaprior, which is then passed to the control.group argument, control.group = list(model = 'ar1', hyper = alphaprior). It specifies that across time, the process evolves according to an AR(1) process where the prior for the autocorrelation parameter α is given by alphaprior. - We define alphaprior with the prior 'pccor1' which is a PC prior for the temporal autocorrelation parameter α." + We define alphaprior with the prior 'pccor1', which is a Penalised Complexity (PC) prior for the temporal autocorrelation parameter α, with α = 1 indicating strong temporal dependence, and α = 0 indicating independence across time." citation_priors <- "Spatial and field prior explanation taken from https://rdrr.io/github/INBO-BMK/INLA/man/inla.spde2.pcmatern.html" citation_control_group <- "Prior explanation text modified from https://www.paulamoraga.com/book-geospatial/sec-geostatisticaldataexamplest.html"