popAddTrend: Add Trend to Polls

Description Usage Arguments Details Value Examples

Description

Add Trend to Polls

Usage

1
2
popAddTrend(data, name = NULL, type = "kalman", args = list(),
  interpolations = list())

Arguments

data

polls object

name

trend name

type

trend function name

args

trend function arguments

interpolations

list of interpolations that should be applied to the trend

Details

Available trend function names are:

kalman - arguments: sd = 0.03

weightedMeanLastDays - arguments: days = 30, maxObs = Inf

Available interpolations are:

lastInterpolation - no arguments.

linearInterpolation - no arguments.

bernoulliConvInterpolation - arguments: n = 20, k = 6

Value

polls object

Examples

1
2
3
4
5
t = popRead('DE-parliament')
t = popAddTrend(t, name='Kalman 0.003', type='kalman', args=list(sd = 0.003))
t = popAddTrend(t, name='Kalman Raw', type='kalman', args=list(sd = 0.003),
                interpolations=list('lastInterpolation' = list()))
plot(t)

petres/pollofpolls documentation built on May 15, 2019, 3:20 p.m.