From 69064a26c00948968a5ec7ce38c87eadc50f3c82 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Oct 2025 05:25:33 +0000 Subject: [PATCH 1/5] Initial plan From 6e3b15133e7af8bd30f964f1cbfc4ab1116c87b8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Oct 2025 05:33:59 +0000 Subject: [PATCH 2/5] Update docstring formatting in quad.jl - part 1 Co-authored-by: oyamad <7353083+oyamad@users.noreply.github.com> --- src/quad.jl | 202 +++++++++++++++++++++++++++------------------------- 1 file changed, 106 insertions(+), 96 deletions(-) diff --git a/src/quad.jl b/src/quad.jl index cf7d4003..f02e6896 100644 --- a/src/quad.jl +++ b/src/quad.jl @@ -15,34 +15,36 @@ and Finance, MIT Press, 2002. =# const qnw_func_notes = """ -##### Notes +# Notes If any of the parameters to this function are scalars while others are vectors of length `n`, the the scalar parameter is repeated `n` times. """ const qnw_returns = """ -##### Returns +# Returns -- `nodes::Array{Float64}` : An array of quadrature nodes -- `weights::Array{Float64}` : An array of corresponding quadrature weights +- `nodes::Array{Float64}`: An array of quadrature nodes. +- `weights::Array{Float64}`: An array of corresponding quadrature weights. """ const qnw_refs = """ -##### References +# References Miranda, Mario J, and Paul L Fackler. Applied Computational Economics and Finance, MIT Press, 2002. """ """ -Computes multivariate Guass-Legendre quadrature nodes and weights. + qnwlege(n, a, b) -##### Arguments +Computes multivariate Gauss-Legendre quadrature nodes and weights. -- `n::Union{Int, Vector{Int}}` : Number of desired nodes along each dimension -- `a::Union{Real, Vector{Real}}` : Lower endpoint along each dimension -- `b::Union{Real, Vector{Real}}` : Upper endpoint along each dimension +# Arguments + +- `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. +- `a::Union{Real, Vector{Real}}`: Lower endpoint along each dimension. +- `b::Union{Real, Vector{Real}}`: Upper endpoint along each dimension. $(qnw_returns) @@ -103,13 +105,15 @@ end """ -Computes multivariate Guass-Checbychev quadrature nodes and weights. + qnwcheb(n, a, b) + +Computes multivariate Gauss-Chebyshev quadrature nodes and weights. -##### Arguments +# Arguments -- `n::Union{Int, Vector{Int}}` : Number of desired nodes along each dimension -- `a::Union{Real, Vector{Real}}` : Lower endpoint along each dimension -- `b::Union{Real, Vector{Real}}` : Upper endpoint along each dimension +- `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. +- `a::Union{Real, Vector{Real}}`: Lower endpoint along each dimension. +- `b::Union{Real, Vector{Real}}`: Upper endpoint along each dimension. $(qnw_returns) @@ -125,18 +129,19 @@ function qnwcheb(n::Int, a::Real, b::Real) end """ + qnwnorm(n, mu, sig2) + Computes nodes and weights for multivariate normal distribution. -##### Arguments +# Arguments -- `n::Union{Int, Vector{Int}}` : Number of desired nodes along each dimension -- `mu::Union{Real, Vector{Real}}` : Mean along each dimension -- `sig2::Union{Real, Vector{Real}, Matrix{Real}}(eye(length(n)))` : Covariance - structure +- `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. +- `mu::Union{Real, Vector{Real}}`: Mean along each dimension. +- `sig2::Union{Real, Vector{Real}, Matrix{Real}}(eye(length(n)))`: Covariance structure. $(qnw_returns) -##### Notes +# Notes This function has many methods. I try to describe them here. @@ -151,7 +156,7 @@ as many times as necessary, where the number of repeats is determined by the length of either `n` and/or `mu` (which ever is a vector). If all 3 are scalars, then 1d nodes are computed. `mu` and `sig2` are treated as -the mean and variance of a 1d normal distribution +the mean and variance of a 1d normal distribution. $(qnw_refs) """ @@ -220,13 +225,15 @@ function qnwnorm(n::Int) end """ + qnwsimp(n, a, b) + Computes multivariate Simpson quadrature nodes and weights. -##### Arguments +# Arguments -- `n::Union{Int, Vector{Int}}` : Number of desired nodes along each dimension -- `a::Union{Real, Vector{Real}}` : Lower endpoint along each dimension -- `b::Union{Real, Vector{Real}}` : Upper endpoint along each dimension +- `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. +- `a::Union{Real, Vector{Real}}`: Lower endpoint along each dimension. +- `b::Union{Real, Vector{Real}}`: Upper endpoint along each dimension. $(qnw_returns) @@ -255,13 +262,15 @@ function qnwsimp(n::Int, a::Real, b::Real) end """ + qnwtrap(n, a, b) + Computes multivariate trapezoid quadrature nodes and weights. -##### Arguments +# Arguments -- `n::Union{Int, Vector{Int}}` : Number of desired nodes along each dimension -- `a::Union{Real, Vector{Real}}` : Lower endpoint along each dimension -- `b::Union{Real, Vector{Real}}` : Upper endpoint along each dimension +- `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. +- `a::Union{Real, Vector{Real}}`: Lower endpoint along each dimension. +- `b::Union{Real, Vector{Real}}`: Upper endpoint along each dimension. $(qnw_returns) @@ -282,15 +291,15 @@ function qnwtrap(n::Int, a::Real, b::Real) end """ + qnwbeta(n, a, b) + Computes nodes and weights for beta distribution. -##### Arguments +# Arguments -- `n::Union{Int, Vector{Int}}` : Number of desired nodes along each dimension -- `a::Union{Real, Vector{Real}}` : First parameter of the beta distribution, - along each dimension -- `b::Union{Real, Vector{Real}}` : Second parameter of the beta distribution, - along each dimension +- `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. +- `a::Union{Real, Vector{Real}}`: First parameter of the beta distribution, along each dimension. +- `b::Union{Real, Vector{Real}}`: Second parameter of the beta distribution, along each dimension. $(qnw_returns) @@ -391,15 +400,15 @@ function qnwbeta(n::Int, a::Real, b::Real) end """ -Computes nodes and weights for beta distribution + qnwgamma(n, a, b) -##### Arguments +Computes nodes and weights for gamma distribution. -- `n::Union{Int, Vector{Int}}` : Number of desired nodes along each dimension -- `a::Union{Real, Vector{Real}}` : Shape parameter of the gamma distribution, - along each dimension. Must be positive. Default is 1 -- `b::Union{Real, Vector{Real}}` : Scale parameter of the gamma distribution, - along each dimension. Must be positive. Default is 1 +# Arguments + +- `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. +- `a::Union{Real, Vector{Real}}`: Shape parameter of the gamma distribution, along each dimension. Must be positive. Default is 1. +- `b::Union{Real, Vector{Real}}`: Scale parameter of the gamma distribution, along each dimension. Must be positive. Default is 1. $(qnw_returns) @@ -599,13 +608,15 @@ qnwnorm(n::Int, mu::Real, sig2::Vector) = """ + qnwunif(n, a, b) + Computes quadrature nodes and weights for multivariate uniform distribution. -##### Arguments +# Arguments -- `n::Union{Int, Vector{Int}}` : Number of desired nodes along each dimension -- `a::Union{Real, Vector{Real}}` : Lower endpoint along each dimension -- `b::Union{Real, Vector{Real}}` : Upper endpoint along each dimension +- `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. +- `a::Union{Real, Vector{Real}}`: Lower endpoint along each dimension. +- `b::Union{Real, Vector{Real}}`: Upper endpoint along each dimension. $(qnw_returns) @@ -620,21 +631,21 @@ function qnwunif(n, a, b) end """ -Computes quadrature nodes and weights for multivariate uniform distribution + qnwlogn(n, mu, sig2) -##### Arguments +Computes quadrature nodes and weights for multivariate lognormal distribution. -- `n::Union{Int, Vector{Int}}` : Number of desired nodes along each dimension -- `mu::Union{Real, Vector{Real}}` : Mean along each dimension -- `sig2::Union{Real, Vector{Real}, Matrix{Real}}(eye(length(n)))` : Covariance - structure +# Arguments +- `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. +- `mu::Union{Real, Vector{Real}}`: Mean along each dimension. +- `sig2::Union{Real, Vector{Real}, Matrix{Real}}(eye(length(n)))`: Covariance structure. $(qnw_returns) -##### Notes +# Notes -See also the documentation for `qnwnorm` +See also the documentation for `qnwnorm`. $(qnw_refs) """ @@ -649,15 +660,17 @@ const equidist_pp = sqrt.(primes(7920)) # good for d <= 1000 """ + qnwequi(n, a, b, kind) + Generates equidistributed sequences with property that averages value of integrable function evaluated over the sequence converges to the integral as n goes to infinity. -##### Arguments +# Arguments -- `n::Union{Int, Vector{Int}}` : Number of desired nodes along each dimension -- `a::Union{Real, Vector{Real}}` : Lower endpoint along each dimension -- `b::Union{Real, Vector{Real}}` : Upper endpoint along each dimension +- `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. +- `a::Union{Real, Vector{Real}}`: Lower endpoint along each dimension. +- `b::Union{Real, Vector{Real}}`: Upper endpoint along each dimension. - `kind::AbstractString("N")`: One of the following: - N - Neiderreiter (default) - W - Weyl @@ -737,21 +750,21 @@ end ## Doing the quadrature """ -Approximate the integral of `f`, given quadrature `nodes` and `weights` + do_quad(f, nodes, weights, args...; kwargs...) -##### Arguments +Approximate the integral of `f`, given quadrature `nodes` and `weights`. -- `f::Function`: A callable function that is to be approximated over the domain - spanned by `nodes`. -- `nodes::Array`: Quadrature nodes -- `weights::Array`: Quadrature nodes -- `args...(Void)`: additional positional arguments to pass to `f` -- `;kwargs...(Void)`: additional keyword arguments to pass to `f` +# Arguments -##### Returns +- `f::Function`: A callable function that is to be approximated over the domain spanned by `nodes`. +- `nodes::Array`: Quadrature nodes. +- `weights::Array`: Quadrature weights. +- `args...(Void)`: Additional positional arguments to pass to `f`. +- `;kwargs...(Void)`: Additional keyword arguments to pass to `f`. -- `out::Float64` : The scalar that approximates integral of `f` on the hypercube - formed by `[a, b]` +# Returns + +- `out::Float64`: The scalar that approximates integral of `f` on the hypercube formed by `[a, b]`. """ function do_quad(f::Function, nodes::Array, weights::Vector, args...; kwargs...) @@ -760,35 +773,32 @@ end do_quad(f::Function, nodes::Array, weights::Vector) = dot(f(nodes), weights) """ + quadrect(f, n, a, b, kind, args...; kwargs...) + Integrate the d-dimensional function `f` on a rectangle with lower and upper bound for dimension i defined by `a[i]` and `b[i]`, respectively; using `n[i]` points. -##### Arguments - -- `f::Function` The function to integrate over. This should be a function that - accepts as its first argument a matrix representing points along each dimension - (each dimension is a column). Other arguments that need to be passed to the - function are caught by `args...` and `kwargs...`` -- `n::Union{Int, Vector{Int}}` : Number of desired nodes along each dimension -- `a::Union{Real, Vector{Real}}` : Lower endpoint along each dimension -- `b::Union{Real, Vector{Real}}` : Upper endpoint along each dimension -- `kind::AbstractString("lege")` Specifies which type of integration to perform. Valid - values are: - - `"lege"` : Gauss-Legendre - - `"cheb"` : Gauss-Chebyshev - - `"trap"` : trapezoid rule - - `"simp"` : Simpson rule - - `"N"` : Neiderreiter equidistributed sequence - - `"W"` : Weyl equidistributed sequence - - `"H"` : Haber equidistributed sequence - - `"R"` : Monte Carlo - - `args...(Void)`: additional positional arguments to pass to `f` - - `;kwargs...(Void)`: additional keyword arguments to pass to `f` - -##### Returns - -- `out::Float64` : The scalar that approximates integral of `f` on the hypercube - formed by `[a, b]` +# Arguments + +- `f::Function`: The function to integrate over. This should be a function that accepts as its first argument a matrix representing points along each dimension (each dimension is a column). Other arguments that need to be passed to the function are caught by `args...` and `kwargs...`. +- `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. +- `a::Union{Real, Vector{Real}}`: Lower endpoint along each dimension. +- `b::Union{Real, Vector{Real}}`: Upper endpoint along each dimension. +- `kind::AbstractString("lege")`: Specifies which type of integration to perform. Valid values are: + - `"lege"`: Gauss-Legendre + - `"cheb"`: Gauss-Chebyshev + - `"trap"`: trapezoid rule + - `"simp"`: Simpson rule + - `"N"`: Neiderreiter equidistributed sequence + - `"W"`: Weyl equidistributed sequence + - `"H"`: Haber equidistributed sequence + - `"R"`: Monte Carlo +- `args...(Void)`: Additional positional arguments to pass to `f`. +- `;kwargs...(Void)`: Additional keyword arguments to pass to `f`. + +# Returns + +- `out::Float64`: The scalar that approximates integral of `f` on the hypercube formed by `[a, b]`. $(qnw_refs) """ From 8233d483753d58929225570a0c754385a70a3223 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Oct 2025 09:09:29 +0000 Subject: [PATCH 3/5] Fix docstring formatting to preserve linebreaks and add missing docstrings Co-authored-by: oyamad <7353083+oyamad@users.noreply.github.com> --- src/quad.jl | 70 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 15 deletions(-) diff --git a/src/quad.jl b/src/quad.jl index f02e6896..d74c72d3 100644 --- a/src/quad.jl +++ b/src/quad.jl @@ -137,7 +137,8 @@ Computes nodes and weights for multivariate normal distribution. - `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. - `mu::Union{Real, Vector{Real}}`: Mean along each dimension. -- `sig2::Union{Real, Vector{Real}, Matrix{Real}}(eye(length(n)))`: Covariance structure. +- `sig2::Union{Real, Vector{Real}, Matrix{Real}}(eye(length(n)))`: Covariance + structure. $(qnw_returns) @@ -298,8 +299,10 @@ Computes nodes and weights for beta distribution. # Arguments - `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. -- `a::Union{Real, Vector{Real}}`: First parameter of the beta distribution, along each dimension. -- `b::Union{Real, Vector{Real}}`: Second parameter of the beta distribution, along each dimension. +- `a::Union{Real, Vector{Real}}`: First parameter of the beta distribution, + along each dimension. +- `b::Union{Real, Vector{Real}}`: Second parameter of the beta distribution, + along each dimension. $(qnw_returns) @@ -407,8 +410,10 @@ Computes nodes and weights for gamma distribution. # Arguments - `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. -- `a::Union{Real, Vector{Real}}`: Shape parameter of the gamma distribution, along each dimension. Must be positive. Default is 1. -- `b::Union{Real, Vector{Real}}`: Scale parameter of the gamma distribution, along each dimension. Must be positive. Default is 1. +- `a::Union{Real, Vector{Real}}`: Shape parameter of the gamma distribution, + along each dimension. Must be positive. Default is 1. +- `b::Union{Real, Vector{Real}}`: Scale parameter of the gamma distribution, + along each dimension. Must be positive. Default is 1. $(qnw_returns) @@ -639,7 +644,8 @@ Computes quadrature nodes and weights for multivariate lognormal distribution. - `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. - `mu::Union{Real, Vector{Real}}`: Mean along each dimension. -- `sig2::Union{Real, Vector{Real}, Matrix{Real}}(eye(length(n)))`: Covariance structure. +- `sig2::Union{Real, Vector{Real}, Matrix{Real}}(eye(length(n)))`: Covariance + structure. $(qnw_returns) @@ -756,7 +762,8 @@ Approximate the integral of `f`, given quadrature `nodes` and `weights`. # Arguments -- `f::Function`: A callable function that is to be approximated over the domain spanned by `nodes`. +- `f::Function`: A callable function that is to be approximated over the domain + spanned by `nodes`. - `nodes::Array`: Quadrature nodes. - `weights::Array`: Quadrature weights. - `args...(Void)`: Additional positional arguments to pass to `f`. @@ -764,7 +771,8 @@ Approximate the integral of `f`, given quadrature `nodes` and `weights`. # Returns -- `out::Float64`: The scalar that approximates integral of `f` on the hypercube formed by `[a, b]`. +- `out::Float64`: The scalar that approximates integral of `f` on the hypercube + formed by `[a, b]`. """ function do_quad(f::Function, nodes::Array, weights::Vector, args...; kwargs...) @@ -780,11 +788,15 @@ for dimension i defined by `a[i]` and `b[i]`, respectively; using `n[i]` points. # Arguments -- `f::Function`: The function to integrate over. This should be a function that accepts as its first argument a matrix representing points along each dimension (each dimension is a column). Other arguments that need to be passed to the function are caught by `args...` and `kwargs...`. +- `f::Function`: The function to integrate over. This should be a function that + accepts as its first argument a matrix representing points along each dimension + (each dimension is a column). Other arguments that need to be passed to the + function are caught by `args...` and `kwargs...`. - `n::Union{Int, Vector{Int}}`: Number of desired nodes along each dimension. - `a::Union{Real, Vector{Real}}`: Lower endpoint along each dimension. - `b::Union{Real, Vector{Real}}`: Upper endpoint along each dimension. -- `kind::AbstractString("lege")`: Specifies which type of integration to perform. Valid values are: +- `kind::AbstractString("lege")`: Specifies which type of integration to perform. Valid + values are: - `"lege"`: Gauss-Legendre - `"cheb"`: Gauss-Chebyshev - `"trap"`: trapezoid rule @@ -798,7 +810,8 @@ for dimension i defined by `a[i]` and `b[i]`, respectively; using `n[i]` points. # Returns -- `out::Float64`: The scalar that approximates integral of `f` on the hypercube formed by `[a, b]`. +- `out::Float64`: The scalar that approximates integral of `f` on the hypercube + formed by `[a, b]`. $(qnw_refs) """ @@ -819,6 +832,21 @@ function quadrect(f::Function, n, a, b, kind = "lege", args...; kwargs...) end +""" + qnwmonomial1(vcv) + +Computes monomial integration nodes and weights for multivariate normal distribution +using a first-order monomial rule. + +# Arguments + +- `vcv::AbstractMatrix`: Variance-covariance matrix. + +# Returns + +- `nodes::Array{Float64}`: An array of quadrature nodes. +- `weights::Array{Float64}`: An array of corresponding quadrature weights. +""" function qnwmonomial1(vcv::AbstractMatrix) n = size(vcv, 1) @assert n == size(vcv, 2) "Variance covariance matrix must be square" @@ -841,6 +869,21 @@ function qnwmonomial1(vcv::AbstractMatrix) end +""" + qnwmonomial2(vcv) + +Computes monomial integration nodes and weights for multivariate normal distribution +using a second-order monomial rule. + +# Arguments + +- `vcv::AbstractMatrix`: Variance-covariance matrix. + +# Returns + +- `nodes::Array{Float64}`: An array of quadrature nodes. +- `weights::Array{Float64}`: An array of corresponding quadrature weights. +""" function qnwmonomial2(vcv::AbstractMatrix) n = size(vcv, 1) @assert n == size(vcv, 2) "Variance covariance matrix must be square" @@ -892,10 +935,7 @@ function _quadnodes(d::Distributions.ContinuousUnivariateDistribution, N::Int, end """ - qnwdist( - d::Distributions.ContinuousUnivariateDistribution, N::Int, - q0::Real=0.001, qN::Real=0.999, method::Union{T,Type{T}}=Quantile - ) where T + qnwdist(d, N; q0=0.001, qN=0.999, method=Quantile) Construct `N` quadrature weights and nodes for distribution `d` from the quantile `q0` to the quantile `qN`. `method` can be one of: From 6151781165783c42da47063c4bb97d9ace60a66e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Oct 2025 09:20:58 +0000 Subject: [PATCH 4/5] Update qnwdist docstring to follow style guide with Arguments and Returns sections Co-authored-by: oyamad <7353083+oyamad@users.noreply.github.com> --- src/quad.jl | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/quad.jl b/src/quad.jl index d74c72d3..2a4aa1b1 100644 --- a/src/quad.jl +++ b/src/quad.jl @@ -938,10 +938,25 @@ end qnwdist(d, N; q0=0.001, qN=0.999, method=Quantile) Construct `N` quadrature weights and nodes for distribution `d` from the -quantile `q0` to the quantile `qN`. `method` can be one of: +quantile `q0` to the quantile `qN`. -- `Even`: nodes will be evenly spaced between the quantiles -- `Quantile`: nodes will be placed at evenly spaced quantile values +# Arguments + +- `d::Distributions.ContinuousUnivariateDistribution`: The distribution for which + to construct quadrature nodes and weights. +- `N::Int`: Number of desired quadrature nodes. +- `q0::Real(0.001)`: Lower quantile bound. +- `qN::Real(0.999)`: Upper quantile bound. +- `method::Union{T,Type{T}}(Quantile)`: Method for node placement. Can be one of: + - `Even`: nodes will be evenly spaced between the quantiles. + - `Quantile`: nodes will be placed at evenly spaced quantile values. + +# Returns + +- `nodes::Vector{Float64}`: Quadrature nodes. +- `weights::Vector{Float64}`: Quadrature weights. + +# Notes To construct the weights, consider splitting the nodes into cells centered at each node. Specifically, let notation `z_i` mean the `i`th node and let From c557550221049a0276548c1734e06e1902875c6d Mon Sep 17 00:00:00 2001 From: Daisuke Oyama Date: Sat, 4 Oct 2025 22:07:41 +0900 Subject: [PATCH 5/5] DOC: Use `$(qnw_returns)` in quad.jl --- src/quad.jl | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/quad.jl b/src/quad.jl index 2a4aa1b1..16b5bff1 100644 --- a/src/quad.jl +++ b/src/quad.jl @@ -842,10 +842,7 @@ using a first-order monomial rule. - `vcv::AbstractMatrix`: Variance-covariance matrix. -# Returns - -- `nodes::Array{Float64}`: An array of quadrature nodes. -- `weights::Array{Float64}`: An array of corresponding quadrature weights. +$(qnw_returns) """ function qnwmonomial1(vcv::AbstractMatrix) n = size(vcv, 1) @@ -879,10 +876,7 @@ using a second-order monomial rule. - `vcv::AbstractMatrix`: Variance-covariance matrix. -# Returns - -- `nodes::Array{Float64}`: An array of quadrature nodes. -- `weights::Array{Float64}`: An array of corresponding quadrature weights. +$(qnw_returns) """ function qnwmonomial2(vcv::AbstractMatrix) n = size(vcv, 1) @@ -951,10 +945,7 @@ quantile `q0` to the quantile `qN`. - `Even`: nodes will be evenly spaced between the quantiles. - `Quantile`: nodes will be placed at evenly spaced quantile values. -# Returns - -- `nodes::Vector{Float64}`: Quadrature nodes. -- `weights::Vector{Float64}`: Quadrature weights. +$(qnw_returns) # Notes