showModel {demest} | R Documentation

## Show final model specification.

### Description

Show the complete specification model used by functions `estimateModel`, `estimateCounts`, and `estimateAccount`, or by their prediction counterparts such as `predictModel`.

### Usage

    showModel(filename)

### Arguments

`filename` | The name of the file where the output from the `estimate` function is kept.

### Details

When setting up models to be fitted by the estimation functions, users typically only specify some of the details of the priors for the main effects or interactions. The remaining details are filled in by the estimation functions, based on the input data. Function `showModel` can be used find out what choices the estimation functions made.

To see the partial specification constructed by function `Model`, print the model object (typically by typing the name of the object at the console.) See below for an example. show `fetch`.

The `trunc-half-t(df, s^2, max)` in the printed results refers to a truncated `half-t` distribution with `df` degrees of freedom, scale `s^2`, and maximum value `max`.

### Value

`showModel` is called for its side effect, which is to print a description of the model.

### See Also

Parameter estimate can be extracted using function `fetch`.

### Examples

    births <- demdata::nz.births.reg
    popn <- demdata::nz.popn.reg
    births <- Counts(births, dimscales = c(year = "Intervals"))
    popn <- Counts(popn, dimscales = c(year = "Intervals"))
    births <- subarray(births, year > 2005 & year < 2014)

    filename.est <- tempfile()
    filename.pred <- tempfile()

    model <- Model(y ~ Poisson(mean ~ age * region + year),
                   year ~ DLM(trend = NULL))

    ## model specification before estimateModel called
    model

    estimateModel(model = model,
                  y = births,
                  exposure = popn,
                  filename = filename.est,
                  nBurnin = 5,
                  nSim = 5,
                  nChain = 2,
                  parallel = FALSE)

    ## model specification after estimateModel called
    showModel(filename.est)

    predictModel(filenameEst = filename.est,
                 filenamePred = filename.pred,
                 n = 5)

    ## specification used by predictModel
    showModel(filename.pred)

[Package demest version 0.0.0.3.1 Index]