n8thangreen / BCEA

Bayesian Cost Effectiveness Analysis. Given the results of a Bayesian model (possibly based on MCMC) in the form of simulations from the posterior distributions of suitable variables of costs and clinical benefits for two or more interventions, produces a health economic evaluation. Compares one of the interventions (the "reference") to the others ("comparators"). Produces many summary and plots to analyse the results
https://n8thangreen.github.io/BCEA/
GNU General Public License v3.0
3 stars 2 forks source link

refactor `createInput()` #41

Open n8thangreen opened 3 years ago

n8thangreen commented 3 years ago
giabaio commented 3 years ago
n8thangreen commented 3 years ago

Thanks, We could keep the argument but if its not supplied then it does createInputs internally. I don't think the user really needs to see this happening.

annaheath commented 3 years ago

The reason you would want createInputs() separately is because you will often want to calculate EVPPI for different parameter sets but they would come from the same matrix from the createInputs() function. As createInputs() is relatively slow, I don't think you want to use it every time you run the evppi() function. For the parameters, you probably can delete and just return an inputs matrix. I've no idea why the cbind is there - I have a vague memory of having difficulties with that line of code so potentially that might be the reason it is there but from the written code I think it can be deleted.

annaheath commented 3 years ago

I can see another problem with having createInputs() inside the evppi() function because the createInputs() function deletes redundant columns from matrix - if you chose numbered columns to calculate EVPPI then the numbers would change when you updated the matrix. You could also delete a column that the user was trying to compute EVPPI for.

n8thangreen commented 3 years ago

I see. Some ideas could be:

annaheath commented 3 years ago

What is the advantage of using evppi() and update() as opposed to createInputs() and evppi()? Can you associate columns with 2 names? I'm just thinking that you may also want to call the column by its parameter name as well?

giabaio commented 3 years ago

Hi both, Thanks for this --- that's very helpful. I think we do want to allow the possibility of selecting a vector of numbers of columns as well as named vectors of names... Sounds like probably we can make createInputs() a bit quicker, but probably keep it separated from evppi... G

On Mon, 26 Apr 2021 at 17:47, Anna Heath @.***> wrote:

What is the advantage of using evppi() and update() as opposed to createInputs() and evppi()? Can you associate columns with 2 names? I'm just thinking that you may also want to call the column by its parameter name as well?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/n8thangreen/BCEA/issues/41#issuecomment-826990108, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCRVSIVBSUZ5IXRHUNBTPDTKWKIDANCNFSM43OGQDLQ .

--

Gianluca Baio

Professor of Statistics & Health Economics Department of Statistical Science University College London 1-19 Torrington Place, London WC1E 6BT, UK Telephone +44(0)20 7679 1248 (internal: 41248) Twitter: @stats_UCL https://twitter.com/stats_UCL Website: http://www.homepages.ucl.ac.uk/~ucakgba http://www.homepages.ucl.ac.uk/~ucakgba/ Blog: http://www.statistica.it/gianluca/blog/

