Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
pbdlib-matlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rli
pbdlib-matlab
Commits
474f7fad
Commit
474f7fad
authored
Aug 07, 2014
by
Sylvain Calinon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GMR.m added
parent
cb57746d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
GMR.m
GMR.m
+31
-0
No files found.
GMR.m
0 → 100644
View file @
474f7fad
function
[
expData
,
expSigma
,
H
]
=
GMR
(
model
,
DataIn
,
in
,
out
)
%Gaussian mixture regression (GMR)
%Sylvain Calinon, Danilo Bruno, 2014
nbData
=
size
(
DataIn
,
2
);
nbVarOut
=
length
(
out
);
MuTmp
=
zeros
(
nbVarOut
,
model
.
nbStates
);
expData
=
zeros
(
nbVarOut
,
nbData
);
expSigma
=
zeros
(
nbVarOut
,
nbVarOut
,
nbData
);
for
t
=
1
:
nbData
%Compute activation weight
for
i
=
1
:
model
.
nbStates
H
(
i
,
t
)
=
model
.
Priors
(
i
)
*
gaussPDF
(
DataIn
(:,
t
),
model
.
Mu
(
in
,
i
),
model
.
Sigma
(
in
,
in
,
i
));
end
H
(:,
t
)
=
H
(:,
t
)/
sum
(
H
(:,
t
));
%Compute expected conditional means
for
i
=
1
:
model
.
nbStates
MuTmp
(:,
i
)
=
model
.
Mu
(
out
,
i
)
+
model
.
Sigma
(
out
,
in
,
i
)/
model
.
Sigma
(
in
,
in
,
i
)
*
(
DataIn
(:,
t
)
-
model
.
Mu
(
in
,
i
));
expData
(:,
t
)
=
expData
(:,
t
)
+
H
(
i
,
t
)
*
MuTmp
(:,
i
);
end
%Compute expected conditional covariances
for
i
=
1
:
model
.
nbStates
SigmaTmp
=
model
.
Sigma
(
out
,
out
,
i
)
-
model
.
Sigma
(
out
,
in
,
i
)/
model
.
Sigma
(
in
,
in
,
i
)
*
model
.
Sigma
(
in
,
out
,
i
);
expSigma
(:,:,
t
)
=
expSigma
(:,:,
t
)
+
H
(
i
,
t
)
*
(
SigmaTmp
+
MuTmp
(:,
i
)
*
MuTmp
(:,
i
)
'
);
for
j
=
1
:
model
.
nbStates
expSigma
(:,:,
t
)
=
expSigma
(:,:,
t
)
-
H
(
i
,
t
)
*
H
(
j
,
t
)
*
(
MuTmp
(:,
i
)
*
MuTmp
(:,
j
)
'
);
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment