admb-project / admb

AD Model Builder
http://admb-project.org
Other
64 stars 19 forks source link

Revert to original simple.tpl? #99

Closed arni-magnusson closed 6 years ago

arni-magnusson commented 6 years ago

It looks like simple.tpl was modified to use as a testbed for new algorithms developed by @colemonnahan

The changes have made simple.tpl a bit less simple than it used to be. The simple.tpl is intended as a hello world for ADMB, using only the most basic types, etc.

Can we revert simple.tpl back to the original?

johnoel commented 6 years ago

Thank Arni for noticing that.

colemonnahan commented 6 years ago

Sorry yes we should revert it. I suggest using dnorm function if this is the first example a new ADMB user is supposed to look at. That likelihood calculation is pretty opaque for someone coming from R.

arni-magnusson commented 6 years ago

That's a good point, Cole, the likelihood calculation in simple.tpl is rather complicated for a hello world example. I've replaced it with f=regression(y,yhat); Turns out that's how the example was covered in the manual all along :) I used the opportunity to make other things in the example more intuitive, x and y, b0 and b1. The dnorm function is not (yet) documented in the manual. It might also seem a bit perplexing to someone coming from R, since dnorm(x,mu,sd) gives very different results in R and ADMB. The manual covers the regression() function quite well.