Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F10881020
AbsCopulaSmootherBase.icc
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
AbsCopulaSmootherBase.icc
View Options
#include <stdexcept>
#include "npstat/stat/empiricalCopulaHisto.hh"
#include "npstat/stat/weightedCopulaHisto.hh"
namespace npstat{
template <class Point>
inline const HistoND<double>& AbsCopulaSmootherBase::smooth(
const unsigned long uniqueId,
std::vector<OrderedPointND<Point> >& in,
double* bandwidthUsed)
{
HistoND<double>& h = this->clearHisto();
double bw = 0.0;
if (!in.empty())
{
empiricalCopulaHisto(in, &h);
this->storeHisto(uniqueId, bw);
const double n = h.nFillsInRange();
this->smoothHisto(h, n, &bw, false);
assert(bw > 0.0);
this->makeMarginalsUniform();
this->storeHisto(uniqueId, bw);
}
if (bandwidthUsed)
*bandwidthUsed = bw;
return h;
}
template <class Point>
inline const HistoND<double>& AbsCopulaSmootherBase::weightedSmooth(
const unsigned long uniqueId,
const std::vector<std::pair<const Point*, double> >& in,
const unsigned* dimsToUse, const unsigned nDimsToUse,
double* bandwidthUsed)
{
HistoND<double>& h = this->clearHisto();
double bw = 0.0;
if (!in.empty())
{
const double n = weightedCopulaHisto(in, dimsToUse, nDimsToUse, &h);
this->storeHisto(uniqueId, bw);
this->smoothHisto(h, n, &bw, true);
assert(bw > 0.0);
this->makeMarginalsUniform();
this->storeHisto(uniqueId, bw);
}
if (bandwidthUsed)
*bandwidthUsed = bw;
return h;
}
#ifdef SWIG
template <class Point>
inline void AbsCopulaSmootherBase::weightedSmooth_2(
const unsigned long uniqueId,
const std::vector<Point>& data,
const std::vector<double>& weights,
const unsigned* dimsToUse, const unsigned nDimsToUse,
double* bandwidthUsed)
{
assert(bandwidthUsed);
HistoND<double>& h = this->clearHisto();
double bw = 0.0;
if (data.size() != weights.size()) throw std::invalid_argument(
"In npstat::AbsCopulaSmootherBase::weightedSmooth_2: incompatible inputs");
if (!data.empty())
{
const double n = weightedCopulaHisto_2(data, weights, dimsToUse, nDimsToUse, &h);
this->storeHisto(uniqueId, bw);
this->smoothHisto(h, n, &bw, true);
assert(bw > 0.0);
this->makeMarginalsUniform();
this->storeHisto(uniqueId, bw);
}
*bandwidthUsed = bw;
}
#endif // SWIG
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, May 3, 5:45 AM (5 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4982812
Default Alt Text
AbsCopulaSmootherBase.icc (2 KB)
Attached To
rNPSTATSVN npstatsvn
Event Timeline
Log In to Comment