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

Dense hessian when only NAA-1 (recruitment) are random effects #21

Open
brianstock-NOAA opened this issue Aug 10, 2020 · 1 comment
Open
Labels
enhancement Suggestion for new feature

Comments

@brianstock-NOAA
Copy link
Contributor

brianstock-NOAA commented Aug 10, 2020

library(wham)
path_to_examples <- system.file("extdata", package="wham")
asap3 <- read_asap3_dat(file.path(path_to_examples,"ex1_SNEMAYT.dat"))

# only recruitments are random effects
#   = dense Hessian
input1 <- prepare_wham_input(asap3, recruit_model=2, model_name="Ex 1: SNEMA Yellowtail Flounder",
	                            selectivity=list(model=rep("age-specific",3), 
                                	re=rep("none",3), 
                                	initial_pars=list(c(0.5,0.5,0.5,0.5,1,0.5),c(0.5,0.5,0.5,1,0.5,0.5),c(0.5,1,0.5,0.5,0.5,0.5)), 
                                	fix_pars=list(5,4,2)),
	                            NAA_re = list(sigma="rec", cor="iid"))
m1 <- fit_wham(input1, do.fit=F)
Matrix::image(m1$env$spHess(random=TRUE), border.col=NA)

m1_dense

# Full state-space model (all NAA are random effects)
#   = sparse Hessian
input3 <- prepare_wham_input(asap3, recruit_model=2, model_name="Ex 1: SNEMA Yellowtail Flounder",
	                            selectivity=list(model=rep("age-specific",3), 
                                	re=rep("none",3), 
                                	initial_pars=list(c(0.5,0.5,0.5,0.5,1,0.5),c(0.5,0.5,0.5,1,0.5,0.5),c(0.5,1,0.5,0.5,0.5,0.5)), 
                                	fix_pars=list(5,4,2)),
	                            NAA_re = list(sigma="rec+1", cor="iid"))
m3 <- fit_wham(input3, do.fit=F)
Matrix::image(m3$env$spHess(random=TRUE), border.col=NA)

m3_sparse

Breadcrumbs:

@brianstock-NOAA
Copy link
Contributor Author

Ideas to try:

  1. all NAA random effects but with variance ~ 0
  2. auxiliary random effects
  3. different parameterization (look at a4a)

@brianstock-NOAA brianstock-NOAA added to do The list enhancement Suggestion for new feature and removed to do The list labels Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Suggestion for new feature
Projects
None yet
Development

No branches or pull requests

1 participant