initial_prediction_aggr_source_type: initial aggregated source type prediction

Description Usage Arguments Value

Description

internal function which initializes a prediction function of method 'aggr_source_type'. This functions selects one source type and aggregates the different sources daily per party.

Usage

1
2
initial_prediction_aggr_source_type(pv, which_source_type, agg_fun = "mean",
  na_handle = "last", ...)

Arguments

pv

[pollyvote]
the pollyvote object of which to get the prediction from.

which_source_type

[character(1)]
the name of the source to use for aggregation

agg_fun

[character(1)]
the name of the aggregation function to use, currently 'mean' and 'median' are supported

na_handle

[character(1)]
character describing which method is used to fill missing values. Currently supported is

  • 'last': Use the last available value. Fill all days between the earliest and latest day in the data.

  • 'omit': For every day, agregate available data.

  • 'mean_within' Use the available data of this subcomponent to fill missing values.

  • 'mean_across' Create a mini-pollyvote prediction by aggregating all source_types using na_handle = 'last' and then aggregating the result using na_handle = 'last', which will then be used to predict missing values in the lowest aggregation level.

...

[list()]
additional arguments, currently ignored.

Value

data frame containing the results


pollyvote/pollyvoter documentation built on May 25, 2019, 11:23 a.m.