# density.mcmcSTmodel: Kernel Density Estimation for an 'mcmcSTmodel' Object In SpatioTemporal: Spatio-Temporal Model Estimation

## Description

`density` method for class `mcmcSTmodel`.

## Usage

 ```1 2``` ```## S3 method for class 'mcmcSTmodel' density(x, BurnIn = 0, estSTmodel = NULL, ...) ```

## Arguments

 `x` `mcmcSTmodel` object `BurnIn` Number of initial points to ignore. `estSTmodel` Either a `estimateSTmodel` object from `estimate.STmodel` or a matrix with parameter-estimates and standard deviations, such as the output from `coef.estimateSTmodel`. If given as a matrix, it should have columns named "par" and "sd", and rows named after the parameters. `...` Additional parameters passed to `density`.

## Details

Computes kernel density estimates for the MCMC-parameters; as well as approximate Gaussian densities based on the Fischer-information.

## Value

List containing density estimate and Gaussian densities for all model parameters.

## Author(s)

Johan Lindstrom

Other mcmcSTmodel methods: `MCMC.STmodel`, `plot.density.mcmcSTmodel`, `plot.mcmcSTmodel`, `print.mcmcSTmodel`, `print.summary.mcmcSTmodel`, `summary.mcmcSTmodel`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25``` ```##load estimation results data(est.mesa.model) ##and MCMC results instead data(MCMC.mesa.model) ##compute density estimates for the results, and use the Gaussian approximation ##based on Fischer information as reference. dens <- density(MCMC.mesa.model, estSTmodel=est.mesa.model) ##all the estimated densities str(dens,1) ##or results for one paramter dens[[1]] ##plot density functions plot(dens) ##for a different paramter, along with Gaussian approx plot(dens, 3, norm.col="red") ##all covariance parameters par(mfrow=c(3,3),mar=c(4,4,2.5,.5)) for(i in 9:17){ plot(dens, i, norm.col="red") } ```