Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stéphane Adjemian
dynare
Commits
42140ff8
Commit
42140ff8
authored
6 years ago
by
Stéphane Adjemian (Charybdis)
Committed by
Stéphane Adjemian
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Updated header.
parent
fa8ffbf3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/cubature_with_gaussian_weight.m
+17
-36
17 additions, 36 deletions
matlab/cubature_with_gaussian_weight.m
with
17 additions
and
36 deletions
matlab/cubature_with_gaussian_weight.m
+
17
−
36
View file @
42140ff8
function
[
nodes
,
weights
]
=
cubature_with_gaussian_weight
(
d
,
n
,
method
)
function
[
nodes
,
weights
]
=
cubature_with_gaussian_weight
(
d
,
n
,
method
)
%
@info
:
% Computes nodes and weights for a n-order cubature with gaussian weight.
%!
@deftypefn
{
Function
File
}
{
@var
{
nodes
},
@var
{
weights
}
=
}
cubature_with_gaussian_weight
(
@var
{
d
},
@var
{
n
})
%
%!
@anchor
{
cubature_with_gaussian_weight
}
% INPUTS
%!
@sp
1
% - d [integer] scalar, dimension of the region of integration.
%!
Computes
nodes
and
weights
for
a
n
-
order
cubature
with
gaussian
weight
.
% - n [integer] scalar, approximation order (3 or 5).
%!
@sp
2
% - method [string] Method of approximation ('Stroud' or 'ScaledUnscentedTransform')
%!
@strong
{
Inputs
}
%
%!
@sp
1
% OUTPUTS
%!
@table
@
@var
% - nodes [double] n×m matrix, with m=2×d if n=3 or m=2×d²+1 if n=5, nodes where the integrated function has to be evaluated.
%!
@item
d
% - weights [double] m×1 vector, weights associated to the nodes.
%!
Scalar
integer
,
dimension
of
the
region
of
integration
.
%
%!
@item
n
% REMARKS
%!
Scalar
integer
equal
to
3
or
5
,
approximation
order
.
% The routine returns nodes and associated weights to compute a multivariate integral of the form:
%!
@end
table
% ∞ -<x,x>
%!
@sp
2
% ∫ f(x) × e dx
%!
@strong
{
Outputs
}
% -∞
%!
@sp
1
%!
@table
@
@var
%!
@item
nodes
%!
n
*
m
matrix
of
doubles
,
the
m
nodes
where
the
integrated
function
has
to
be
evaluated
.
The
number
of
nodes
,
m
,
is
equal
to
2
*
@var
{
d
}
is
@var
{
n
}
==
3
or
2
*
@var
{
d
}
^
2
+
1
if
@var
{
n
}
==
5
.
%!
@item
weights
%!
m
*
1
vector
of
doubles
,
weights
associated
to
the
nodes
.
%!
@end
table
%!
@sp
2
%!
@strong
{
Remarks
}
%!
@sp
1
%!
The
routine
returns
nodes
and
associated
weights
to
compute
a
multivariate
integral
of
the
form
:
%!
%!
\
int_D
f
(
x
)
*
\
exp
(
-<
x
,
x
>
)
dx
%!
%!
%!
@end
deftypefn
%
@eod
:
%
Copyright
(
C
)
2012
-
201
7
Dynare
Team
% Copyright (C) 2012-201
9
Dynare Team
%
%
% This file is part of Dynare.
% This file is part of Dynare.
%
%
...
@@ -51,8 +34,6 @@ function [nodes, weights] = cubature_with_gaussian_weight(d,n,method)
...
@@ -51,8 +34,6 @@ function [nodes, weights] = cubature_with_gaussian_weight(d,n,method)
% You should have received a copy of the GNU General Public License
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
%
AUTHOR
(
S
)
stephane
DOT
adjemian
AT
univ
DASH
lemans
DOT
fr
% Set default.
% Set default.
if
nargin
<
3
||
isempty
(
method
)
if
nargin
<
3
||
isempty
(
method
)
method
=
'Stroud'
;
method
=
'Stroud'
;
...
...
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