Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Models with unequal variance-covariance observation error matrix with several long time series #10

Open
Giapass opened this issue May 18, 2020 · 0 comments

Comments

@Giapass
Copy link

Giapass commented May 18, 2020

Hi,
I am trying to fit a dfa model for 55 time series using 3 trends. I had no issues when considering an observation error matrix with diagonal and equal variance-covariance.

https://github.com/Giapass/Landings/blob/master/dat.csv

fit<-fit_dfa(y = dat, num_trends = 3, zscore = FALSE,iter = 1000, varIndx = rep(1,55), chains = 4, thin = 1, control = list(adapt_delta =0.99, max_treedepth = 15), estimate_nu = FALSE, est_correlation = FALSE)

However, when specifing a model with diagonal and unequal variance-covariance matrix
fit<-fit_dfa(y = dat, num_trends = 3, zscore = FALSE,iter = 1000, varIndx = c(1:55), chains = 4, thin = 1, control = list(adapt_delta =0.99, max_treedepth = 15), estimate_nu = FALSE, est_correlation = FALSE)

The chains did'nt initialized and these kind of errors are repeated hundred times:

SAMPLING FOR MODEL 'dfa' NOW (CHAIN 1).
Chain 1: Rejecting initial value:
Chain 1: Log probability evaluates to log(0), i.e. negative infinity.
Chain 1: Initialization between (-2, 2) failed after 100 attempts.
Chain 1: Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
[1] "Error in sampler$call_sampler(args_list[[i]]) : Initialization failed."
[1] ```
"error occurred during calling the sampler; sampling not done"
Stan model 'dfa' does not contain samples.
Stan model 'dfa' does not contain samples.
Stan model 'dfa' does not contain samples.
Error in names(object) <- nm :
'names' attribute [1] must be the same length as the vector [0]

I know that is not a problem with the data because, using only 40 series, the model runs but as far as I include one serie more (not matter which serie) it stop working. 
Not sure where is the problem for bayesdfa as for the library 'atsar' (I suppose the previous package) the same parameters for initialization works.

I will appreciate so much your help to solve this issue.
Regards

Giannina Passuni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant