fit_ewi: Fit Bayesian EWI model

Description Usage Arguments Examples

Description

Fit Bayesian EWI model

Usage

1
2
fit_ewi(data_frame, ewi_model = "ar", iter = 2000, chains = 4,
  control = list(adapt_delta = 0.9, max_treedepth = 20))

Arguments

data_frame

Data frame containing the time covariarte ('x') and response ('y') with no NAs

ewi_model

Which model to fit. Either the dynamic AR(1) model ('ar') or stochastic volatility model ('sv'). Defaults to 'ar'. For both cases, a gaussian process model is fit to the time-varying parameters.

iter

Number of iterations in Stan sampling.

chains

Number of chains in Stan sampling.

control

A list of options to pass to Stan sampling.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
library(bayesewi)
model_1 = fit_ewi(data_example, ewi_model="ar")
model_2 = fit_ewi(data_example, ewi_model="ar", iter = 1000, chains=2)

print(plot_estimates(model_2))
options(mc.cores = parallel::detectCores())
model_2 = fit_ewi(data_example, ewi_model="ar", iter = 100, chains=3)

## End(Not run)

fate-ewi/bayesewi documentation built on May 30, 2019, 3:03 p.m.