spectrum0ar {BART} | R Documentation |

## Estimate spectral density at zero

### Description

The spectral density at frequency zero is estimated by fitting an
autoregressive model. `spectrum0(x)/length(x)`

estimates the
variance of `mean(x)`

.

### Usage

```
spectrum0ar(x)
```

### Arguments

`x` |
Matrix of MCMC chains: the rows are the samples and
the columns are different "parameters". For BART, generally, the
columns are estimates of |

### Details

The `ar()`

function to fit an autoregressive model to the time
series x. For multivariate time series, separate models are fitted for
each column. The value of the spectral density at zero is then given
by a well-known formula. Adapted from the `spectrum0.ar`

function of
the coda package which passes `mcmc`

objects as arguments
rather than matrices.

### Value

A list with the following values

`spec` |
The predicted value of the spectral density at frequency zero. |

`order` |
The order of the fitted model |

### References

Martyn Plummer, Nicky Best, Kate Cowles and Karen Vines (2006). CODA: Convergence Diagnosis and Output Analysis for MCMC, R News, vol 6, 7-11.

BW Silverman (1986). Density estimation for statistics and data analysis. Chapman and Hall, London.

### See Also

*BART*version 2.9.7 Index]