feasible | R Documentation |
This function finds a feasible solution,
p=(p_1,\ldots,p_n)
, in the n
-dimensional simplex of
probability distributions which must satisfy
A_1 p = b_1
,
A_2 p = b_2
, and
A_3 p = b_3
,
All the components of the b_i
must be nonnegative
In addition each probability in the solution must
be at least as big as eps
, a small positive number.
feasible(A1,A2,A3,b1,b2,b3,eps)
A1 |
The matrix for the equality constraints.This must always
contain the constraint |
A2 |
The matrix for the |
A3 |
The matrix for the |
b1 |
The rhs vector for |
b2 |
The rhs vector for |
b3 |
The rhs vector for |
eps |
A small positive number. Each member of the solution must
be at least as large as |
The function returns a vector. If the components of the vector are positive then the feasible solution is the vector returned, otherwise there is no feasible solution.
A1<-rbind(rep(1,7),1:7)
b1<-c(1,4)
A2<-rbind(c(1,1,1,1,0,0,0),c(.2,.4,.6,.8,1,1.2,1.4))
b2<-c(1,2)
A3<-rbind(c(1,3,5,7,9,10,11),c(1,1,1,0,0,0,1))
b3<-c(5,.5)
eps<-1/100
feasible(A1,A2,A3,b1,b2,b3,eps)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.