(15C) Transition Matrix Test, Square Matrix to an Integer Power
|
08-27-2023, 05:37 AM
Post: #1
|
|||
|
|||
(15C) Transition Matrix Test, Square Matrix to an Integer Power
Transition Matrix Test - Markov Chain
Do all rows sum to 1? The program: * Tests whether Matrix A is a square matrix. Non-square matrices are not transition matrices qualified for Markov Chains. (lines 005 through 007) * Sum the elements of each row. * Tests whether sum of each row is 1. (LBL 2) If (I) and (III) are met, then Matrix A is qualified to be used as a transition matrix for Markov Chain calculations. This test returns a 1 for yes and 0 for no. Store the contents and dimensions of Matrix A before running the program. Code: 001 : 42,21,11 : f LBL A Notes: RCL C instead of RCL MATRIX C is used because we want to recall the element, not the entire matrix. The element that is recalled depends on the row (stored in R0) and column (stored in R1). Square Matrix to a Positive Integer Using a loop is required. We are not able to use the x^2 or the y^x function with matrices, an Error 1 condition occurs. A square matrix is stored in Matrix A. Enter the positive integer power (n > 1) on the X stack before running the program. Code: 032 : 42, 21, 11 : f LBL B Notes: MATRIX 1: Set the row and column pointers to 1 (R0 = 1, R1 = 1) Example: A = [ [ 0.3, 0.7, 0 ] [ 0.3, 0.3, 0.4 ] [ 0.2, 0.5, 0.3 ] ] GTO A R/S: 1 (yes, Matrix A is qualified for as a transition matrix) If we insert a high enough power (as n → ∞), the matrix settles into a steady state, where each column will have the same value. 25 GTO B R/S: C 3 x 3 MATRIX 1 RCL C... [ [ 0.2736, 0.4623, 0.2642 ] [ 0.2736, 0.4623, 0.2642 ] [ 0.2736, 0.4623, 0.2642 ] ] |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)