Repository navigation
Conversation
…or, and plots Designs (slice_design, profile_design, runif_design, sobol_design), pfilter_loglik, slice, profile, mcap (as R pomp::mcap, direct loess surface), monitor, hyperbolic_cooling, resampled, and an AlgebraOfGraphics extension (sliceplot, mcapplot, traceplot, filterplot), with tests against exact likelihoods and R.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## devel #25 +/- ##
===========================================
- Coverage 100.00% 99.04% -0.96%
===========================================
Files 28 33 +5
Lines 871 1251 +380
===========================================
+ Hits 871 1239 +368
- Misses 0 12 +12 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it adds
src/design.jl):slice_design,profile_design,runif_design,sobol_design, as in Rpomp.profile_designrecordswhich parameters are profiled, so that
profilecan refuse aperturbation of them.
pfilter_loglik):nrepsindependent particle filters, combined by
logmeanexp, with thejack-knife standard error and the effective sample size of the
replicates. A replicate whose estimate is zero (log likelihood −∞) is
kept, since dropping it biases the average upward.
slice): the log likelihood along each row of a design,with the model and resampling settings (
trigger,target) of theobject passed, including a
pfilterormifresult.profile): for each design row,mifwith the profiledparameters held fixed, then an evaluation by
pfilter_loglikatexactly the reported point, with the model and resampling settings
that
mifused.pomp::mcap. The local quadratic smoother is R'sloesswithsurface = "direct", fitted in standardized units so that the resultdoes not depend on the units of the parameter. When fewer than three
distinct parameter values carry weight, the quadratic is not
determined by the data: its coefficients, standard errors and interval
are NaN (R's NA), with a warning, and a smoothing window that cannot
determine its local quadratic is refused rather than resolved by a
pseudoinverse.
mif(monitor): the log likelihood of theunperturbed model at the point estimates recorded in the traces,
across one run or a sequence of continuations, using its own random
numbers so the fit is unchanged. Also
hyperbolic_coolingandresampled.sliceplot,mcapplot,traceplot,filterplot), as apackage extension loaded only with AlgebraOfGraphics.
New dependencies:
SobolandLinearAlgebra; AlgebraOfGraphics as aweak dependency.
How it was checked
likelihood is exact by the Kalman filter, the particle-filter
estimates, the slices and the profile are compared with the exact
values. Further tests use models whose likelihood is known in closed
form, so that each estimate reveals the parameters it was computed
at.
loessandmcapagree with R (pomp::mcapon thedirect surface) to about 1e-10. Over 600 profile layouts with
irregular spacing and unequal numbers of starts, the cases Julia
refuses or marks NaN are exactly those where R stops, falls back on its
pseudoinverse, or returns NA.
versions of the code, e.g. a slice evaluated on the bare model, a
profile evaluated at the swarm average, or
mcapwithout centring.Every such version that changes a result is caught.
Notes
profilewith the defaultavfun = geomeanfails for a parameterthat takes negative values, or that the model needs as an integer. The
docstring says to pass
avfun = mean.test/mif.jlalso carries thegeometric_coolingvalue test that Isent separately.