Skip to content

Commit

Permalink
Update BMM_new.R
Browse files Browse the repository at this point in the history
  • Loading branch information
gdlc authored Feb 23, 2024
1 parent adbbe26 commit daa11da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/BMM_new.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ BMM_new=function(C,rhs,my,vy,n,B0=matrix(nrow=ncol(C),ncol=1,0),nIter=150,burnIn
POST.PROB=matrix(nrow=p,ncol=nComp,0)

S0.b=c(df0.b)*c(vy)*c(R2/10)/c(sum(diag(C))/n) # dividing R2/10 assumes that most of the vairance is between components.
varB=S0.b/df0.b
varB=(S0.b/df0.b)

priorProb=priorProb/sum(priorProb)
compProb=priorProb
Expand Down Expand Up @@ -52,7 +52,7 @@ BMM_new=function(C,rhs,my,vy,n,B0=matrix(nrow=ncol(C),ncol=1,0),nIter=150,burnIn
for(i in 1:nIter){
## Sampling effects
timeIn=proc.time()[3]
tmp=sample_effects_new(C=C,rhs=rhs,b=b,d=d,B0=B0,varE=varE,varB=varB,RSS=RSS)
tmp=sample_effects_new(C=C,rhs=rhs,b=b,d=d,B0=B0,varE=varE,varB=varB[d],RSS=RSS)
b=tmp[[1]]
RSS=tmp[[2]]
timeEffects=timeEffects+(proc.time()[3]-timeIn)
Expand Down

0 comments on commit daa11da

Please sign in to comment.