联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Algorithm 算法作业Algorithm 算法作业

日期:2018-10-05 09:53

MATH 475 Problem Set 3 - Due Wednesday October 17 Dr. Syring

Instructions:

Please work in groups according to your preference but turn in

your own work.

Include your R code. A nice way to do this is with RMarkdown...

Problems:

1. Consider a binary social network of n people. The network can be described

by the association matrix A where Ai,j = 1 if the i

th and j

th i 6= j

person know each other (are friends, are frenemies, what have you...) and

Ai,j = 0 if the i

th and j

th person do not know each other. Our goal is

to classify each of the n persons as a member of the periphery TP or the

core TC. The core consists of the most connected individuals while the

periphery consists of those least connected. A partition π = {TC, TP } is

a particular choice of individuals assumed to be core and those assumed

to be part of the periphery. Define nC = #{TC} and nP = #{TP } as

the number of individuals in the core and the periphery, respectively.

The number of dyads in the core and in the periphery of a particular

partition is dC(π) = nC(π)

2nC(π) and dP (π) = nP (π)

2nP (π). Then,

the number of dyads for a partition is d(π) = dC(π) + dP (π). The total

number of intra-core violations (non-associations in the core) is

vC(π) = X

{i6=j}∈TC

(1 ? Aij ),

and the number of intra-periphery violations (associations in the periph-

1

MATH 475 Problem Set 3 - Due Wednesday October 17 Dr. Syring

ery) is

vP (π) = X

{i6=j}∈TP

Aij .

One approach to selecting the core and periphery is to maximize the

following measure of correlation:

rXY (π) = s2XY

sXsY

where

sX =sdC(π)d(π)

dP (π)d(π),

sY =sdC(π) - vC(π) + vP (π)

d(π)

dP (π) - vP (π) + vC(π)

d(π),

and

s2XY =dC(π) - vC(π)

d(π)-dC(π)

d(π)

dC(π) - vC(π) + vP (π)d(π).

a) Use the following observed network matrix:

set.seed(12345)

num_nodes <- 15

A <- matrix(round(runif(num_nodes*num_nodes)),num_nodes,num_nodes)

diag(A) <- 0

and perform Local Search using various initial partitions π to iterate

towards the partition maximizing rXY .

b) Using the same matrix, apply simulated annealing to iterate towards

the partition maximizing rXY .

2

MATH 475 Problem Set 3 - Due Wednesday October 17 Dr. Syring

c) Compare your results to the R optim function with method SANN

(simulate annealing).

2. 2. Consider the Lognormal density

f(x; μ, σ2) = 1xσ√2πexp ?(log x ? μ)2 2σ2.

If X ~ LN(μ, σ2) then E(X) = exp(μ + σ2/2). For Xi i.i.d. ~ LN(μ, σ2),

the geometric mean Z := (Qni=1 Xi)

1/n has a lognormal distribution with

parameters μ and σ2/n.

Evaluate E(Z) using:

a) Simpson’s Rule

b) the Laplace approximation

c) Monte Carlo. Use the Box-Muller method and the fact that if

Y ~ N(0, 1) then W = e

μ+σY has the lognormal distribution with

parameters μ and σ2.

d) Compare the performance of the three methods with respect to the

known value of the expectation.


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp