fnc: Find next cell function

Description Usage Arguments Details Value Author(s) Examples

View source: R/journeys.r

Description

Find next cell function

Usage

1
2
fnc(rdmap, tm, curInd, mom = NULL, momAdj = 0.5, w1 = exp(1), w2 = 1,
  varEst = 10)

Arguments

rdmap

reduced dimensionality matrix with cells in rows and dims in columns

tm

Transition matrix

curInd

Current state on tm

mom

Current momentum vector

momAdj

Weighting to adjust momentum. From 0-1. Lower numbers make smaller adjustment to momentum vector.

w1

Parameter - Base used for modifying of tm probs.

w2

Parameter - Multiplifaction factor used for modifying tm probs.

varEst

Number of alternatives to sample for estimating variance.

Details

Find next cell function. Transitioin probabilities are modifed by calulating the cosine of the angle between the current momentum vector and the vector on the rdmap required for each transtion. The tranisiton probability is adjusted by multiplying by w1^(w2 * (cosine_angle)) and then normalising.

Value

Returns index of new cell and new momentum vector

Author(s)

Wajid Jawaid

Examples

1
2
3
4
## Not run: 
nextCell <- fnc(rdmap, tm, curInd)

## End(Not run)

wjawaid/roots documentation built on Sept. 12, 2017, 9:51 a.m.