Message Boards Message Boards

0
|
3307 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Help with FixedPoint on matrices

Posted 10 years ago

Hi,

I'm trying to compute the fixed point of a vector-valued function, here are the definitions I use:

Z1 = {0, 1, 2};
Y = {1, 0};
X = Tuples[{Z1,Y}];
\[Alpha]VP[0] = 0.5;
\[Alpha]VP[1] = 1.;
\[Beta] = 0.95;
Pr1m={{0.691462, 0.24173, 0.0668072}, {0.460172, 0.355768, 0.18406}, {0.241964, 0.375948, 0.382089}};
Pry1 = {{1., 0.}, {1., 0.}};
Pry0 = {{0., 1.}, {0., 1.}};
F1 = KroneckerProduct[Pr1m,Pry1];
F0 = KroneckerProduct[Pr1m,Pry0];
\[DoubledPi]m[z1_,y_] := (\[Alpha]VP[0] + \[Alpha]VP[1] z1) (1 - y)
v[z1_,y_] := Log[Exp[\[DoubledPi]m[z1, y] + \[Beta] F1. #] + Exp[\[Beta] F0. #]] &
fun = Apply[v] /@ X
FixedPoint[Apply[fun], ConstantArray[0., 6], SameTest -> (EuclideanDistance[#1, #2] < .001 &)]

I've been trying to get the final line to work, but have had no luck. Any help would be appreciated.

POSTED BY: Miguel Olivo-V

Structurally this will only work if the first argument of FixedPoint gives output in the same form the second argument (the start value) has - to allow for iteration. Can you show please how Apply[fun] produces a list of length 6? F1 and F0 are {6,4} matrices, to evaluate them in a scalar function like Exp one needs 2 vectors to absorb them into a scalar

In[99]:= {1, 2, 3, 4, 5, 6}.F0.{7, 8, 9, 10, 11, 12}
Out[99]= 205.469

In[100]:= {1, 2, 3, 4, 5, 6}.F1.{7, 8, 9, 10, 11, 12}
Out[100]= 184.469

but the above definitions apply only one Dot-Operator. Then one needs to give instantiations of the scalar values z1 and y to get it started, if the algebra has been fixed.

POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract