# NOT RUN {
# }
# NOT RUN {
#### Change starter file appropriately (can also edit file directly)
starter <- SS_readstarter(file.path(mydir, 'starter.ss'))
# Change to use .par file
starter$init_values_src = 1
# Change jitter (0.1 is an arbitrary, but common choice for jitter amount)
starter$jitter_fraction = 0.1
# write modified starter file
SS_writestarter(starter, dir=mydir, overwrite=TRUE)
#### Run jitter using this function
jit.likes <- SS_RunJitter(mydir=mydir, Njitter=25)
#### Read in results using other r4ss functions
# (note that un-jittered model can be read using keyvec=0:Njitter)
profilemodels <- SSgetoutput(dirvec=mydir, keyvec=1:Njitter, getcovar=FALSE)
# summarize output
profilesummary <- SSsummarize(profilemodels)
# Likelihoods
profilesummary$likelihoods[1,]
# Parameters
profilesummary$pars
# }
Run the code above in your browser using DataLab