as.data.frame {pomp}R Documentation

Coerce to data frame

Description

All pomp model objects can be recast as data frames. The contents of the resulting data frame depend on the nature of the object.

Usage

## S3 method for class 'pomp'
as.data.frame(x, ...)

## S3 method for class 'pfilterd_pomp'
as.data.frame(x, ...)

## S3 method for class 'probed_pomp'
as.data.frame(x, ...)

## S3 method for class 'kalmand_pomp'
as.data.frame(x, ...)

## S3 method for class 'bsmcd_pomp'
as.data.frame(x, ...)

## S3 method for class 'pompList'
as.data.frame(x, ...)

## S3 method for class 'pfilterList'
as.data.frame(x, ...)

## S3 method for class 'abcList'
as.data.frame(x, ...)

## S3 method for class 'mif2List'
as.data.frame(x, ...)

## S3 method for class 'pmcmcList'
as.data.frame(x, ...)

## S4 method for signature 'pomp'
melt(data, ..., na.rm = FALSE, value.name = "value")

Arguments

x

any R object.

...

additional arguments to be passed to or from methods.

data

Data set to melt

na.rm

Should NA values be removed from the data set? This will convert explicit missings to implicit missings.

value.name

name of variable used to store values

Details

When object is a simple ‘pomp’ object, as(object,"data.frame") or as.data.frame(object) results in a data frame with the times, observables, states (if known), and interpolated covariates (if any).

When object is a ‘pfilterd_pomp’ object, coercion to a data frame results in a data frame with the same content as for a simple ‘pomp’, but with conditional log likelihood and effective sample size estimates included.

When object is a ‘probed_pomp’ object, coercion to a data frame results in a data frame with the values of the probes computed on the data and on simulations.

When object is a ‘kalmand_pomp’ object, coercion to a data frame results in a data frame with prediction means, filter means and forecasts, in addition to the data.

When object is a ‘bsmcd_pomp’ object, coercion to a data frame results in a data frame with samples from the prior and posterior distribution. The .id variable distinguishes them.

A ‘pomp’ object can be melted into a data frame.


[Package pomp version 2.3 Index]