Skip to content

Commit b2aa753

Browse files
committed
Change the correlated_rw default from TRUE to FALSE
- this is a little buggy and seems to have challenges converging
1 parent 172307b commit b2aa753

File tree

4 files changed

+140
-143
lines changed

4 files changed

+140
-143
lines changed

R/fitting.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#' @param time String describing the name of the variable corresponding to time, defaults to "year"
99
#' @param est_df Whether or not to estimate deviations of B as Student - t with estimated degrees of freedom, defaults to `FALSE`
1010
#' @param family, The name of the family used for the response; can be one of "normal","binomial","possion","nbinom2","gamma","lognormal"
11-
#' @param correlated_rw, Whether to estimate time-varying parameters as correlated random walk, defaults to TRUE
11+
#' @param correlated_rw, Whether to estimate time-varying parameters as correlated random walk, defaults to FALSE
1212
#' @param data The data frame including response and covariates for all model components
1313
#' @param chains Number of mcmc chains, defaults to 3
1414
#' @param iter Number of mcmc iterations, defaults to 2000
@@ -75,7 +75,7 @@ fit_dlm <- function(formula = NULL,
7575
time = "year",
7676
est_df = FALSE,
7777
family = c("normal", "binomial", "poisson", "nbinom2", "gamma", "lognormal"),
78-
correlated_rw = TRUE,
78+
correlated_rw = FALSE,
7979
data,
8080
chains = 3,
8181
iter = 2000,

inst/stan/dlm.stan

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ transformed parameters {
9797
}
9898
}
9999
model {
100-
sigma ~ cauchy(0, 5); // prior for sigma
100+
sigma ~ student_t(3,0,1); // prior for sigma
101101
Lcorr ~ lkj_corr_cholesky(2.0); // prior for cholesky factor of a correlation matrix
102-
phi ~ student_t(3,0,2); // obseervation variance
102+
phi ~ student_t(3,0,1); // obseervation variance
103103
b_fixed ~ normal(0,1);
104-
nu ~ student_t(3,0,2);
104+
nu ~ student_t(3,0,1);
105105

106106
missing_fixed ~ normal(0,1); // estimates of missing Xs for fixed model
107107
missing_varying ~ normal(0,1); // estimates of missing Xs for time varying model
108-
b_devs0 ~ normal(0,1); // initial values of B at time t
108+
//b_devs0 ~ normal(0,1); // initial values of B at time t
109109
if(est_df == 0) {
110110
if(correlated_rw == 1) {
111111
for(t in 1:(nT-1)) {

0 commit comments

Comments
 (0)