R/utils.R

setMethod("ESS",signature(object="ParticleBase"),
	function(object,...) {
		#w <- exp(object@logWeights)
		sumw <- sum(exp(object@logWeights))
		sumsq <- sum(exp(2*object@logWeights))
		exp(-log(sumsq) + 2*log(sumw))
	}
)

Try the SMCS4 package in your browser

Any scripts or data that you put into this service are public.

SMCS4 documentation built on May 2, 2019, 6:40 p.m.