Learn R Programming

systemicrisk (version 0.4.2)

getfeasibleMatr: Creates a feasible starting matrix

Description

Creates a matrix with nonnegative entries, given row and column sums and 0 on the diagonal. Superseeded by the more flexible findFeasibleMatrix.

Usage

getfeasibleMatr(L, A)

Arguments

L

Vector of row sums

A

Vector of column sums

Value

A matrix with nonnegative entries and given row/column sums and 0 on the diagonal.

Examples

Run this code
# NOT RUN {
getfeasibleMatr(c(0.5,1,0),c(0.5,0,1))
getfeasibleMatr(rep(1,4),rep(1,4))
getfeasibleMatr(2^(1:3),2^(3:1))
getfeasibleMatr(1:5,1:5)
getfeasibleMatr(1:5,5:1)
# }

Run the code above in your browser using DataLab