Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
591fa527
Commit
591fa527
authored
Dec 16, 2013
by
panos
Committed by
Jérome Perrin
Jan 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first version of output analysis included
parent
21c2ff80
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
248 additions
and
0 deletions
+248
-0
dream/simulation/outputanalysis/ConfidenceIntervals.py
dream/simulation/outputanalysis/ConfidenceIntervals.py
+58
-0
dream/simulation/outputanalysis/Plots.py
dream/simulation/outputanalysis/Plots.py
+79
-0
dream/simulation/outputanalysis/StatisticalMeasures.py
dream/simulation/outputanalysis/StatisticalMeasures.py
+87
-0
dream/simulation/outputanalysis/__init__.py
dream/simulation/outputanalysis/__init__.py
+24
-0
No files found.
dream/simulation/outputanalysis/ConfidenceIntervals.py
0 → 100644
View file @
591fa527
# ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# DREAM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with DREAM. If not, see <http://www.gnu.org/licenses/>.
# ===========================================================================
'''
Created on 16 Nov 2013
@author: Panos
'''
from
rpy2.robjects.packages
import
importr
from
rpy2
import
robjects
MASS
=
importr
(
'MASS'
)
class
Intervals
:
def
ConfidIntervals
(
self
,
data
,
p
):
data
=
robjects
.
FloatVector
(
data
)
alpha
=
1
-
p
rsqrt
=
robjects
.
r
[
'sqrt'
]
rsd
=
robjects
.
r
[
'sd'
]
rmean
=
robjects
.
r
[
'mean'
]
t
=
len
(
data
)
n
=
rsqrt
(
t
)
b
=
rsd
(
data
)
rqt
=
robjects
.
r
[
'qt'
]
q
=
rqt
((
1
-
(
alpha
/
2
)),
t
-
1
)
m
=
rmean
(
data
)
me
=
q
[
0
]
*
(
b
[
0
]
/
n
[
0
])
lo
=
m
[
0
]
-
me
up
=
m
[
0
]
+
me
l
=
[
lo
,
up
]
return
l
dream/simulation/outputanalysis/Plots.py
0 → 100644
View file @
591fa527
# ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# DREAM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with DREAM. If not, see <http://www.gnu.org/licenses/>.
# ===========================================================================
'''
Created on 16 Dec 2013
@author: Panos
'''
from
rpy2
import
robjects
class
Graphs
:
def
Plots
(
self
,
data
,
fileName
=
"plotChart.jpg"
):
data
=
robjects
.
FloatVector
(
data
)
rplot
=
robjects
.
r
[
'plot'
]
rdev
=
robjects
.
r
[
'dev.off'
]
rjpeg
=
robjects
.
r
[
'jpeg'
]
output
=
rjpeg
(
fileName
)
rplot
(
data
,
type
=
"o"
,
col
=
"blue"
)
rdev
return
output
def
ScatterPlot
(
self
,
data1
,
data2
,
fileName
=
"scatterplot.jpg"
):
data1
=
robjects
.
FloatVector
(
data1
)
data2
=
robjects
.
FloatVector
(
data2
)
rplot
=
robjects
.
r
[
'plot'
]
rdev
=
robjects
.
r
[
'dev.off'
]
rjpeg
=
robjects
.
r
[
'jpeg'
]
output
=
rjpeg
(
fileName
)
rplot
(
data1
,
data2
,
type
=
"o"
,
col
=
"red"
)
rdev
return
output
def
Pie
(
self
,
data1
,
fileName
=
"pieChart.jpg"
):
data1
=
robjects
.
FloatVector
(
data1
)
rpaste
=
robjects
.
r
[
'paste'
]
rround
=
robjects
.
r
[
'round'
]
rsum
=
robjects
.
r
[
'sum'
]
rpie
=
robjects
.
r
[
'pie'
]
rdev
=
robjects
.
r
[
'dev.off'
]
colors
=
robjects
.
StrVector
([
"white"
,
"grey70"
,
"grey90"
,
"grey50"
,
"grey60"
,
"black"
])
s
=
rsum
(
data1
)
d_labels
=
[
0
]
*
(
len
(
data1
))
i
=
0
while
i
<
len
(
data1
):
d_labels
[
i
]
=
((
rround
((
data1
[
i
]
/
s
[
0
])
*
100
,
1
)))
i
+=
1
d_labels
=
rpaste
(
d_labels
,
"%"
,
sep
=
""
)
rjpeg
=
robjects
.
r
[
'jpeg'
]
export
=
rjpeg
(
fileName
)
rpie
(
data1
,
main
=
"Data"
,
col
=
colors
,
labels
=
d_labels
,
cex
=
0.8
)
rdev
return
export
dream/simulation/outputanalysis/StatisticalMeasures.py
0 → 100644
View file @
591fa527
# ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# DREAM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with DREAM. If not, see <http://www.gnu.org/licenses/>.
# ===========================================================================
'''
Created on 14 Nov 2013
@author: Panos
'''
import
rpy2.robjects
as
robjects
from
rpy2.robjects.packages
import
importr
MASS
=
importr
(
'MASS'
)
class
BasicStatisticalMeasures
:
def
length
(
self
,
data
):
data
=
robjects
.
FloatVector
(
data
)
rlength
=
robjects
.
r
[
'length'
]
return
rlength
(
data
)
def
summary
(
self
,
data
):
data
=
robjects
.
FloatVector
(
data
)
rsummary
=
robjects
.
r
[
'summary'
]
return
rsummary
(
data
)
def
quantile
(
self
,
data
):
data
=
robjects
.
FloatVector
(
data
)
rquantile
=
robjects
.
r
[
'quantile'
]
return
rquantile
(
data
)
def
frequency
(
self
,
data
):
data
=
robjects
.
FloatVector
(
data
)
rtable
=
robjects
.
r
[
'table'
]
return
rtable
(
data
)
def
mean
(
self
,
data
):
data
=
robjects
.
FloatVector
(
data
)
rmean
=
robjects
.
r
[
'mean'
]
return
rmean
(
data
)
def
var
(
self
,
data
):
data
=
robjects
.
FloatVector
(
data
)
rvar
=
robjects
.
r
[
'var'
]
return
rvar
(
data
)
def
sd
(
self
,
data
):
data
=
robjects
.
FloatVector
(
data
)
rsd
=
robjects
.
r
[
'sd'
]
return
rsd
(
data
)
def
range
(
self
,
data
):
data
=
robjects
.
FloatVector
(
data
)
rrange
=
robjects
.
r
[
'range'
]
return
rrange
(
data
)
def
IQR
(
self
,
data
):
data
=
robjects
.
FloatVector
(
data
)
rIQR
=
robjects
.
r
[
'IQR'
]
return
rIQR
(
data
)
def
all
(
self
,
data
):
data
=
robjects
.
FloatVector
(
data
)
print
'The length of the data set is:'
,
self
.
length
(
data
)[
0
]
print
'The summary is:'
,
self
.
summary
(
data
)
print
'The quartiles and percentiles of the data set are:'
,
self
.
quantile
(
data
)
print
'The frequency of the datapoints are:'
,
self
.
frequency
(
data
)
print
'The mean value is:'
,
self
.
mean
(
data
)[
0
]
print
'The standard deviation is:'
,
self
.
sd
(
data
)[
0
]
print
'The variance is:'
,
self
.
var
(
data
)[
0
]
print
'The range is:'
,
self
.
range
(
data
)[
0
]
print
'The Interquartile Range is:'
,
self
.
IQR
(
data
)[
0
]
\ No newline at end of file
dream/simulation/outputanalysis/__init__.py
0 → 100644
View file @
591fa527
# ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# DREAM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with DREAM. If not, see <http://www.gnu.org/licenses/>.
# ===========================================================================
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try
:
__import__
(
'pkg_resources'
).
declare_namespace
(
__name__
)
except
ImportError
:
from
pkgutil
import
extend_path
__path__
=
extend_path
(
__path__
,
__name__
)
\ No newline at end of file
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