firstValueRow {LSMonteCarlo}R Documentation

Returning the first >0 value in each row of a matrix

Description

Technical function implemented in the pricing functions of the package. It returns the first >0 value in each row of a matrix and assign zero to all subsequent values.

Usage

firstValueRow(x)

Arguments

x

A matrix.

Value

A matrix.

Author(s)

Mikhail A. Beketov

See Also

Functions: AmerPutLSM, AmerPutLSM_AV, AmerPutLSM_CV, AsianAmerPutLSM, QuantoAmerPutLSM, and QuantoAmerPutLSM_AV.

Examples

mat<-matrix(c(0,0,2,0,4,0,3,0,1,9,8,7), ncol=4)
mat
firstValueRow(mat)

[Package LSMonteCarlo version 1.0 Index]