User:Carl Boettiger/Notebook/Stochastic Population Dynamics/2010/08/16

From OpenWetWare
Jump to: navigation, search
Owwnotebook icon.png Stochastic Population Dynamics <html><img src="/images/9/94/Report.png" border="0" /></html> Main project page
<html><img src="/images/c/c3/Resultset_previous.png" border="0" /></html>Previous entry<html>      </html>Next entry<html><img src="/images/5/5c/Resultset_next.png" border="0" /></html>

Warning Signals

  • bootstrapping models implemented
  • improved handling of model classes -- included T, t0, N, and X0 in object def
  • implemented plotting for model bootstrap
  • difficulties with changePt model fit remain. fixed one source of trouble -- no longer passes zero-length data to OU.lik() when t_shift is outside the time interval.
    • Still giving errors on coercing lists into doubles for the saddle_node bifurcation simulated data set. --fixed, was getting t_shift as a vector from time(X).

Code Tricks

Duncan pts out: the S3 mechanism is

 custom =
 function(x, y, ...)
 UseMethod("custom")

Then that will find and use custom.foo, etc. based on the class of the value of x. You can have it dispatch on a different parameter, but that is not very common. And to dispatch on the types/classes of multiple parameters, e.g. x is a numeric vector, y is a matrix, you would need to use S4.

See the setGeneric() function in R for S4 method (also compatible with S3 classes).