munit_measure: munit_measure

Description Usage Arguments Value Examples

Description

munit_measure returns a moment-matched parameter set given an empirically calculated measurement variance and latent states. This is used in girf() and igirf() when they are run with kind='moment'.

Usage

1
2
## S4 method for signature 'spatPomp'
munit_measure(object, x, vc, unit, time, params, Np = 1)

Arguments

object

An object of class spatPomp

x

A state vector for all units

vc

The empirically calculated variance used to perform moment-matching

unit

The unit for which to obtain a moment-matched parameter set

time

The time for which to obtain a moment-matched parameter set

params

parameters to use to obtain a moment-matched parameter set

Np

Number of particle replicates for which to get parameter sets

Value

An array with dimensions dim(array.params)[1] by dim(x)[2] by length(unit) bylength(time) representing the moment-matched parameter set(s) corresponding to the variance of the measurements, vc, and the states, x.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
b <- bm(U=3)
s <- states(b)[,1,drop=FALSE]
rownames(s) -> rn
dim(s) <- c(3,1,1)
dimnames(s) <- list(variable=rn, rep=NULL)
p <- coef(b); names(p) -> rnp
dim(p) <- c(length(p),1); dimnames(p) <- list(param=rnp)
o <- obs(b)[,1,drop=FALSE]
array.params <- array(p,
                      dim = c(length(p),
                              length(unit_names(b)), 1, 1),
                      dimnames = list(params = rownames(p)))
vc <- c(4, 9, 16); dim(vc) <- c(length(vc), 1, 1)
munit_measure(b, x=s, vc=vc, Np=1, unit = 1, time=1, params=array.params)

spatPomp documentation built on Sept. 5, 2021, 5:35 p.m.