Tag Archives: code tricks

Thursday: writing; some latexdiff notes

For­age fish writ­ing See doc, FF drop­box Pop­Dyn Warn­ing sig­nals edits Alan edits Fig­ure cap­tions, titles. Text changes from Noam. A bet­ter git latexd­iff solu­tion Plac­ing the script below some­where in the path like , and mod­ify as indi­cated in the header com­ments. Then oen can view pdf-diffs of the latex of the cur­rent ver­sion against pre­vi­ous

Monday

PDG Con­trol, aside exer­cise Lab group com­mented that opti­mum in Reed model looks unre­al­is­tic due to fre­quency with which it shuts down all fish­ing. This is an arti­fact of not hav­ing extrac­tion costs increase suf­fi­ciently for small catch, and can be eas­ily fixed by increas­ing that cost (c in the profit eq, profits-costs = p*x-c/x)

Monday — Sweave workflow

Mendeley’s repeated entries in the bib­file is par­tic­u­larly annoy­ing with my sweave work­flow, as it throws an error from bib­tex com­mand that Make doesn’t want to ignore.

Also, in writ­ing the doc­u­men­ta­tion I’d like to point the .Rnw file to my global library’s bib­tex doc­u­ment, but then this means hav­ing the .Rnw/tex file gen­er­ated to by the pack­age point­ing to a file that’s out­side the package.

To get around both of these issues, I’ve started using bibtool. …

Better dynamic documents (Sweave) with syntax highlighting, caching, etc

The high­light pack­age is a sim­ple solu­tion for very nice syn­tax high­lighted code boxes in latex doc­u­ments.  Requires switch­ing the dri­ver, which is best done from within R and requires cre­at­ing a make­file though.  Needs the “high­light” pack­age installed.  Here’s a sim­ple make­file. A wealth/mess of Sweave related pack­ages on the CRAN taskview for Repro­ducible

Friday, wordpress backups, pmc edits

Word­Press local copy con­fig­ured mysql­dump backup, fol­low­ing dreamhost wiki (added cron job man­u­ally instead of in panel). edit local wp-config.php to use local­host. Get the data­base name, user name and pass­word from the lines above it, which are used later. cre­ate user: log in as root and cre­ate user yes you need the quotes around the pass­word and the .* appended

Saturday: git with latexdiff, TreeBASE and PMC package updates, bounds on lambda

bounds on lambda: Updated the pmc wrap­pers for fit_continuous to pass bounds on lambda to the boot­strap­ping Monte Carlo func­tions.  Set­tled on pass­ing all options explic­itly after quite a bit of effort. Look­ing for way to pass a func­tion all of it’s argu­ments as a named argu­ments in a list; statsci­comp list sug­gested do.call() func­tion;

Tuesday: PMC, confidence intervals; screen code tricks

PMC Final read through of man­u­script from me and Peter. Look­ing at con­fi­dence inter­vals in fit­Con­tin­u­ous?  Pack­age used to use the hes­s­ian from optim, but it was later removed due to errors.  I added this back man­u­ally and attempt a few esti­mates.  Given the Hes­s­ian (like­li­hood sur­face cur­va­ture) this is approx­i­mated by sqrt(diag(solve(out$hessian))) See conf_interval_ex.R.  i.e for

Thursday Meetings: Duncan; Alan

Dun­can Meet­ing ROAuth/RCurl ques­tion.  Mende­ley is OAuth 1, github is OAuth 2 (sim­pler).  Both are imple­mented in pure R in another pack­age, may be good.  OAuth 1 con­structs com­pli­cated http urls with secret, and token, and ran­dom key, need to escape chars, etc.  OAuth 2 is https, just uses token. Authen­ti­ca­tion options: Jeff’s ROAuth/Duncan’s mod, other

Tuesday

Warn­ing sig­nals pack­age Review­ing Numer­i­cal chal­lenges for faster analy­sis on warn­ingsig­nals cre­ated a quick mcm­c­Tools pack­age so dif­fer­ent pack­ages can use my cus­tom rou­tines.  Will have to explore some of the stan­dard pack­ages even­tu­ally, though most seem some­what spe­cial­ized (the Bayesian task-view is epic).  bayesm looks promis­ing, and Learn­Bayes pack­age that accom­pa­nies Jim Albert’s book

Reading Notes, presentation prep, treebase error handling

Read­ing Oikos jour­nal recently started a rather nice blog. A jour­nal long respon­si­ble for some of the best exam­ples of devel­op­ing and con­fronting eco­log­i­cal the­ory with empir­i­cal results, with an com­mend­able empha­sis on gen­eral prin­ci­ples and syn­the­sis, it’s nice to see them enter the Web2.0 ecosys­tem. Edi­tor Jeremy Fox has a nice intro­duc­tion to the