Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
TZcode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Contributions
TZcode
Commits
43d56ae0
Commit
43d56ae0
authored
15 years ago
by
Dan Waggoner
Browse files
Options
Downloads
Patches
Plain Diff
modified and added some msv matlab files
parent
b64f9fe0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
MatlabFiles/MSV/fwz_msv_msre.m
+6
-15
6 additions, 15 deletions
MatlabFiles/MSV/fwz_msv_msre.m
MatlabFiles/MSV/fwz_pi2eye.m
+20
-0
20 additions, 0 deletions
MatlabFiles/MSV/fwz_pi2eye.m
MatlabFiles/MSV/verify_solution.m
+52
-0
52 additions, 0 deletions
MatlabFiles/MSV/verify_solution.m
with
78 additions
and
15 deletions
MatlabFiles/MSV/fwz_msv_msre.m
+
6
−
15
View file @
43d56ae0
...
@@ -17,8 +17,10 @@ function [F1, F2, G1, G2, V, err] = fwz_msv_msre(P, A, B, Psi, s, x, max_count,
...
@@ -17,8 +17,10 @@ function [F1, F2, G1, G2, V, err] = fwz_msv_msre(P, A, B, Psi, s, x, max_count,
%
%
% eta(t) = F2{s(t)}*x(t-1) + G2{s(t)}*epsilont(t)
% eta(t) = F2{s(t)}*x(t-1) + G2{s(t)}*epsilont(t)
%
%
% err is set to 0 upon sucess. A positive value is the number of
% A positive value of err is the number of iterations needed to obtain
% iterations before the method was terminated.
% convergence and indicates success. A negitive value of err is the number of
% iterations before the method terminated without convergence and indicates
% failure.
%
%
h
=
size
(
P
,
1
);
h
=
size
(
P
,
1
);
...
@@ -38,20 +40,9 @@ if nargin <= 5
...
@@ -38,20 +40,9 @@ if nargin <= 5
end
end
f
=
zeros
(
h
*
s
*
(
n
-
s
),
1
);
f
=
zeros
(
h
*
s
*
(
n
-
s
),
1
);
Is
=
eye
(
s
);
Is
=
eye
(
s
);
I
=
eye
(
n
-
s
);
I
=
eye
(
n
-
s
);
% The following code would be used if Pi were passed instead of the
% assumption that Pi' = [zeros(s,n-s) eye(s)].
% for i=1:h
% [Q,R] = qr(Pi{i});
% W=[zeros(n-s,s) I; inv(R(1:s,1:s)); zeros(s,n-s)]*Q';
% A{i}=W*A{i};
% B{i}=W*B{i};
% Psi{i}=W*Psi{i};
% end
U
=
cell
(
h
,
1
);
U
=
cell
(
h
,
1
);
for
i
=
1
:
h
for
i
=
1
:
h
U
{
i
}
=
inv
(
A
{
i
});
U
{
i
}
=
inv
(
A
{
i
});
...
@@ -109,9 +100,9 @@ while cont
...
@@ -109,9 +100,9 @@ while cont
end
end
if
(
norm
(
f
)
<
tol
)
if
(
norm
(
f
)
<
tol
)
err
=
0
;
else
err
=
count
;
err
=
count
;
else
err
=-
count
;
end
end
F1
=
cell
(
h
,
1
);
F1
=
cell
(
h
,
1
);
...
...
This diff is collapsed.
Click to expand it.
MatlabFiles/MSV/fwz_pi2eye.m
0 → 100644
+
20
−
0
View file @
43d56ae0
function
[
A_new
,
B_new
,
Psi_new
]
=
fwz_pi2eye
(
A
,
B
,
Psi
,
Pi
)
% [A, B, Psi] = fwz_pi2eye(A, B, Psi, Pi)
% Converts the representation
%
% A(s(t) x(t) = B(s(t) x(t-1) + Psi(s(t)) epsilon(t) + Pi{s(t)} eta(t)
%
% to a form compatible with fwz_msv_msre(). This is the form
%
% A(s(t) x(t) = B(s(t) x(t-1) + Psi(s(t)) epsilon(t) + Pi eta(t)
%
% where Pi' = [zeros(s,n-s) eye(s)]
%
for
i
=
1
:
h
[
Q
,
R
]
=
qr
(
Pi
{
i
});
W
=
[
zeros
(
n
-
s
,
s
)
I
;
inv
(
R
(
1
:
s
,
1
:
s
));
zeros
(
s
,
n
-
s
)]
*
Q
'
;
A_new
{
i
}
=
W
*
A
{
i
};
B_new
{
i
}
=
W
*
B
{
i
};
Psi_new
{
i
}
=
W
*
Psi
{
i
};
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
MatlabFiles/MSV/verify_solution.m
0 → 100644
+
52
−
0
View file @
43d56ae0
function
diff
=
verify_solution
(
P
,
A
,
B
,
Psi
,
s
,
F1
,
F2
,
G1
,
G2
,
V
)
%
% Verifies that
%
% x(t) = V(s(t))(F1(s(t))x(t-1) + G1(s(t))epsilon(t)
% eta(t) = F2(s(t))x(t-1) + G2(s(t))epsilon(t)
%
% is a solution of
%
% A(s(t)) x(t) = B(s(t)) x(t-1) + Psi(s(t) epsilon(t) + Pi eta(t)
%
% where Pi' = [zeros(s,n-s) eye(s)] by verifying that
%
% [A(j)*V(j) Pi] [ F1(j)
% F2(j) ] = B(j)
%
% [A(j)*V(j) Pi] [ G1(j)
% G2(j) ] = Psi(j)
%
% (P(i,1)*F2(1) + ... + P(i,h)*F2(h))*V(i) = 0
%
h
=
size
(
P
,
1
);
n
=
size
(
A
{
1
},
1
);
r
=
size
(
Psi
{
1
},
2
);
diff
=
0
;
Pi
=
[
zeros
(
n
-
s
,
s
);
eye
(
s
)];
for
j
=
1
:
h
X
=
inv
([
A
{
j
}
*
V
{
j
}
Pi
]);
tmp
=
norm
(
X
*
B
{
j
}
-
[
F1
{
j
};
F2
{
j
}]);
if
tmp
>
diff
diff
=
tmp
;
end
tmp
=
norm
(
X
*
Psi
{
j
}
-
[
G1
{
j
};
G2
{
j
}]);
if
(
tmp
>
diff
)
diff
=
tmp
;
end
end
for
i
=
1
:
h
X
=
zeros
(
s
,
n
);
for
j
=
1
:
h
X
=
X
+
P
(
i
,
j
)
*
F2
{
j
};
end
tmp
=
norm
(
X
*
V
{
i
});
if
tmp
>
diff
diff
=
tmp
;
end
;
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment