CalculateGoalIndex: Calculate Goal Index

View source: R/CalculateGoalIndex.R

CalculateGoalIndexR Documentation

Calculate Goal Index

Description

Goal-level computation function to goal score ("component indicators for public goals") based on status, trend, resilience, pressure

Usage

CalculateGoalIndex(
  id,
  status,
  trend,
  resilience,
  pressure,
  DISCOUNT = 1,
  BETA = 0.67,
  default_trend = 0,
  xlim = c(0, 1)
)

Arguments

id

is the subregion identifier

status

(x) score

trend

(t) score for 5 year outloook

resilience

(r) score

pressure

(p) score

Constants:

DISCOUNT

is the discount multiplier (i.e., df = 1 - rate)

BETA

is the trend dampening multiplier used in likely future status calculation

default_trend

The default trend value (0) if region has NA.

Details

Parameters:

Value

Returns a data.frame with the input data, a likely future status and OHI score, containing columns: status (x), trend (t), resilience (r), pressure (p), future status (xF) and goal score (score).

Examples


## Not run: 
## run a model with 50 regions using random data,
## using 5 year 1-percent discount rate and beta = 0.67
require(ohi)
d <- ohi.model.goal(id = 1:50, 
                    status = runif(50, 0, 1), 
                    trend = runif(50, -1, 1), 
                    resilience = runif(50, 0, 1), 
                    pressure = runif(50, 0, 1), 
                    DISCOUNT = (1 + 0.01)^-5,
                    BETA = 0.67,
                    default_trend = 0.0) 
## view model output
names(d)
d[,c('id','score','xF')]

## End(Not run)


OHI-Science/ohicore documentation built on Dec. 10, 2023, 5:45 a.m.