munit_measure: munit_measure

munit_measureR Documentation

munit_measure

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

## 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.

Author(s)

Kidus Asfaw

Examples

# Complete examples are provided in the package tests
## Not run: 
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)

## End(Not run)


kidusasfaw/spatPomp documentation built on April 27, 2024, 2:20 p.m.