mebrooks / selfisher Goto Github PK
View Code? Open in Web Editor NEWselfisher - modeling the SELectivity of FISHERies gear in R
selfisher - modeling the SELectivity of FISHERies gear in R
I've tried to copy the Travis setup and Makefile from glmmTMB, but the checks keep failing. It appears that there's some problem with the vignettes. The checks started failing as soon as I added vignettes.
Make it possible to set a simple model's starting values based on guesses for L50 and SR. This is based on discussions with Juan Santos about convergence issues and starting values.
Make it possible to omit SR and use a default as a proportion of L50. What proportion should be used?
Later make it work for more complex models, i.e. with covariates other than length. In those cases with complex models have convergence problems, it might be best to first fit a simple model and use those coefficients as starting values.
Accounting for sampling fractions with paired gear data (models with psplit=TRUE
) might require some machinery other than offsets. I need to work out the math to check, but simulations indicate that offsets won't work.
At the same time, it might be possible to do something about #19 and make it possible to account for sampling fractions in models in models with non-logit links.
See changes in glmmTMB.
Basically, there is a bug if you try to predict from a model that used a spline with newdata that is extrapolated beyond the original data. I'm working on fixing it and should be done in a few days. Some details are in the related glmmTMB
issue.
Make it work with parallel="snow"
. Try copying new version of bootmer.
Do the same as in glmmTMB/glmmTMB@8784b32
Add a discard ratio function that calculates the discard ratio (# discarded / #caught) for both gear types in catch-comparison analyses.
Also add functions to calculate indicators nP- and nP+
Input should be any length cutoff.
Consider if we need to change interceptinit <- function(link)
for the Richards case.
This assumes that larger hauls should have more influence on the fit, even if all fish weren't observed. This may be based on an assumption that selectivity changes systematically with total catch; thus it may be possible to achieve similar results by including total catch in a fixed effect.
Write a general function that takes any model, makes predictions from that model, and finds values of L (or whatever covariates are in the mode) which correspond to 50% retention probability. Predictions could be made on all unique combinations of covariates (including L) found in the original dataset to avoid extrapolating beyond the observed range.
Currently, link="richards"
is all lower case, but since it's a name, allow for the capitalized version. Before changing, check if R just accepts both versions without complaining.
Eventually it would be nice to add the beta-binomial distribution to handle overdispersion. For now, the only way to handle it is with an observation level random effect.
Use the robust method dbetabinom_robust
recently written for glmmTMB by kaskr.
See section 4.1 of Tom Mitchell Elliott's master thesis for an attempted implementation of this in a Bayesian context (it had convergence difficulties). Or see Kitakado et al (2002) for a publication suggesting that we might need this.
Copy changes from glmmTMB/glmmTMB@94d2c52
Add tests.
Add example to help file of bootSel
. Also, mention the vignette.
In your TMB code, you have the following code (lines 524-527 in selfisher.cpp) for logit(phi):
} else { //covered codend or catch comparison
for (int i = 0; i < r.size(); i++) {
logit_phi(i) = log(q(i)) + logit_inverse_linkfun(etar(i), etad(i), link); //log(q) + logit(r)
}
which I think is wrong--I think the term involving etar(i)... should evaluate to log(r), not logit(r) [see detail provided below]. Thus, the term should be "log(inverse_linkfun(etar(i), etad(i), link))", or just "log(r(i))" since you already computed r(i)=inverse_linkfun(etar(i), etad(i), link) back on line 514. However, it's also possible I'm completely off track!
Results from a similar comparison between AFSC and BSFRF side-by-side catches for snow crab by Somerton et al (2013: CJFAS 70:1699-1708) were based on fitting the equation
logit(phi) = log(r(z)) + log(q) [not logit(r(z)) + log(q)]
which was developed from
phi = (S_apr(z))/[S_apr(z)+S_b*(1-p)]
where z is size, r(z) is the fraction of individuals entering the AFSC gear that were retained, S_a is the sampling fraction for the AFSC gear, S_b is the sampling fraction for the BSFRF gear, and p is the assumed fractional split for the AFSC gear of the total number of crab entering the combined gear. p for each haul was assumed to be the fraction of the total area swept by the AFSC gear (i.e., p=A_a/[A_a+A_b] with A_a = area swept by AFSC gear, A_b=area swept by BSFRF gear). Setting q=A_bS_b/(A_aS_a) in the equation for phi and taking the logit of both sides gets you to the first equation.
Buck Stockhausen ([email protected])
Millar 1994 and Holst & Revil 2009 only apply to models with logit-links.
See changes to glmmTMB that facilitated MuMIN compatibility.
Also document when and how each should be used. Make examples.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.