STA5107_FRADE_HW3

STA5107_FRADE_HW3 - STA5107 Dr Srivastava Homework 2 Jaime...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
STA5107: Dr. Srivastava Homework 2 Jaime Frade 1. OUTPUT
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
STA5107: Dr. Srivastava Homework 2 Jaime Frade
Background image of page 2
STA5107: Dr. Srivastava Homework 2 Jaime Frade Sample path relative Frequency at i=100 When state= 1 v2_Rel_Freq = 0 0 0.2000 0.8000 When state= 2 v2_Rel_Freq = 0 0 0.2200 0.7800 When state= 3 v2_Rel_Freq = 0.1600 0.8400 0 0 When state= 4 v2_Rel_Freq = 0.1600 0.8300 0 0 >> vectoreig=v(1:4,2)/sum(v(1:4,2)) vectoreig1 = 0.1667 0.8333 0 0 >> vectoreig=v(1:4,4)/sum(v(1:4,4)) vectoreig2 = 0 0 0.2222 0.7778
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
STA5107: Dr. Srivastava Homework 2 Jaime Frade Sample path relative Frequency at i=10000, to display convergence. When state= 1 v2_Rel_Freq = 0 0 0.2234 0.7766 When state= 2 v2_Rel_Freq = 0 0 0.2264 0.7736 When state= 3 v2_Rel_Freq = 0.1627 0.8373 0 0 When state= 4 v2_Rel_Freq = 0.1647 0.8353 0 0 Comment From the setup, one can notice that not all states communicate with each other. The transition matrices is irreducible when separated into two disjoint matrices that within the matrices do communicate with each other. Therefore if the state enters into one of these two matrices, it will continue and remain in the state, as seen in relative frequencies graphs.
Background image of page 4
STA5107: Dr. Srivastava Homework 2 Jaime Frade CODE %prob1 clear all clc trans = [0.5 0.5 0.0 0.0; 0.1 0.9 0.0 0.0; 0.0 0.0 0.3 0.7; 0.0 0.0 0.2 0.8]; n=100; state = zeros(4,n); path=zeros(n); for i=1:4; rand1 = rand/2; rand2 = rand/2; state(:,1)=[rand1 0.5-rand1 rand2 0.5-rand2]; for j=1:n; x = rand; y = find(x<cumsum(state(:,j))); path(j,i) = min(y); state(:,j+1)=trans(path(j,i),:)'; for k=1:4; count(j,i,k)=length(find(path(1:j,i)==k))/j; end ; end ; end ; for i=1:4; figure(i); stairs(path(:,i)); xlabel( 'time' ) ylabel( 'X(i) state' ) title([ 'Sample Path #' int2str(i)]); saveas(figure(i),[ 'Prob1 Sample path ' int2str(i)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/14/2011 for the course STAT 5107 taught by Professor Staff during the Fall '09 term at FSU.

Page1 / 13

STA5107_FRADE_HW3 - STA5107 Dr Srivastava Homework 2 Jaime...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online