pints
pints copied to clipboard
Updated first examples to show model-free case.
After discussion today, seems like we should start the first examples by showing you need an error/logpdf, then move on to show how PINTS lets you define one for time series
@ben18785 @chonlei @martinjrobins do you think this makes sense? It was a little unclear that you could use PINTS for any old function
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
13b263a) to head (9ffbe94).
Additional details and impacted files
@@ Coverage Diff @@
## main #1520 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 97 97
Lines 9577 9577
=========================================
Hits 9577 9577
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
(I did actually think you couldn't use PINTS for 1D optimisation though - I'm pretty sure I encountered an error when I tried to use it for a 1D problem a while ago, and I thought someone else had told me that they'd also experienced this.)
I'm guessing you did what I did initially, and used a scalar parameter instead of a length-1 vector?
(I did actually think you couldn't use PINTS for 1D optimisation though - I'm pretty sure I encountered an error when I tried to use it for a 1D problem a while ago, and I thought someone else had told me that they'd also experienced this.)
I'm guessing you did what I did initially, and used a scalar parameter instead of a length-1 vector?
I can't fully remember, but from looking back at my code I think you're probably correct. I do remember seeing an error raised by PINTS which said that it didn't support the 1D case. I think maybe @I-Bouros experienced something similar.
(I did actually think you couldn't use PINTS for 1D optimisation though - I'm pretty sure I encountered an error when I tried to use it for a 1D problem a while ago, and I thought someone else had told me that they'd also experienced this.)
I'm guessing you did what I did initially, and used a scalar parameter instead of a length-1 vector?
I can't fully remember, but from looking back at my code I think you're probably correct. I do remember seeing an error raised by PINTS which said that it didn't support the 1D case. I think maybe @I-Bouros experienced something similar.
That's true from my experience PINTS does not work with optimising or sampling single parameters.
OK Can you dig out a specific example? The notebooks in this PR show both a 1d optimisation and a 1d sampling problem, so it's definitely not impossible in general :D
OK Can you dig out a specific example? The notebooks in this PR show both a 1d optimisation and a 1d sampling problem, so it's definitely not impossible in general :D
I can describe the phenomenon, as it appears in my own work: I am working with an SEIR model for which I am trying to infer one parameter beta. I use my usual approach in which I write up a pints.LogPDF, pints.LogPrior and a pints.LogPosterior objects, and then when I try to run it (with 3 chains, so is not that issue), I get this error message:
Oh, that's interesting! Seems to be coming directly from CMA-ES. We should add a notice to the CMA-ES optimiser to say it doesn't support 1-d optimisations. Alternatively could try and catch this error and replace it with a more informative one