Description Usage Arguments Author(s) References See Also Examples
(Attempt to) perform the SS implementation of the Laplace Approximation from Thorson, Hicks and Methot (2014) ICES J. Mar. Sci.
1 2 3 4 
File 
Directory containing Stock Synthesis files (e.g., "C:/Users/James Thorson/Desktop/") 
Input_SD_Group_Vec 
Vector where each element is the standard deviation for a group of random effects (e.g., a model with a single group of random effects will have Input_SD_Group_Vec be a vector of length one) 
CTL_linenum_List 
List (same length as 
ESTPAR_num_List 
List (same length as 
PAR_num_Vec 
Vector giving the number in the "ss3.par" vector for each random effect coefficient. 
Int_Group_List 
List where each element is a vector, providing a way of
grouping different random effect groups into a single category. This is not
used (but input is still required) when 
Version 
Integer (options are 1, 5, and 6) giving the type of Laplace Approximation. I recommend 1. 
StartFromPar 
Logical flag (TRUE or FALSE) saying whether to start each round of optimization from a "ss3.par" file (I recommend TRUE) 
Intern 
Logical flag saying whether to display all ss3 runtime output in the R terminal 
ReDoBiasRamp 
Logical flag saying whether to redo the bias ramp
(using 
BiasRamp_linenum_Vec 
Vector giving the line numbers from the CTL file that contain the information about the bias ramp. 
CTL_linenum_Type 
Character vector (same length as

systemcmd 
Should R call SS using "system" function intead of "shell". This may be required when running R in Emacs on Windows. Default = FALSE. 
James Thorson
Thorson, J.T., Hicks, A.C., and Methot, R.D. 2014. Random effect estimation of timevarying factors in Stock Synthesis. ICES J. Mar. Sci.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  ## Not run:
direc < "C:/Models/LaplaceApprox/base" #need the full path because wd is changed in function
if("Optimization_record.txt" %in% list.files(direc)) {
file.remove(file.path(direc,"Optimization_record.txt"))
}
Opt = optimize(f=NegLogInt_Fn,
interval=c(0.001, 0.12),
maximum=FALSE,
File=direc,
CTL_linenum_List=list(127:131),
ESTPAR_num_List=list(86:205),
Int_Group_List=1,
PAR_num_Vec=NA,
Version=1, Intern=TRUE)
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.