Open ArtPoon opened 3 years ago
I'm modifying the prior functions to be Object classes with prototype Prior
That way if hyperparameters are modified, a Prior
object is aware of it and will modify its return value for str()
accordingly.
I'm going to modify the Priors table to use d3 so that these objects are bound to the table rows.
This will help with modifying the object in response to user input.
We can also add an active
property to filter priors that are not used by the user's current model settings.
Ok finished modifying the table. Last thing is to implement the modal dialog. I've bound an event listener to clicking on rows, which retrieves sufficient data to retrieve the prior object class instance:
// on click
Object
Bound: "n/a"
Description: "substitution rate"
Parameter: "clock.rate" // <---- use this
Prior: "Fixed value, value=1"
> row = priors.filter(x => x.parameter==="clock.rate")[0];
> row.obj
FixedValuePrior {idref: "clock.rate", initial: 1, bound: Array(1), str: ƒ}
Change Prior Popup similar to the parse date popup. Wasn't 100% sure how to update the prior hyper-params object, so just need to fill out changePriors() at line 296 with update commands
Thanks @ewong347 - We still need to be able to modify the hyperparameters and initial value
For example, we can modify this for a LogNormalPrior
object as follows:
row = priors.filter(x => x.parameter==="kappa")[0];
row.obj.mu = 2.0;
Clicking on row of priors table should bring up modal window where user can view and modify hyperparameters, e.g., mean and standard deviation of normal distribution. Let's not worry about visualizing the distribution for now.