calc_adaptive_expectation: Compute autoregressive model for expectation

Description Usage Arguments Details

View source: R/adaptive_expectation.R

Description

This function computes expectation (generally for price or yield) as an autoregressive function of the price time series.

y_i = α y_{i-1} + (1-α) x_i

Usage

1
calc_adaptive_expectation(t, alpha, datatbl, colname)

Arguments

t

The current year, for which we wish to calculate the expected price.

alpha

Coefficient of previous year term in the autoregressive series.

datatbl

Table of price vs. year. This series is assumed not to have any gaps in it and to be in year order, but neither of these conditions are checked.

colname

Name of the column that has the data for which we are computing the expectation (e.g. 'price')

Details

There is some dispute over what the final term in this series should be. In this implementation the final term is just like all the others; therefore, for α = 0 this formula reduces to y_i = x_i, the equivalent of perfect expectation.

This function is not currently vectorized; a separate call is needed for each value of t.


JGCRI/gcamland documentation built on Oct. 6, 2020, 5:30 p.m.