本文整理汇总了C++中Observations::GetNumberOfSubjects方法的典型用法代码示例。如果您正苦于以下问题:C++ Observations::GetNumberOfSubjects方法的具体用法?C++ Observations::GetNumberOfSubjects怎么用?C++ Observations::GetNumberOfSubjects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Observations
的用法示例。
在下文中一共展示了Observations::GetNumberOfSubjects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
MultivariateModel
::Initialize(const Observations& Obs)
{
/// The function initialize different attributes of the model
/// As well as the specific random variables and their realizations used by the model
// TODO : Pitfall : How to have a smart initialization, that may come out of a .txt / .csv file
// TODO : instead of using the same initialization or modifiying it in the code
// TODO : Some cases may fall in between the two cases (default values needed)
/// Data-related attributes
m_ManifoldDimension = Obs.GetSubjectObservations(0).GetCognitiveScore(0).size();
m_NumberOfSubjects = Obs.GetNumberOfSubjects();
m_IndividualObservationDate = Obs.GetObservations();
m_SubjectTimePoints = Obs.GetObservations();
m_NbTotalOfObservations = Obs.GetTotalNumberOfObservations();
m_SumObservations = Obs.GetTotalSumOfCognitiveScores();
/// Initialize the size of some parameters
m_Deltas.set_size(m_ManifoldDimension);
m_Block.set_size(m_ManifoldDimension);
/// Population variables
/// (Initialization of the random variable m_Random Variable
/// and the associated number of realizations m_RealizationPerRandomVariable)
m_Noise = std::make_shared<GaussianRandomVariable>(0.0, 0.00001);
m_RandomVariables.AddRandomVariable("G", "Gaussian", {0.12, 0.0001 * 0.0001});
m_RealizationsPerRandomVariable["G"] = 1;
for(size_t i = 1; i < m_ManifoldDimension; ++i)
{
std::string NameDelta = "Delta#" + std::to_string(i);
m_RandomVariables.AddRandomVariable(NameDelta, "Gaussian", {0, 0.003 * 0.003});
m_RealizationsPerRandomVariable[NameDelta] = 1;
}
for(int i = 0; i < m_NbIndependentSources*(m_ManifoldDimension - 1); ++i)
{
std::string Name = "Beta#" + std::to_string(i);
m_RandomVariables.AddRandomVariable(Name, "Gaussian", {0, 0.001*0.001});
m_RealizationsPerRandomVariable[Name] = 1;
}
/// Individual realizations
/// (Initialization of the random variable m_Random Variable
/// and the associated number of realizations m_RealizationPerRandomVariable)
m_RandomVariables.AddRandomVariable("Ksi", "Gaussian", {0.13, 0.0004});
m_RealizationsPerRandomVariable["Ksi"] = m_NumberOfSubjects;
m_RandomVariables.AddRandomVariable("Tau", "Gaussian", {75, 0.025});
m_RealizationsPerRandomVariable["Tau"] = m_NumberOfSubjects;
for(int i = 0; i < m_NbIndependentSources; ++i)
{
std::string Name = "S#" + std::to_string(i);
m_RandomVariables.AddRandomVariable(Name, "Gaussian", {0.0, 1});
m_RealizationsPerRandomVariable[Name] = m_NumberOfSubjects;
}
}