[image: https://twitter.com/gianlubaio] https://twitter.com/gianlubaio https://www.linkedin.com/in/gianluca-baio-b893879/ https://github.com/giabaio https://scholar.google.com/citations?user=ro0QvGsAAAAJ&hl=en https://www.researchgate.net/profile/Gianluca_Baio[image: https://www.linkedin.com/in/gianluca-baio-b893879/] https://www.linkedin.com/in/gianluca-baio-b893879/ This email may reach you outside of your working hours. If that's the case, please do not feel pressure to reply immediately.

n8thangreen commented 3 years ago

I'm thinking of it in a kind of encapsulation way. We don't want to expose the workings of the algorithm if we don't have to. The user interface is just 'do an evppi' which could include 'update my evppi'. So you're working on the same type of object. I think asking them to first create inputs should really been handled privately because they don't need to know about the intermediate step. I know it sounds pedantic but I think it would be more intuitive.

giabaio commented 3 years ago

I don't know if I'm misunderstanding this but do you mean having a evppi command and an update.evppi command? Or is it about the philosophy of the function?

On Mon, 26 Apr 2021 at 19:25, Dr Nathan Green @.***> wrote:

I'm thinking of it in a kind of encapsulation way. We don't want to expose the workings of the algorithm if we don't have to. The user interface is just 'do an evppi' which could include 'update my evppi'. So you're working on the same type of object. I think asking them to first create inputs should really been handled privately because they don't need to know about the intermediate step. I know it sounds pedantic but I think it would be more intuitive.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/n8thangreen/BCEA/issues/41#issuecomment-827052559, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCRVSO4KOYFRHMHA46DQ3DTKWVZXANCNFSM43OGQDLQ .

--

Gianluca Baio

Professor of Statistics & Health Economics Department of Statistical Science University College London 1-19 Torrington Place, London WC1E 6BT, UK Telephone +44(0)20 7679 1248 (internal: 41248) Twitter: @stats_UCL https://twitter.com/stats_UCL Website: http://www.homepages.ucl.ac.uk/~ucakgba http://www.homepages.ucl.ac.uk/~ucakgba/ Blog: http://www.statistica.it/gianluca/blog/

[image: https://twitter.com/gianlubaio] https://twitter.com/gianlubaio https://www.linkedin.com/in/gianluca-baio-b893879/ https://github.com/giabaio https://scholar.google.com/citations?user=ro0QvGsAAAAJ&hl=en https://www.researchgate.net/profile/Gianluca_Baio[image: https://www.linkedin.com/in/gianluca-baio-b893879/] https://www.linkedin.com/in/gianluca-baio-b893879/ This email may reach you outside of your working hours. If that's the case, please do not feel pressure to reply immediately.

n8thangreen commented 3 years ago

You could also delete a column that the user was trying to compute EVPPI for.

Could we force createInput() to keep specified columns then? Or just return an error message "parameter not available..."?

n8thangreen commented 3 years ago

I don't know if I'm misunderstanding this but do you mean having a evppi command and an update.evppi command? Or is it about the philosophy of the function?

I think both.

giabaio commented 3 years ago

I think the way I was thinking about it in the first place is that you do createInput only once to remove the columns that are linearly dependent on others; then you are good to go for any combination of parameters for which you want to compute the evppi (and that's only one type of object there, I think --- you have

inp = createInputs(MCMC_object) evppi(...)

and you can specify any vector of parameters.

Maybe there are more clever ways to check linear dependence in the matrix of simulations?

On Mon, 26 Apr 2021 at 21:17, Dr Nathan Green @.***> wrote:

I don't know if I'm misunderstanding this but do you mean having a evppi command and an update.evppi command? Or is it about the philosophy of the function?

I think both.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/n8thangreen/BCEA/issues/41#issuecomment-827120039, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCRVSJAKAKYSUD6L6PRIMDTKXC7BANCNFSM43OGQDLQ .

--

Gianluca Baio

Professor of Statistics & Health Economics Department of Statistical Science University College London 1-19 Torrington Place, London WC1E 6BT, UK Telephone +44(0)20 7679 1248 (internal: 41248) Twitter: @stats_UCL https://twitter.com/stats_UCL Website: http://www.homepages.ucl.ac.uk/~ucakgba http://www.homepages.ucl.ac.uk/~ucakgba/ Blog: http://www.statistica.it/gianluca/blog/

[image: https://twitter.com/gianlubaio] https://twitter.com/gianlubaio https://www.linkedin.com/in/gianluca-baio-b893879/ https://github.com/giabaio https://scholar.google.com/citations?user=ro0QvGsAAAAJ&hl=en https://www.researchgate.net/profile/Gianluca_Baio[image: https://www.linkedin.com/in/gianluca-baio-b893879/] https://www.linkedin.com/in/gianluca-baio-b893879/ This email may reach you outside of your working hours. If that's the case, please do not feel pressure to reply immediately.

n8thangreen commented 3 years ago

the first call to evppi() can return something that kind of inherits from bcea and captures the original call so when you call it again, e.g. with update.evppi(), it doesnt have to rerun createInputs() again internally.

giabaio commented 3 years ago

That may do...

On Tue, 27 Apr 2021 at 08:56, Dr Nathan Green @.***> wrote:

the first call to evppi() can return something that kind of inherits from bcea and captures the original call so when you call it again, e.g. with update.evppi(), it doesnt have to rerun createInputs() again internally.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/n8thangreen/BCEA/issues/41#issuecomment-827399553, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCRVSOBUSOXORQJVF3YYWTTKZU3DANCNFSM43OGQDLQ .

--

Gianluca Baio

Professor of Statistics & Health Economics Department of Statistical Science University College London 1-19 Torrington Place, London WC1E 6BT, UK Telephone +44(0)20 7679 1248 (internal: 41248) Twitter: @stats_UCL https://twitter.com/stats_UCL Website: http://www.homepages.ucl.ac.uk/~ucakgba http://www.homepages.ucl.ac.uk/~ucakgba/ Blog: http://www.statistica.it/gianluca/blog/

[image: https://twitter.com/gianlubaio] https://twitter.com/gianlubaio https://www.linkedin.com/in/gianluca-baio-b893879/ https://github.com/giabaio https://scholar.google.com/citations?user=ro0QvGsAAAAJ&hl=en https://www.researchgate.net/profile/Gianluca_Baio[image: https://www.linkedin.com/in/gianluca-baio-b893879/] https://www.linkedin.com/in/gianluca-baio-b893879/ This email may reach you outside of your working hours. If that's the case, please do not feel pressure to reply immediately.

n8thangreen commented 3 years ago

if we change then: