---
title: 'Network Analysis - Homework #2'
author: "Your Name"
date: ""
output: html_document
editor_options: 
  chunk_output_type: console
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)

```



This assignment is based on the [2014 VAST Challenge](https://chat.openai.com/c/70a9ac53-4372-4c4d-a390-ee636c766bc3). 


1. Please replace "Your Name" in the YAML (top of this script) your name.


2. You are going to work with the `emailnet` data used in Homework 1. Load the data and check the class of the `emailnet` object. Check how many nodes and edges are in this network. Check what vertex attributes are available for this network.



3. Make a visualization of the email network. 



4. In order to help you decide what network processes may have led to this network's formation, simulate a random network for comparison. Use the same number of nodes and edges in your random network. Visualize the two networks side-by-side. Summarize several network statistics so as to compare the email network to this random network.



5. Estimate an ergm that is specified based on the above analysis. Simulate 5 networks from your model estimates and compare them to the observed network. How if your model fit?



6. Use the `gof` function to check the fit. How does it look?



7. Play with your model specification until you achieve a reasonable fit. One the fit is good, interpret the results.

8. Knit the RMarkdown file (press the "Knit" button above) and read through the corresponding html file.  


For the submission: submit your solution in an R Markdown file and (just for insurance) submit the corresponding html file with it. 
