#Frame 法
A=matrix(c(202,-176,228,-262,440,-462,-369,504,-561),ncol=3)
row=nrow(A)
a=c(-sum(diag(A)))
A2=A
for(j in 1:(row-1)){
As=A2+diag(a[length(a)],row)
A2=A%*%As
a=c(a,-sum(diag(A2))/(j+1))
}
lam=Re(sort(polyroot(c(a[length(a):1],1)),decreasing=T))
Q=function(x){
mat=diag(x^(row-1),row)
a=c(-sum(diag(A)))
A2=A
for(j in 1:(row-1)){
As=A2+diag(a[length(a)],row)
mat=mat+As*x^(row-1-j)
A2=A%*%As
a=c(a,-sum(diag(A2))/(j+1))
}
return(mat)
}
v=array(0,dim=dim(A))
for(j in 1:row){
v[,j]=Q(lam[j])[,1]
}
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme