library(stockassessment)
setwd("run")
load("data.RData")
conf<-loadConf(dat,"../conf/model.cfg", patch=TRUE)
par<-defpar(dat,conf)
par$logSdLogN<-c(0,-5)
mymap<-list(logSdLogN=factor(c(1,NA)))
fit<-sam.fit(dat,conf,par, map=mymap)
if(fit$opt$convergence!=0) stop("Model did not converge.")
save(fit, file="model.RData")
