Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uwb_analysis
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Adriaens, Ines
uwb_analysis
Commits
d6ad9e1d
Commit
d6ad9e1d
authored
3 years ago
by
Adriaens, Ines
Browse files
Options
Downloads
Patches
Plain Diff
explore penalty and statistic
parent
77c2b456
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
S10_penalty_postprocess.asv
+37
-3
37 additions, 3 deletions
S10_penalty_postprocess.asv
S10_penalty_postprocess.m
+28
-3
28 additions, 3 deletions
S10_penalty_postprocess.m
with
65 additions
and
6 deletions
S10_penalty_postprocess.asv
+
37
−
3
View file @
d6ad9e1d
...
...
@@ -147,7 +147,7 @@ for i = 1:10%length(fields_)
seldata.(fields_{i}).avg_z_sm,'Color',[178/255 34/255 34/255],...
'LineWidth',1)
plot(seldata.(fields_{i}).numtime-min(seldata.(fields_{i}).numtime),...
seldata.(fields_{i}).islying*2.3,'Color',[0/255 0/255 128/255],...
seldata.(fields_{i}).islying*
(-2.3)+
2.3,'Color',[0/255 0/255 128/255],...
'LineWidth',2)
subplot(2,1,2); hold on;box on; title('Center distance',...
'Interpreter','none');
...
...
@@ -156,7 +156,7 @@ for i = 1:10%length(fields_)
seldata.(fields_{i}).centerdist,'Color',[178/255 34/255 34/255],...
'LineWidth',1)
plot(seldata.(fields_{i}).numtime-min(seldata.(fields_{i}).numtime),...
seldata.(fields_{i}).islying*13,'Color',[0/255 0/255 128/255],...
seldata.(fields_{i}).islying*
(-13)+
13,'Color',[0/255 0/255 128/255],...
'LineWidth',2)
end
...
...
@@ -329,4 +329,38 @@ end
figure('Units','centimeters','OuterPosition',[4 1 28 20]);
subplot(2,3,1); plot(cpsums.nochanges,cpsums.ZmeanDif,'o','Color',[102/255 0 51/255],...
'MarkerSize',6,'LineWidth',1.5)
\ No newline at end of file
subplot(2,3,2); plot(cpsums.nochanges,cpsums.ZstdDif,'o','Color',[102/255 0 51/255],...
'MarkerSize',6,'LineWidth',1.5)
subplot(2,3,3); plot(cpsums.nochanges,cpsums.ZrmsDif,'o','Color',[102/255 0 51/255],...
'MarkerSize',6,'LineWidth',1.5)
subplot(2,3,4); plot(cpsums.nochanges,cpsums.CDmeanDif,'o','Color',[102/255 0 51/255],...
'MarkerSize',6,'LineWidth',1.5)
subplot(2,3,5); plot(cpsums.nochanges,cpsums.CDstdDif,'o','Color',[102/255 0 51/255],...
'MarkerSize',6,'LineWidth',1.5)
subplot(2,3,6); plot(cpsums.nochanges,cpsums.CDrmsDif,'o','Color',[102/255 0 51/255],...
'MarkerSize',6,'LineWidth',1.5)
% try a different approach based on a moving STD window of 30 minutes
tic
ind = find(~isnan(seldata.cow_99.avg_z_sm));
n = length(ind);
x = seldata.cow_99.avg_z_sm(ind);
test = movsum(30*60*log(movvar(x,30*60)),30*60);
toc
figure;
plot(test)
sum(n*log(var(x,1,2)));
[~,b] = findchangepts(x,'Statistic','std','MinThreshold',100000000000)
figure,
findchangepts(x,'Statistic','std','MinThreshold',abs(b)*0.05, 'MinDistance',600)
figure,
findchangepts(x,'Statistic','std','MaxNumChanges',20, 'MinDistance',600)
% for "mean" ==> residue = n*sum(var(x,1,2));
% for "std" ==> residue = sum(n*log(var(x,1,2)));
% for "rms" ==> residue = sum(n*log(sum(x.^2,2)/n));
\ No newline at end of file
This diff is collapsed.
Click to expand it.
S10_penalty_postprocess.m
+
28
−
3
View file @
d6ad9e1d
...
...
@@ -147,7 +147,7 @@ for i = 1:10%length(fields_)
seldata
.
(
fields_
{
i
})
.
avg_z_sm
,
'Color'
,[
178
/
255
34
/
255
34
/
255
],
...
'LineWidth'
,
1
)
plot
(
seldata
.
(
fields_
{
i
})
.
numtime
-
min
(
seldata
.
(
fields_
{
i
})
.
numtime
),
...
seldata
.
(
fields_
{
i
})
.
islying
*
2.3
,
'Color'
,[
0
/
255
0
/
255
128
/
255
],
...
seldata
.
(
fields_
{
i
})
.
islying
*
(
-
2.3
)
+
2.3
,
'Color'
,[
0
/
255
0
/
255
128
/
255
],
...
'LineWidth'
,
2
)
subplot
(
2
,
1
,
2
);
hold
on
;
box
on
;
title
(
'Center distance'
,
...
'Interpreter'
,
'none'
);
...
...
@@ -156,7 +156,7 @@ for i = 1:10%length(fields_)
seldata
.
(
fields_
{
i
})
.
centerdist
,
'Color'
,[
178
/
255
34
/
255
34
/
255
],
...
'LineWidth'
,
1
)
plot
(
seldata
.
(
fields_
{
i
})
.
numtime
-
min
(
seldata
.
(
fields_
{
i
})
.
numtime
),
...
seldata
.
(
fields_
{
i
})
.
islying
*
13
,
'Color'
,[
0
/
255
0
/
255
128
/
255
],
...
seldata
.
(
fields_
{
i
})
.
islying
*
(
-
13
)
+
13
,
'Color'
,[
0
/
255
0
/
255
128
/
255
],
...
'LineWidth'
,
2
)
end
...
...
@@ -338,4 +338,29 @@ subplot(2,3,4); plot(cpsums.nochanges,cpsums.CDmeanDif,'o','Color',[102/255 0 51
subplot
(
2
,
3
,
5
);
plot
(
cpsums
.
nochanges
,
cpsums
.
CDstdDif
,
'o'
,
'Color'
,[
102
/
255
0
51
/
255
],
...
'MarkerSize'
,
6
,
'LineWidth'
,
1.5
)
subplot
(
2
,
3
,
6
);
plot
(
cpsums
.
nochanges
,
cpsums
.
CDrmsDif
,
'o'
,
'Color'
,[
102
/
255
0
51
/
255
],
...
'MarkerSize'
,
6
,
'LineWidth'
,
1.5
)
\ No newline at end of file
'MarkerSize'
,
6
,
'LineWidth'
,
1.5
)
% try a different approach based on a moving STD window of 30 minutes
tic
ind
=
find
(
~
isnan
(
seldata
.
cow_152
.
avg_z_sm
));
n
=
length
(
ind
);
x
=
seldata
.
cow_152
.
avg_z_sm
(
ind
);
test
=
movsum
(
30
*
60
*
log
(
movvar
(
x
,
30
*
60
)),
30
*
60
);
toc
figure
;
plot
(
test
)
sum
(
n
*
log
(
var
(
x
,
1
,
2
)));
[
~
,
b
]
=
findchangepts
(
x
,
'Statistic'
,
'std'
,
'MinThreshold'
,
100000000000
)
figure
,
findchangepts
(
x
,
'Statistic'
,
'std'
,
'MinThreshold'
,
abs
(
b
)
*
0.05
,
'MinDistance'
,
600
)
figure
,
findchangepts
(
x
,
'Statistic'
,
'std'
,
'MaxNumChanges'
,
20
,
'MinDistance'
,
600
)
% for "mean" ==> residue = n*sum(var(x,1,2));
% for "std" ==> residue = sum(n*log(var(x,1,2)));
% for "rms" ==> residue = sum(n*log(sum(x.^2,2)/n));
\ No newline at end of file
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