Grocer Function

NAME

balance_identity - Balances an identity numerically approximatively true

CALLING SEQUENCE

[argout1,...,argoutn]=balance_identity(namey,arg1,...,argn)

PARAMETERS

Input

Output

DESCRIPTION

Balances an identity that does not numerically adjust; the residual is disributed to each term according to its absolute weight.

EXAMPLE

1) z=grand(20,4,'nor',0,1);x1=z(:,1);x2=z(:,2);x3=z(:,3);y=x1+x2+x3+0.1*z(:,4);[newx1,newx2,newx3]=balance_identity(y,x1,x2,x3)
2) z=grand(20,4,'nor',0,1);x1=z(:,1);x2=z(:,2);x3=z(:,3);y=x1+x2+x3+0.1*z(:,4);balance_identity(y,x1,x2,x3,'prefix=new')
2) z=grand(20,4,'nor',0,1);x1=z(:,1);x2=z(:,2);x3=z(:,3);y=x1+x2+x3+0.1*z(:,4);balance_identity(y,'x1','x2','x3','prefix=new')

In all examples, the relation to balance is y=x1+x2+x3.
In example 1, the new variables are called newx1, newx2 and newx3 and the identity y=newx1+newx2+newx3 holds exactly. In example 2, the new variables are called new_exogenous1,new_exogenous2,new_exogenous3 and the identity 
y=new_exogenous1+new_exogenous2+new_exogenous3holds exactly.
In example 3, the new variables are called new_x1, new_x2 and new_x3 and the identity y=new_x1+new_x2+new_x3 holds exactly.

Note the difference between examples 2 and 3: in order to keep the names of the original exogenous variables, these names  are, classically, entered between quotes.

AUTHOR

Eric Dubois 2004