Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
miscmaths
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
FSL
miscmaths
Commits
fc7e9967
Commit
fc7e9967
authored
17 years ago
by
Mark Woolrich
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
bb71781a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
miscprob.cc
+4
-0
4 additions, 0 deletions
miscprob.cc
miscprob.h
+1
-0
1 addition, 0 deletions
miscprob.h
with
5 additions
and
0 deletions
miscprob.cc
+
4
−
0
View file @
fc7e9967
...
@@ -172,6 +172,10 @@ ReturnMatrix gammapdf(const RowVector& vals, const float mu, const float var)
...
@@ -172,6 +172,10 @@ ReturnMatrix gammapdf(const RowVector& vals, const float mu, const float var)
return
res
;
return
res
;
}
}
float
normpdf
(
const
float
val
,
const
float
mu
,
const
float
var
)
{
return
std
::
exp
(
-
0.5
*
(
std
::
pow
(
val
-
mu
,
2
)
/
var
))
*
std
::
pow
(
2
*
M_PI
*
var
,
-
0.5
);
}
ReturnMatrix
normpdf
(
const
RowVector
&
vals
,
const
RowVector
&
mu
,
const
RowVector
&
var
)
ReturnMatrix
normpdf
(
const
RowVector
&
vals
,
const
RowVector
&
mu
,
const
RowVector
&
var
)
{
{
...
...
This diff is collapsed.
Click to expand it.
miscprob.h
+
1
−
0
View file @
fc7e9967
...
@@ -35,6 +35,7 @@ namespace MISCMATHS {
...
@@ -35,6 +35,7 @@ namespace MISCMATHS {
// returns nsamps*nparams matrix:
// returns nsamps*nparams matrix:
ReturnMatrix
mvnrnd
(
const
RowVector
&
mu
,
const
SymmetricMatrix
&
covar
,
int
nsamp
=
1
);
ReturnMatrix
mvnrnd
(
const
RowVector
&
mu
,
const
SymmetricMatrix
&
covar
,
int
nsamp
=
1
);
float
normpdf
(
const
float
val
,
const
float
mu
=
0
,
const
float
var
=
1
);
ReturnMatrix
normpdf
(
const
RowVector
&
vals
,
const
float
mu
=
0
,
const
float
var
=
1
);
ReturnMatrix
normpdf
(
const
RowVector
&
vals
,
const
float
mu
=
0
,
const
float
var
=
1
);
...
...
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