Description Usage Arguments Value Re-running pmif Iterations Continuing pmif Iterations Details Methods Author(s) References See Also Examples
The Particle MCMC algorithm for estimating the parameters of a partially-observed Markov process.
Running pmif
causes a particle random-walk Metropolis-Hastings Markov chain algorithm to run for the specified number of proposals.
1 2 3 4 5 6 7 8 9 10 | ## S4 method for signature 'pomp'
pmif(object, Nmif = 1, start, proposal, Np,
tol = 1e-17, max.fail = Inf, verbose = getOption("verbose"), ...)
## S4 method for signature 'pfilterd.pomp'
pmif(object, Nmif = 1, Np, tol, ...)
## S4 method for signature 'pmif'
pmif(object, Nmif, start, proposal, Np, tol,
max.fail = Inf, verbose = getOption("verbose"), ...)
## S4 method for signature 'pmif'
continue(object, Nmif = 1, ...)
|
object |
An object of class |
Nmif |
The number of pmif iterations to perform. |
start |
named numeric vector; the starting guess of the parameters. |
proposal |
optional function that draws from the proposal distribution. Currently, the proposal distribution must be symmetric for proper inference: it is the user's responsibility to ensure that it is. Several functions that construct appropriate proposal function are provided: see MCMC proposal functions for more information. |
Np |
a positive integer; the number of particles to use in each filtering operation. |
tol |
numeric scalar; particles with log likelihood below |
max.fail |
integer; maximum number of filtering failures permitted. If the number of failures exceeds this number, execution will terminate with an error. |
verbose |
logical; if TRUE, print progress reports. |
... |
additional arguments that override the defaults. |
An object of class pmif
.
To re-run a sequence of pmif iterations, one can use the pmif
method on a pmif
object.
By default, the same parameters used for the original pmif run are re-used (except for tol
, max.fail
, and verbose
, the defaults of which are shown above).
If one does specify additional arguments, these will override the defaults.
One can continue a series of pmif iterations from where one left off using the continue
method.
A call to pmif
to perform Nmif=m
iterations followed by a call to continue
to perform Nmif=n
iterations will produce precisely the same effect as a single call to pmif
to perform Nmif=m+n
iterations.
By default, all the algorithmic parameters are the same as used in the original call to pmif
.
Additional arguments will override the defaults.
pmif
implements an MCMC algorithm in which the true likelihood of the data is replaced by an unbiased estimate computed by a particle filter.
This gives an asymptotically correct Bayesian procedure for parameter estimation (Andrieu and Roberts, 2009).
Note that pmif
does not make use of any parameter transformations supplied by the user.
Concatenates pmif
objects into a pmifList
.
conv.rec(object, pars)
returns the columns of the convergence-record matrix corresponding to the names in pars
as an object of class mcmc
or mcmc.list
.
filter.traj(object, vars)
returns filter trajectories from a pmif
or pmifList
object.
Diagnostic plots.
Returns the value in the loglik
slot.
Returns the last state of the MCMC chain. As such, it's not very useful for inference.
covmat(object, start, thin, expand)
computes the empirical covariance matrix of the MCMC samples beginning with iteration start
and thinning by factor thin
.
It expands this by a factor expand^2/n
, where n
is the number of parameters estimated.
By default, expand=2.38
.
The intention is that the resulting matrix is a suitable input to the proposal function mvn.rw
.
Dao Nguyen dxnguyen at olemiss dot edu, Xin Dang xdang at olemiss dot edu, Duc Anh Doan ddoan at olemiss dot edu
C. Andrieu, A. Doucet and R. Holenstein, Particle Markov chain Monte Carlo methods, J. R. Stat. Soc. B, to appear, 2010.
C. Andrieu and G.O. Roberts, The pseudo-marginal approach for efficient computation, Ann. Stat. 37:697-725, 2009.
pomp
, pfilter
, MCMC proposal distributions,
and the tutorials on the package website.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## Not run:
library(pomp)
pompExample(ou2)
pmif(
pomp(ou2,dprior=Csnippet("
lik = dnorm(alpha_2,-0.5,1,1) + dnorm(alpha_3,0.3,1,1);
lik = (give_log) ? lik : exp(lik);"),
paramnames=c("alpha.2","alpha.3")),
Nmif=2000,Np=500,verbose=TRUE,
proposal=mvn.rw.adaptive(rw.sd=c(alpha.2=0.01,alpha.3=0.01),
scale.start=200,shape.start=100)) -> chain
continue(chain,Nmif=2000,proposal=mvn.rw(covmat(chain))) -> chain
plot(chain)
chain <- pmif(chain)
plot(chain)
library(coda)
trace <- window(conv.rec(chain,c("alpha.2","alpha.3")),start=2000)
rejectionRate(trace)
effectiveSize(trace)
autocorr.diag(trace)
summary(trace)
plot(trace)
heidel.diag(trace)
geweke.diag(trace)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.