Learn R Programming

eigenmodel (version 1.11)

eigenmodel-package: Semiparametric Factor and Regression Models for Symmetric Relational Data

Description

Estimation of the parameters in a model for symmetric relational data (e.g., the above-diagonal part of a square matrix), using a model-based eigenvalue decomposition and regression. Missing data is accomodated, and a posterior mean for missing data is calculated under the assumption that the data are missing at random. The marginal distribution of the relational data can be arbitrary, and is fit with an ordered probit specification. See Hoff (2007) <arXiv:0711.1146> for details on the model.

Arguments

Details

Package: eigenmodel
Type: Package
Version: 1.11
Date: 2019-05-28
License: GPL Version 2

References

Hoff (2007) ``Modeling homophily and stochastic equivalence in symmetric relational data''

Examples

Run this code
# NOT RUN {

data(YX_Friend)

fit<-eigenmodel_mcmc(Y=YX_Friend$Y,X=YX_Friend$X,R=2,S=50,burn=50)

# in general you should run the Markov chain longer than 50 scans

plot(fit)


# people familiar with MCMC might want to implement 
# their own Markov chains: 

Y<-YX_Friend$Y
X<-YX_Friend$X

eigenmodel_setup(R=2)

for(s in 1:50) {   # you should run your chain longer than 50 scans

    Z<-rZ_fc() 
    UL<-rUL_fc()
    b<-rb_fc()  

                 }


#fit_Gen<-eigenmodel_mcmc(Y=Y_Gen,R=3,S=10000)

#fit_Pro<-eigenmodel_mcmc(Y=Y_Pro,R=3,S=10000)




# }

Run the code above in your browser using DataLab