<div><font color="#222222" face="arial, sans-serif">Non-linear models can have linear components where parameters in the non-linear base model are expressed as a linear function of covariates. This makes model.matrix useful to generalize the tpl file. The example I originally posted for distance sampling cannot be posed solely with model.matrix. I wasn't saying that. However, the parameters can be expressed as linear functions of the covariates which enables a base tpl file to work for a much broader set of models without modification and re-compilation. </font></div>
<div><font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif">Here is another example where passing design matrices can be useful. The tpl file will fit any Cormack-Jolly-Seber model to mark-recapture data to estimate survival. Both survival and capture probability are specified with a design matrix on the logit scale. It could be generalized with other link functions (eg. sin, probit)</font></div>
<font color="#222222" face="arial, sans-serif"><div><font color="#222222" face="arial, sans-serif"><br></font></div><a href="https://github.com/jlaake/R2admb/blob/master/Intro%20to%20R2admb/admbcjs.tpl">https://github.com/jlaake/R2admb/blob/master/Intro%20to%20R2admb/admbcjs.tpl</a></font><div>
<font color="#222222" face="arial, sans-serif"><a href="https://github.com/jlaake/R2admb/blob/master/Intro%20to%20R2admb/admbcjs.dat">https://github.com/jlaake/R2admb/blob/master/Intro%20to%20R2admb/admbcjs.dat</a></font></div>
<div><font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif">I'm incorporating this into an R package which creates the admbcjs.dat file from a dataframe and formulas in R. The above admbcjs.dat example is for the well-known dipper data with phi(.)p(t) (constant survival and time-varying capture prob).</font></div>
<div><font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif">ADMB is a great piece of software. It will become more widely used outside of fisheries if it is integrated with other platforms like R Ignoring that potential and making snide comments about R and R-users is not useful. </font></div>
<div><font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif">regards --jeff</font></div>