changepoint: Perform a changepoint analysis

Description Usage Arguments Value Examples

View source: R/changepoint.R

Description

Samples the changepoint model using Stan and returns the stanfit object as a result.

Usage

1
2
changepoint(x, chains = 2, iter = 1000, allpars = FALSE,
  cores = max(parallel::detectCores() - 1, 1), ...)

Arguments

x

the time series to perform the analysis on

chains

the number of chains to use which defaults to 2

iter

the number of samples to pull which defaults to 1000

allpars

decides if all parameters should be returned or not. FALSE which is the default only gives the mu's and the sigmas and the tau

cores

the number of cores to use which defaults to max(parallel::detectCores()-1, 1)

...

other arguments passed to the sampling method in rstan

Value

the stanfit from the sampled changepoint model

Examples

1
2
3
4
5
6
## Not run: 
library(bayesplot)
aa<-changepoint(c(rnorm(50, 100, 10), rnorm(50, 150, 10)))
mcmc_combo(as.array(aa), regex_pars = "tau")

## End(Not run)

DoktorMike/bayesian-model-zoo documentation built on May 23, 2019, 11:32 p.m.