Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Frida
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
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coenen, Joachim
Frida
Commits
d8effc64
Commit
d8effc64
authored
9 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
corr bug found by Antti: "stdv x" was "variance y".
parent
ce071508
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pub/CHANGELOG
+3
-1
3 additions, 1 deletion
pub/CHANGELOG
pub/lib/geni.cpp
+16
-4
16 additions, 4 deletions
pub/lib/geni.cpp
with
19 additions
and
5 deletions
pub/CHANGELOG
+
3
−
1
View file @
d8effc64
...
...
@@ -2,7 +2,9 @@ Release 2.3.1c
- Updated dependence:
- now requires cmake 2.8.12 (older version were untested)
- Bug fix:
- "stdv" was variance. Now "var" and "stdv" are available
Release 2.3.1b of 22sep15
- Improved functionality:
...
...
This diff is collapsed.
Click to expand it.
pub/lib/geni.cpp
+
16
−
4
View file @
d8effc64
...
...
@@ -151,12 +151,12 @@ void geni_avge( double* r, double* dr, int n, const vector<RObjVecNum>& a )
*
dr
=
0
;
// TODO better estimate
}
//! S
tandard deviation
.
//! S
ample variance
.
void
geni_
stdv
(
double
*
r
,
double
*
dr
,
int
n
,
const
vector
<
RObjVecNum
>&
a
)
void
geni_
variance
(
double
*
r
,
double
*
dr
,
int
n
,
const
vector
<
RObjVecNum
>&
a
)
{
if
(
n
<
2
)
throw
S
(
"Cannot compute
corrected standard deviation
for sample size < 2"
);
throw
S
(
"Cannot compute
sample variance
for sample size < 2"
);
double
p
=
0
,
pp
=
0
,
q
=
0
;
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
pp
=
p
+
(
a
[
0
]
->
to_r
(
i
)
-
p
)
/
(
i
+
1
);
...
...
@@ -168,6 +168,16 @@ void geni_stdv( double* r, double* dr, int n, const vector<RObjVecNum>& a )
*
dr
=
0
;
// TODO better estimate
}
//! Sample standard deviation.
void
geni_stdv
(
double
*
r
,
double
*
dr
,
int
n
,
const
vector
<
RObjVecNum
>&
a
)
{
geni_variance
(
r
,
dr
,
n
,
a
);
*
r
=
sqrt
(
*
r
);
if
(
dr
)
*
dr
=
0
;
// TODO better estimate
}
//! Integral.
void
geni_integral
(
double
*
r
,
double
*
dr
,
int
n
,
const
vector
<
RObjVecNum
>&
a
)
...
...
@@ -308,8 +318,10 @@ void NGeni::initialize()
"sum of y"
))
->
register_me
();
(
new
CGeni
(
"avge"
,
1
,
"y"
,
geni_avge
,
"a"
,
"average of y"
))
->
register_me
();
(
new
CGeni
(
"var"
,
1
,
"y"
,
geni_variance
,
"a"
,
"sample variance of y"
))
->
register_me
();
(
new
CGeni
(
"stdv"
,
1
,
"y"
,
geni_stdv
,
"a"
,
"
corrected
sample standard deviation of
x
"
))
->
register_me
();
"sample standard deviation of
y
"
))
->
register_me
();
(
new
CGeni
(
"integral"
,
2
,
"x,y"
,
geni_integral
,
"ab"
,
"integral d(x) of y"
))
->
register_me
();
(
new
CGeni
(
"cog"
,
2
,
"x,y"
,
geni_cog
,
"a"
,
...
...
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