tjthurman / BAHZ

An R package for Bayesian analysis of hybrid zones
GNU General Public License v3.0
3 stars 1 forks source link

Something for plotting functions #41

Closed tjthurman closed 5 years ago

tjthurman commented 5 years ago

Maybe not direct plotting functions, which seems like a lot of work and very prescriptive. But, rather, functions that will ease plotting for others by taking in a range of x-values and the stanfit data and outputting a vector of x and y values to plot. Could even output a matrix of x values and posterior distribution values.

Can detect inc/dec from the p estimates

tjthurman commented 5 years ago

two modes:

1) plot from stanfit: take in range of x values. if 2, llmits. if > 2, sites. takes in stanfit, estimates inc/dec from Ps in stanfit. summarizes stanfit to get cline parameters, uses gen_cline_eqn to do plotting. Optional arg: include posterior. Return a matrix (or df?) where column 1 is the x values, column 2 is best fit ys, and any later columns are posterior ys.

2) plot from cline equation. take in x values, cline parameters, and increase/decrease. return matrix or df where column 1 is x values, column 2 is best fit ys.

tjthurman commented 5 years ago

From talking with Ananda: should include an actual plotting function