solveModel: Solve the model in response to initial concept changes

Description Usage Arguments Details Value

View source: R/fsdm.R

Description

solveModel iterates model to either find an equilibrium solution or identify if there is no equilibrium

Usage

1
2
solveModel(V_Cn, TargetV_Cn, RemIncr, M, Type, MaxIter = 100,
  ThresholdChg = 0.01)

Arguments

V_Cn

a numeric vector identifying the values of concepts

TargetV_Cn

a numeric vector identifying the target values of concepts for the scenario

RemIncr

the remaining number of increments to complete the scenario

M

a list containing the FSDM model components

Type

a string identifying the growth function. May be either 'Exponential' or 'Linear'.

MaxIter

a number identifying the maximum number of iterations

ThresholdChg

a number identifying the threshold for identifying whether equilibrium has been found

Details

This function solves a model for a given set of initial changes to concept. It iteratively runs the calcEffects function and with each iteration checks whether the resulting values are very nearly equal to the concept values in the previous iteration. If so, iteration is stopped. If the maximum number of iterations occurs without finding an equilibrium the iteration is also stopped. The function returns the result of the iteration and an indicator of whether an equilibrium value has been found.

Value

a list having 3 named components. Success is a logical identifying whether an equilibrium solution has been found. Values is a numeric vector identifying the values of concepts at the end. AllValues is a matrix identifying the values of concepts at each iteration where columns are the concepts and rows are the iterations.


gregorbj/FSDM documentation built on May 25, 2021, 11:41 p.m.