Trend: Trend

View source: R/Trend.R

TrendR Documentation

Trend

Description

Compute variable x with trend t for year y

Usage

Trend(t, y, x, z)

Arguments

t

trend rate

y

time increment

x

first value

z

type of trend 0 or 1

Details

NJS: created 7/9/02. Original VB code: Function Trend(t As Double, y, x As Double, z) As Double t is trend rate, y is time increment, x is first value, z is type of trend

If z = 0 Then Trend = x * (1 + t) ^ y ElseIf z = 1 Then Trend = x + (y * t) Else If Trend < 0 Then Trend = 0

Print "Unknown trend/cycle function" Stop End If

End Function

Value

trend variable (scalar or vector) EEH: changed to work with vectors of y


eeholmes/VRAP documentation built on Nov. 23, 2024, 2:35 a.m.