Learn R Programming

dbnR (version 0.7.1)

smooth_ts: Performs smoothing with the GDBN over a data set

Description

Given a dbn.fit object, the size of the net and a folded data.set, performs a smoothing of a trajectory. Smoothing is the opposite of forecasting: given a starting point, predict backwards in time to obtain the time series that generated that point.

Usage

smooth_ts(
  dt,
  fit,
  size,
  obj_vars,
  ini = dim(dt)[1],
  len = ini - 1,
  print_res = TRUE,
  plot_res = TRUE,
  prov_ev = NULL
)

Arguments

dt

data.table object with the TS data

fit

dbn.fit object

size

number of time slices of the net

obj_vars

variables to be predicted. Should be in the oldest time step

ini

starting point in the data set to smooth

len

length of the smoothing

print_res

if TRUE prints the mae and sd metrics of the smoothing

plot_res

if TRUE plots the results of the smoothing

prov_ev

variables to be provided as evidence in each smoothing step. Should be in the oldest time step

Value

the results of the smoothing