[Rsiena-commits] r44 - pkg/RSiena/src/model/effects
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jan 18 20:47:47 CET 2010
Author: ripleyrm
Date: 2010-01-18 20:47:47 +0100 (Mon, 18 Jan 2010)
New Revision: 44
Removed:
pkg/RSiena/src/model/effects/AverageSimilarityEffect.cpp
pkg/RSiena/src/model/effects/AverageSimilarityEffect.h
pkg/RSiena/src/model/effects/BehaviorDependentBehaviorEffect.cpp
pkg/RSiena/src/model/effects/BehaviorDependentBehaviorEffect.h
pkg/RSiena/src/model/effects/BehaviorMainBehaviorEffect.cpp
pkg/RSiena/src/model/effects/BehaviorMainBehaviorEffect.h
pkg/RSiena/src/model/effects/ChangingCovariateBehaviorEffect.cpp
pkg/RSiena/src/model/effects/ChangingCovariateBehaviorEffect.h
pkg/RSiena/src/model/effects/ChangingCovariateMainBehaviorEffect.cpp
pkg/RSiena/src/model/effects/ChangingCovariateMainBehaviorEffect.h
pkg/RSiena/src/model/effects/ConstantCovariateBehaviorEffect.cpp
pkg/RSiena/src/model/effects/ConstantCovariateBehaviorEffect.h
pkg/RSiena/src/model/effects/ConstantCovariateMainBehaviorEffect.cpp
pkg/RSiena/src/model/effects/ConstantCovariateMainBehaviorEffect.h
pkg/RSiena/src/model/effects/TotalSimilarityEffect.cpp
pkg/RSiena/src/model/effects/TotalSimilarityEffect.h
Log:
Remove unnecessary files
Deleted: pkg/RSiena/src/model/effects/AverageSimilarityEffect.cpp
===================================================================
--- pkg/RSiena/src/model/effects/AverageSimilarityEffect.cpp 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/AverageSimilarityEffect.cpp 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,182 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: AverageSimilarityEffect.cpp
- *
- * Description: This file contains the implementation of the
- * AverageSimilarityEffect class.
- *****************************************************************************/
-
-#include <cmath>
-#include "AverageSimilarityEffect.h"
-#include "network/Network.h"
-#include "network/IncidentTieIterator.h"
-
-#include "model/variables/NetworkVariable.h"
-#include "model/variables/BehaviorVariable.h"
-#include <R.h>
-namespace siena
-{
-
-/**
- * Constructor.
- */
-AverageSimilarityEffect::AverageSimilarityEffect(
- const EffectInfo * pEffectInfo) :
- NetworkDependentBehaviorEffect(pEffectInfo)
-{
-}
-
-
-/**
- * Calculates the change in the statistic corresponding to this effect if
- * the given actor would change his behavior by the given amount.
- */
-double AverageSimilarityEffect::calculateChangeContribution(int actor,
- int difference) const
-{
- double contribution = 0;
- const Network * pNetwork = this->pNetwork();
-
- if (pNetwork->outDegree(actor) > 0)
- {
- // The formula for the effect:
- // s_i(x) = avg(sim(v_i, v_j) - centeringConstant) over all neighbors
- // j of i.
- // sim(v_i, v_j) = 1.0 - |v_i - v_j| / observedRange
- // We need to calculate the change delta in s_i(x), if we changed
- // v_i to v_i + d (d being the given amount of change in v_i).
- // To this end, we can disregard the centering constant and
- // compute the average change in similarity, namely,
- // avg(sim(v_i + d, v_j) - sim(v_i, v_j)) =
- // avg(1 - |v_i+d-v_j|/range - 1 + |v_i-v_j|/range) =
- // avg(|v_i-v_j| - |v_i+d-v_j|) / range,
- // the average being taken over all neighbors of i. This is what
- // is calculated below.
-
- int oldValue = this->value(actor);
- int newValue = oldValue + difference;
- int totalSimilarityChange = 0;
-
- for (IncidentTieIterator iter = pNetwork->outTies(actor);
- iter.valid();
- iter.next())
- {
- int alterValue = this->value(iter.actor());
- totalSimilarityChange +=
- abs(oldValue - alterValue) - abs(newValue - alterValue);
- }
-
- contribution = ((double) totalSimilarityChange) /
- this->range() /
- pNetwork->outDegree(actor);
- }
-
- return contribution;
-}
-
-/**
- * Returns the statistic corresponding to this effect as part of
- * the evaluation function with respect to the given behavior variable.
- */
-double AverageSimilarityEffect::evaluationStatistic(double * currentValues) const
-{
- double statistic = 0;
- int n = this->n();
- const Network * pNetwork = this->pNetwork();
-
- double similarityMean = this->similarityMean();
-
- for (int i = 0; i < n; i++)
- {
- if (pNetwork->outDegree(i))
- {
- double thisStatistic = 0;
-
- for (IncidentTieIterator iter = pNetwork->outTies(i);
- iter.valid();
- iter.next())
- {
- double alterValue = currentValues[iter.actor()];
- double range = this->range();
- thisStatistic += iter.value() *
- (1.0 - fabs(alterValue - currentValues[i]) / range);
- thisStatistic -= similarityMean;
- }
-
- thisStatistic /= pNetwork->outDegree(i);
- statistic += thisStatistic;
- }
- }
-
- return statistic;
-}
-
-
-/**
- * Returns the statistic corresponding to this effect as part of
- * the endowment function with respect to the initial values of a
- * behavior variable and the current values.
- */
-double AverageSimilarityEffect::endowmentStatistic(const int * difference,
- double * currentValues) const
-{
- double statistic = 0;
- int n = this->n();
- const Network * pNetwork = this->pNetwork();
-
- double similarityMean = this->similarityMean();
-
- for (int i = 0; i < n; i++)
- {
- if (difference[i] > 0)
- {
- if (pNetwork->outDegree(i))
- {
- double thisStatistic = 0;
-
- for (IncidentTieIterator iter = pNetwork->outTies(i);
- iter.valid();
- iter.next())
- {
- double alterValue = currentValues[iter.actor()];
- double range = this->range();
- thisStatistic += iter.value() *
- (1.0 - fabs(alterValue - currentValues[i]) / range);
- thisStatistic -= similarityMean;
- }
-
- thisStatistic /= pNetwork->outDegree(i);
- statistic += 2 * thisStatistic;
-
- // do the same using the difference in i's value
- // rather than current state and subtract it.
- // not sure whether this is correct.
-
- thisStatistic = 0;
-
- for (IncidentTieIterator iter = pNetwork->outTies(i);
- iter.valid();
- iter.next())
- {
- double alterValue = currentValues[iter.actor()];
- double range = this->range();
- thisStatistic += iter.value() *
- (1.0 - fabs(alterValue - (difference[i] +
- currentValues[i]))
- / range);
- thisStatistic -= similarityMean;
- }
-
- thisStatistic /= pNetwork->outDegree(i);
- statistic -= thisStatistic;
- }
- }
- }
-
- return statistic;
-}
-
-}
Deleted: pkg/RSiena/src/model/effects/AverageSimilarityEffect.h
===================================================================
--- pkg/RSiena/src/model/effects/AverageSimilarityEffect.h 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/AverageSimilarityEffect.h 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,38 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: AverageSimilarityEffect.h
- *
- * Description: This file contains the definition of the
- * AverageSimilarityEffect class.
- *****************************************************************************/
-
-#ifndef AVERAGESIMILARITYEFFECT_H_
-#define AVERAGESIMILARITYEFFECT_H_
-
-#include "NetworkDependentBehaviorEffect.h"
-
-namespace siena
-{
-
-/**
- * Average similarity effect defined as the average centered similarity
- * of the ego with each of its neighbors (with respect to a certain network).
- */
-class AverageSimilarityEffect : public NetworkDependentBehaviorEffect
-{
-public:
- AverageSimilarityEffect(const EffectInfo * pEffectInfo);
-
- virtual double calculateChangeContribution(int actor,
- int difference) const;
- virtual double evaluationStatistic(double * currentValues) const;
- virtual double endowmentStatistic(const int * difference,
- double * currentValues) const;
-};
-
-}
-
-#endif /*AVERAGESIMILARITYEFFECT_H_*/
Deleted: pkg/RSiena/src/model/effects/BehaviorDependentBehaviorEffect.cpp
===================================================================
--- pkg/RSiena/src/model/effects/BehaviorDependentBehaviorEffect.cpp 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/BehaviorDependentBehaviorEffect.cpp 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,72 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: BehaviorDependentBehaviorEffect.cpp
- *
- * Description: This file contains the implementation of the
- * BehaviorDependentBehaviorEffect class.
- *****************************************************************************/
-
-#include <stdexcept>
-
-#include "BehaviorDependentBehaviorEffect.h"
-#include "data/BehaviorLongitudinalData.h"
-#include "model/EpochSimulation.h"
-#include "model/EffectInfo.h"
-#include "model/variables/BehaviorVariable.h"
-#include "model/State.h"
-
-namespace siena
-{
-
-/**
- * Constructor.
- * @param[in] pEffectInfo the descriptor object of the effect
- */
-BehaviorDependentBehaviorEffect::BehaviorDependentBehaviorEffect(
- const EffectInfo * pEffectInfo) : BehaviorEffect(pEffectInfo)
-{
- this->linteractionValues = 0;
- this->lpInteractionBehaviorData = 0;
-}
-
-
-/**
- * Initializes this effect.
- * @param[in] pData the observed data
- * @param[in] pState the current state of the dependent variables
- * @param[in] period the period of interest
- * @param[in] pCache the cache object to be used to speed up calculations
- */
-void BehaviorDependentBehaviorEffect::initialize(const Data * pData,
- State * pState,
- int period,
- Cache * pCache)
-{
- BehaviorEffect::initialize(pData, pState, period, pCache);
- string name = this->pEffectInfo()->interactionName1();
-
- this->linteractionValues = pState->behaviorValues(name);
- this->lpInteractionBehaviorData = pData->pBehaviorData(name);
-
- if (!this->linteractionValues || !this->lpInteractionBehaviorData)
- {
- throw logic_error("Behavior variable '" + name + "' expected.");
- }
-}
-
-
-/**
- * Returns the interaction value of the given actor
- * centered around the overall mean of all observed values.
- */
-double BehaviorDependentBehaviorEffect::centeredInteractionValue(int actor)
- const
-{
- return this->linteractionValues[actor] -
- this->lpInteractionBehaviorData->overallMean();
-}
-
-}
Deleted: pkg/RSiena/src/model/effects/BehaviorDependentBehaviorEffect.h
===================================================================
--- pkg/RSiena/src/model/effects/BehaviorDependentBehaviorEffect.h 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/BehaviorDependentBehaviorEffect.h 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,74 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: BehaviorDependentBehaviorEffect.h
- *
- * Description: This file contains the definition of the
- * BehaviorVariableBehaviorEffect class.
- *****************************************************************************/
-
-#ifndef BEHAVIORDEPENDENTBEHAVIOREFFECT_H_
-#define BEHAVIORDEPENDENTBEHAVIOREFFECT_H_
-
-#include "BehaviorEffect.h"
-
-namespace siena
-{
-
-// ----------------------------------------------------------------------------
-// Section: Forward declarations
-// ----------------------------------------------------------------------------
-
-class BehaviorVariable;
-
-
-// ----------------------------------------------------------------------------
-// Section: BehaviorDependentBehaviorEffect class
-// ----------------------------------------------------------------------------
-
-/**
- * The base class for all behavior effects depending on some other behavior
- * variable.
- */
-class BehaviorDependentBehaviorEffect : public BehaviorEffect
-{
-public:
- BehaviorDependentBehaviorEffect(const EffectInfo * pEffectInfo);
-
- virtual void initialize(const Data * pData,
- State * pState,
- int period,
- Cache * pCache);
-
-protected:
- inline int interactionValue(int actor) const;
- double centeredInteractionValue(int actor) const;
-
-private:
- // The values of the behavior variable this effect is interacting with
- const int * linteractionValues;
-
- // The observed data for the behavior variable this effect is
- // interacting with
-
- BehaviorLongitudinalData * lpInteractionBehaviorData;
-};
-
-
-// ----------------------------------------------------------------------------
-// Section: Inline methods
-// ----------------------------------------------------------------------------
-
-/**
- * Returns the value of the behavior variable this effect is interacting with.
- */
-int BehaviorDependentBehaviorEffect::interactionValue(int actor) const
-{
- return this->linteractionValues[actor];
-}
-
-}
-
-#endif /*BEHAVIORDEPENDENTBEHAVIOREFFECT_H_*/
Deleted: pkg/RSiena/src/model/effects/BehaviorMainBehaviorEffect.cpp
===================================================================
--- pkg/RSiena/src/model/effects/BehaviorMainBehaviorEffect.cpp 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/BehaviorMainBehaviorEffect.cpp 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,86 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: BehaviorMainBehaviorEffect.cpp
- *
- * Description: This file contains the implementation of the
- * BehaviorMainBehaviorEffect class.
- *****************************************************************************/
-
-#include <cmath>
-
-#include "BehaviorMainBehaviorEffect.h"
-#include "model/variables/BehaviorVariable.h"
-#include <R.h>
-namespace siena
-{
-
-/**
- * Constructor.
- */
-BehaviorMainBehaviorEffect::BehaviorMainBehaviorEffect(
- const EffectInfo * pEffectInfo) :
- BehaviorDependentBehaviorEffect(pEffectInfo)
-{
-}
-
-
-/**
- * Calculates the change in the statistic corresponding to this effect if
- * the given actor would change his behavior by the given amount.
- */
-double BehaviorMainBehaviorEffect::calculateChangeContribution(int actor,
- int difference) const
-{
- // The formula for the effect:
- // s_i(x) = v_i * c_i
- // We need to calculate the change delta in s_i(x), if we changed
- // v_i to v_i + d (d being the given amount of change in v_i).
- // This is d * c_i.
-
- return difference * this->centeredInteractionValue(actor);
-}
-
-/**
- * Returns the statistic corresponding to this effect as part of
- * the evaluation function with respect to the given behavior variable.
- */
-double BehaviorMainBehaviorEffect::evaluationStatistic(double * currentValues) const
-{
- double statistic = 0;
- int n = this->n();
-
- for (int i = 0; i < n; i++)
- {
- statistic += currentValues[i] * this->centeredInteractionValue(i);
- }
-
- return statistic;
-}
-
-
-/**
- * Returns the statistic corresponding to this effect as part of
- * the endowment function with respect to the initial values of a
- * behavior variable and the current values.
- */
-double BehaviorMainBehaviorEffect::endowmentStatistic(const int * difference,
- double * currentValues) const
-{
- double statistic = 0;
- int n = this->n();
-
- for (int i = 0; i < n; i++)
- {
- if (difference[i] > 0)
- {
- statistic += currentValues[i] * this->centeredInteractionValue(i);
- }
- }
-
- return statistic;
-}
-
-}
Deleted: pkg/RSiena/src/model/effects/BehaviorMainBehaviorEffect.h
===================================================================
--- pkg/RSiena/src/model/effects/BehaviorMainBehaviorEffect.h 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/BehaviorMainBehaviorEffect.h 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,38 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: BehaviorMainBehaviorEffect.h
- *
- * Description: This file contains the definition of the
- * BehaviorMainBehaviorEffect class.
- *****************************************************************************/
-
-#ifndef BEHAVIORMAINBEHAVIOREFFECT_H_
-#define BEHAVIORMAINBEHAVIOREFFECT_H_
-
-#include "BehaviorDependentBehaviorEffect.h"
-
-namespace siena
-{
-
-/**
- * Behavior variable main behavior effect defined as the product of the ego
- * with the covariate.
- */
-class BehaviorMainBehaviorEffect : public BehaviorDependentBehaviorEffect
-{
-public:
- BehaviorMainBehaviorEffect(const EffectInfo * pEffectInfo);
-
- virtual double calculateChangeContribution(int actor,
- int difference) const;
- virtual double evaluationStatistic(double * currentValues) const;
- virtual double endowmentStatistic(const int * difference,
- double * currentValues) const;
-};
-
-}
-
-#endif /*BEHAVIORMAINBEHAVIOREFFECT_H_*/
Deleted: pkg/RSiena/src/model/effects/ChangingCovariateBehaviorEffect.cpp
===================================================================
--- pkg/RSiena/src/model/effects/ChangingCovariateBehaviorEffect.cpp 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/ChangingCovariateBehaviorEffect.cpp 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,56 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: ChangingCovariateBehaviorEffect.cpp
- *
- * Description: This file contains the implementation of the
- * ChangingCovariateBehaviorEffect class.
- *****************************************************************************/
-
-#include <stdexcept>
-
-#include "data/ChangingCovariate.h"
-#include "ChangingCovariateBehaviorEffect.h"
-#include "model/EpochSimulation.h"
-#include "model/EffectInfo.h"
-
-namespace siena
-{
-
-/**
- * Constructor.
- * @param[in] pEffectInfo the descriptor object of the effect
- */
-ChangingCovariateBehaviorEffect::ChangingCovariateBehaviorEffect(
- const EffectInfo * pEffectInfo) : BehaviorEffect(pEffectInfo)
-{
- this->lpCovariate = 0;
-}
-
-
-/**
- * Initializes this effect.
- * @param[in] pData the observed data
- * @param[in] pState the current state of the dependent variables
- * @param[in] period the period of interest
- * @param[in] pCache the cache object to be used to speed up calculations
- */
-void ChangingCovariateBehaviorEffect::initialize(const Data * pData,
- State * pState,
- int period,
- Cache * pCache)
-{
- BehaviorEffect::initialize(pData, pState, period, pCache);
- string name = this->pEffectInfo()->interactionName1();
-
- this->lpCovariate = pData->pChangingCovariate(name);
-
- if (!this->lpCovariate)
- {
- throw logic_error("Changing covariate '" + name + "' expected.");
- }
-}
-
-}
Deleted: pkg/RSiena/src/model/effects/ChangingCovariateBehaviorEffect.h
===================================================================
--- pkg/RSiena/src/model/effects/ChangingCovariateBehaviorEffect.h 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/ChangingCovariateBehaviorEffect.h 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,67 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: ChangingCovariateBehaviorEffect.h
- *
- * Description: This file contains the definition of the
- * ChangingCovariateBehaviorEffect class.
- *****************************************************************************/
-
-#ifndef CHANGINGCOVARIATEBEHAVIOREFFECT_H_
-#define CHANGINGCOVARIATEBEHAVIOREFFECT_H_
-
-#include "BehaviorEffect.h"
-
-namespace siena
-{
-
-// ----------------------------------------------------------------------------
-// Section: Forward declarations
-// ----------------------------------------------------------------------------
-
-class ChangingCovariate;
-
-
-// ----------------------------------------------------------------------------
-// Section: ChangingCovariateBehaviorEffect class
-// ----------------------------------------------------------------------------
-
-/**
- * The base class for all behavior effects depending on some changing covariate.
- */
-class ChangingCovariateBehaviorEffect : public BehaviorEffect
-{
-public:
- ChangingCovariateBehaviorEffect(const EffectInfo * pEffectInfo);
-
- virtual void initialize(const Data * pData,
- State * pState,
- int period,
- Cache * pCache);
-
-protected:
- inline const ChangingCovariate * pCovariate() const;
-
-private:
- // The covariate this effect is interacting with
- const ChangingCovariate * lpCovariate;
-};
-
-
-// ----------------------------------------------------------------------------
-// Section: Inline methods
-// ----------------------------------------------------------------------------
-
-/**
- * Returns the covariate this effect is interacting with.
- */
-const ChangingCovariate * ChangingCovariateBehaviorEffect::pCovariate() const
-{
- return this->lpCovariate;
-}
-
-}
-
-#endif /*CHANGINGCOVARIATEBEHAVIOREFFECT_H_*/
Deleted: pkg/RSiena/src/model/effects/ChangingCovariateMainBehaviorEffect.cpp
===================================================================
--- pkg/RSiena/src/model/effects/ChangingCovariateMainBehaviorEffect.cpp 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/ChangingCovariateMainBehaviorEffect.cpp 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,93 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: ChangingCovariateMainBehaviorEffect.cpp
- *
- * Description: This file contains the implementation of the
- * ChangingCovariateMainBehaviorEffect class.
- *****************************************************************************/
-
-#include <cmath>
-
-#include "ChangingCovariateMainBehaviorEffect.h"
-#include "data/ChangingCovariate.h"
-#include "model/variables/BehaviorVariable.h"
-#include <R.h>
-namespace siena
-{
-
-/**
- * Constructor.
- */
-ChangingCovariateMainBehaviorEffect::ChangingCovariateMainBehaviorEffect(
- const EffectInfo * pEffectInfo) :
- ChangingCovariateBehaviorEffect(pEffectInfo)
-{
-}
-
-
-/**
- * Calculates the change in the statistic corresponding to this effect if
- * the given actor would change his behavior by the given amount.
- */
-double ChangingCovariateMainBehaviorEffect::calculateChangeContribution(int
- actor, int difference) const
-{
- // The formula for the effect:
- // s_i(x) = v_i * c_i
- // We need to calculate the change delta in s_i(x), if we changed
- // v_i to v_i + d (d being the given amount of change in v_i).
- // This is d * c_i.
-
- return difference * this->pCovariate()->value(actor, this->period());
-}
-
-
-/**
- * Returns the statistic corresponding to this effect as part of
- * the evaluation function with respect to the given behavior variable.
- */
-double ChangingCovariateMainBehaviorEffect::evaluationStatistic(double * currentValues) const
-{
- double statistic = 0;
- int n = this->n();
-
- const ChangingCovariate * pCovariate = this->pCovariate();
-
- for (int i = 0; i < n; i++)
- {
- statistic += currentValues[i] * pCovariate->value(i, this->period());
- }
-
- return statistic;
-}
-
-
-/**
- * Returns the statistic corresponding to this effect as part of
- * the endowment function with respect to the initial values of a
- * behavior variable and the current values.
- */
-double ChangingCovariateMainBehaviorEffect::endowmentStatistic(const int * difference,
- double * currentValues) const
-{
- double statistic = 0;
- int n = this->n();
-
- const ChangingCovariate * pCovariate = this->pCovariate();
-
- for (int i = 0; i < n; i++)
- {
- if (difference[i] > 0)
- {
- statistic +=
- currentValues[i] * pCovariate->value(i, this->period());
- }
- }
-
- return statistic;
-}
-
-}
Deleted: pkg/RSiena/src/model/effects/ChangingCovariateMainBehaviorEffect.h
===================================================================
--- pkg/RSiena/src/model/effects/ChangingCovariateMainBehaviorEffect.h 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/ChangingCovariateMainBehaviorEffect.h 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,38 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: ChangingCovariateMainBehaviorEffect.h
- *
- * Description: This file contains the definition of the
- * ChangingCovariateMainBehaviorEffect class.
- *****************************************************************************/
-
-#ifndef CHANGINGCOVARIATEMAINBEHAVIOREFFECT_H_
-#define CHANGINGCOVARIATEMAINBEHAVIOREFFECT_H_
-
-#include "ChangingCovariateBehaviorEffect.h"
-
-namespace siena
-{
-
-/**
- * Changing covariate main behavior effect defined as the product of the ego
- * with the covariate.
- */
- class ChangingCovariateMainBehaviorEffect : public ChangingCovariateBehaviorEffect
-{
-public:
- ChangingCovariateMainBehaviorEffect(const EffectInfo * pEffectInfo);
-
- virtual double calculateChangeContribution(int actor,
- int difference) const;
- virtual double evaluationStatistic(double * currentValues) const;
- virtual double endowmentStatistic(const int * difference,
- double * currentValues) const;
-};
-
-}
-
-#endif /*CHANGINGCOVARIATEMAINBEHAVIOREFFECT_H_*/
Deleted: pkg/RSiena/src/model/effects/ConstantCovariateBehaviorEffect.cpp
===================================================================
--- pkg/RSiena/src/model/effects/ConstantCovariateBehaviorEffect.cpp 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/ConstantCovariateBehaviorEffect.cpp 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,63 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: ConstantCovariateBehaviorEffect.cpp
- *
- * Description: This file contains the implementation of the
- * ConstantCovariateBehaviorEffect class.
- *****************************************************************************/
-
-#include <stdexcept>
-
-#include "data/ConstantCovariate.h"
-#include "ConstantCovariateBehaviorEffect.h"
-#include "model/EpochSimulation.h"
-#include "model/EffectInfo.h"
-
-namespace siena
-{
-
-/**
- * Constructor.
- * @param[in] pEffectInfo the descriptor object of the effect
- */
-ConstantCovariateBehaviorEffect::ConstantCovariateBehaviorEffect(
- const EffectInfo * pEffectInfo) : BehaviorEffect(pEffectInfo)
-{
-}
-
-
-/**
- * Destructor.
- */
-ConstantCovariateBehaviorEffect::~ConstantCovariateBehaviorEffect()
-{
-}
-
-
-/**
- * Initializes this effect.
- * @param[in] pData the observed data
- * @param[in] pState the current state of the dependent variables
- * @param[in] period the period of interest
- * @param[in] pCache the cache object to be used to speed up calculations
- */
-void ConstantCovariateBehaviorEffect::initialize(const Data * pData,
- State * pState,
- int period,
- Cache * pCache)
-{
- BehaviorEffect::initialize(pData, pState, period, pCache);
- string name = this->pEffectInfo()->interactionName1();
-
- this->lpCovariate = pData->pConstantCovariate(name);
-
- if (!this->lpCovariate)
- {
- throw logic_error("Constant covariate '" + name + "' expected.");
- }
-}
-
-}
Deleted: pkg/RSiena/src/model/effects/ConstantCovariateBehaviorEffect.h
===================================================================
--- pkg/RSiena/src/model/effects/ConstantCovariateBehaviorEffect.h 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/ConstantCovariateBehaviorEffect.h 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,69 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: ConstantCovariateBehaviorEffect.h
- *
- * Description: This file contains the definition of the
- * ConstantCovariateBehaviorEffect class.
- *****************************************************************************/
-
-#ifndef CONSTANTCOVARIATEBEHAVIOREFFECT_H_
-#define CONSTANTCOVARIATEBEHAVIOREFFECT_H_
-
-#include "BehaviorEffect.h"
-
-namespace siena
-{
-
-// ----------------------------------------------------------------------------
-// Section: Forward declarations
-// ----------------------------------------------------------------------------
-
-class ConstantCovariate;
-
-
-// ----------------------------------------------------------------------------
-// Section: ConstantCovariateBehaviorEffect class
-// ----------------------------------------------------------------------------
-
-/**
- * The base class for all behavior effects depending on some covariate.
- */
-class ConstantCovariateBehaviorEffect : public BehaviorEffect
-{
-public:
- ConstantCovariateBehaviorEffect(const EffectInfo * pEffectInfo);
- virtual ~ConstantCovariateBehaviorEffect();
-
- virtual void initialize(const Data * pData,
- State * pState,
- int period,
- Cache * pCache);
-
-protected:
- inline const ConstantCovariate * pCovariate() const;
-
-private:
- // The covariate this effect is interacting with
- const ConstantCovariate * lpCovariate;
-};
-
-
-// ----------------------------------------------------------------------------
-// Section: Inline methods
-// ----------------------------------------------------------------------------
-
-/**
- * Returns the covariate this effect is interacting with.
- */
-const ConstantCovariate * ConstantCovariateBehaviorEffect::pCovariate()
- const
-{
- return this->lpCovariate;
-}
-
-}
-
-#endif /*CONSTANTCOVARIATEBEHAVIOREFFECT_H_*/
Deleted: pkg/RSiena/src/model/effects/ConstantCovariateMainBehaviorEffect.cpp
===================================================================
--- pkg/RSiena/src/model/effects/ConstantCovariateMainBehaviorEffect.cpp 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/ConstantCovariateMainBehaviorEffect.cpp 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,91 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: ConstantCovariateMainBehaviorEffect.cpp
- *
- * Description: This file contains the implementation of the
- * ConstantCovariateMainBehaviorEffect class.
- *****************************************************************************/
-
-#include <cmath>
-
-#include "ConstantCovariateMainBehaviorEffect.h"
-#include "data/ConstantCovariate.h"
-#include "model/variables/BehaviorVariable.h"
-#include <R.h>
-namespace siena
-{
-
-/**
- * Constructor.
- */
-ConstantCovariateMainBehaviorEffect::ConstantCovariateMainBehaviorEffect(
- const EffectInfo * pEffectInfo) :
- ConstantCovariateBehaviorEffect(pEffectInfo)
-{
-}
-
-
-/**
- * Calculates the change in the statistic corresponding to this effect if
- * the given actor would change his behavior by the given amount.
- */
-double ConstantCovariateMainBehaviorEffect::calculateChangeContribution(int
- actor, int difference) const
-{
-
- // The formula for the effect:
- // s_i(x) = v_i * c_i
- // We need to calculate the change delta in s_i(x), if we changed
- // v_i to v_i + d (d being the given amount of change in v_i).
- // This is d * c_i.
-
- return difference * this->pCovariate()->value(actor);
-}
-
-/**
- * Returns the statistic corresponding to this effect as part of
- * the evaluation function with respect to the given behavior variable.
- */
-double ConstantCovariateMainBehaviorEffect::evaluationStatistic(double * currentValues) const
-{
- double statistic = 0;
- int n = this->n();
-
- const ConstantCovariate * pCovariate = this->pCovariate();
-
- for (int i = 0; i < n; i++)
- {
- statistic += currentValues[i] * pCovariate->value(i);
- }
- return statistic;
-}
-
-
-/**
- * Returns the statistic corresponding to this effect as part of
- * the endowment function with respect to the initial values of a
- * behavior variable and the current values.
- */
-double ConstantCovariateMainBehaviorEffect::endowmentStatistic(const int * difference,
- double * currentValues) const
-{
- double statistic = 0;
- int n = this->n();
-
- const ConstantCovariate * pCovariate = this->pCovariate();
-
- for (int i = 0; i < n; i++)
- {
- if (difference[i] > 0)
- {
- statistic += currentValues[i] * pCovariate->value(i);
- }
- }
-
- return statistic;
-}
-
-}
Deleted: pkg/RSiena/src/model/effects/ConstantCovariateMainBehaviorEffect.h
===================================================================
--- pkg/RSiena/src/model/effects/ConstantCovariateMainBehaviorEffect.h 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/ConstantCovariateMainBehaviorEffect.h 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,38 +0,0 @@
-/******************************************************************************
- * SIENA: Simulation Investigation for Empirical Network Analysis
- *
- * Web: http://www.stats.ox.ac.uk/~snijders/siena/
- *
- * File: ConstantCovariateMainBehaviorEffect.h
- *
- * Description: This file contains the definition of the
- * ConstantCovariateMainBehaviorEffect class.
- *****************************************************************************/
-
-#ifndef CONSTANTCOVARIATEMAINBEHAVIOREFFECT_H_
-#define CONSTANTCOVARIATEMAINBEHAVIOREFFECT_H_
-
-#include "ConstantCovariateBehaviorEffect.h"
-
-namespace siena
-{
-
-/**
- * Constant covariate main behavior effect defined as the product of the ego
- * with the covariate.
- */
- class ConstantCovariateMainBehaviorEffect : public ConstantCovariateBehaviorEffect
-{
-public:
- ConstantCovariateMainBehaviorEffect(const EffectInfo * pEffectInfo);
-
- virtual double calculateChangeContribution(int actor,
- int difference) const;
- virtual double evaluationStatistic(double * currentValues) const;
- virtual double endowmentStatistic(const int * difference,
- double * currentValues) const;
-};
-
-}
-
-#endif /*CONSTANTCOVARIATEMAINBEHAVIOREFFECT_H_*/
Deleted: pkg/RSiena/src/model/effects/TotalSimilarityEffect.cpp
===================================================================
--- pkg/RSiena/src/model/effects/TotalSimilarityEffect.cpp 2010-01-18 19:42:50 UTC (rev 43)
+++ pkg/RSiena/src/model/effects/TotalSimilarityEffect.cpp 2010-01-18 19:47:47 UTC (rev 44)
@@ -1,175 +0,0 @@
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/rsiena -r 44
More information about the Rsiena-commits
mailing list