comparison ks_distribution.R @ 36:6aeba53e195b draft

Uploaded
author greg
date Mon, 26 Jun 2017 10:55:49 -0400
parents a96e89657621
children ee4ebdf2935e
comparison
equal deleted inserted replaced
35:a96e89657621 36:6aeba53e195b
153 fx <- matrix(0, 100, comp) 153 fx <- matrix(0, 100, comp)
154 for (i in 1:100) 154 for (i in 1:100)
155 { 155 {
156 for (j in 1:comp) 156 for (j in 1:comp)
157 { 157 {
158 fx[i, j] <- pi[j] * dlnorm(vx[i], meanlog=mu[j], sdlog=(sqrt(var[j]))) 158 fx[i, j] <- pi[j] * dlnorm(vx[i], meanlog=mu[j], sdlog=(sqrt(var[j])))
159 if (is.nan(fx[i,j])) fx[i,j]<-0 159 if (is.nan(fx[i,j]))
160 {
161 fx[i,j]<-0
162 }
160 } 163 }
161 } 164 }
162 return(fx) 165 return(fx)
163 } 166 }
164 167