Title: | The Distributed Online Expectation Maximization Algorithms to Solve Parameters of Poisson Mixture Models |
---|---|
Description: | The distributed online expectation maximization algorithms are used to solve parameters of Poisson mixture models. The philosophy of the package is described in Guo, G. (2022) <doi:10.1080/02664763.2022.2053949>. |
Authors: | Qian Wang [aut, cre], Guangbao Guo [aut], Guoqi Qian [aut] |
Maintainer: | Qian Wang <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.1 |
Built: | 2024-11-28 06:49:39 UTC |
Source: | CRAN |
The DE-OEM algorithm replaces E-step with stochastic step in distributed manner, which is used to solve the parameter estimation of Poisson mixture model.
DE_OEM(y, M, K, seed, alpha0, lambda0, a, b)
DE_OEM(y, M, K, seed, alpha0, lambda0, a, b)
y |
is a vector |
M |
is the number of subsets |
K |
is the number of Poisson distribution |
seed |
is the recommended way to specify seeds |
alpha0 |
is the initial value of the mixing weight |
lambda0 |
is the initial value of the mean |
a |
represents the power of the reciprocal of the step size |
b |
indicates that the M-step is not implemented for the first b data points |
DE_OEMtime,DE_OEMalpha,DE_OEMlambda
library(stats) set.seed(637351) K=5 alpha1=c(rep(1/K,K)) lambda1=c(1,2,3,4,5) n=300 U=sample(c(1:n),n,replace=FALSE) y= c(rep(0,n)) for(i in 1:n){ if(U[i]<=0.2*n){ y[i] = rpois(1,lambda1[1])} else if(U[i]>0.2*n & U[i]<=0.4*n){ y[i] = rpois(1,lambda1[2])} else if(U[i]>0.4*n & U[i]<=0.6*n){ y[i] = rpois(1,lambda1[3])} else if(U[i]>0.6*n & U[i]<=0.8*n){ y[i] = rpois(1,lambda1[4])} else if(U[i]>0.8*n ){ y[i] = rpois(1,lambda1[5])} } M=5 seed=637351 set.seed(123) e=sample(c(1:n),K) alpha0=e/sum(e) lambda0=c(1.5,2.5,3.5,4.5,5.5) a=1 b=5 DE_OEM(y,M,K,seed,alpha0,lambda0,a,b)
library(stats) set.seed(637351) K=5 alpha1=c(rep(1/K,K)) lambda1=c(1,2,3,4,5) n=300 U=sample(c(1:n),n,replace=FALSE) y= c(rep(0,n)) for(i in 1:n){ if(U[i]<=0.2*n){ y[i] = rpois(1,lambda1[1])} else if(U[i]>0.2*n & U[i]<=0.4*n){ y[i] = rpois(1,lambda1[2])} else if(U[i]>0.4*n & U[i]<=0.6*n){ y[i] = rpois(1,lambda1[3])} else if(U[i]>0.6*n & U[i]<=0.8*n){ y[i] = rpois(1,lambda1[4])} else if(U[i]>0.8*n ){ y[i] = rpois(1,lambda1[5])} } M=5 seed=637351 set.seed(123) e=sample(c(1:n),K) alpha0=e/sum(e) lambda0=c(1.5,2.5,3.5,4.5,5.5) a=1 b=5 DE_OEM(y,M,K,seed,alpha0,lambda0,a,b)
The DM-OEM algorithm replaces M-step with stochastic step in distributed manner, which is used to solve the parameter estimation of Poisson mixture model.
DM_OEM(y, M, K, seed, alpha0, lambda0, a, b)
DM_OEM(y, M, K, seed, alpha0, lambda0, a, b)
y |
is a vector |
M |
is the number of subsets |
K |
is the number of Poisson distribution |
seed |
is the recommended way to specify seeds |
alpha0 |
is the initial value of the mixing weight |
lambda0 |
is the initial value of the mean |
a |
represents the power of the reciprocal of the step size |
b |
indicates that the M-step is not implemented for the first b data points |
DM_OEMtime,DM_OEMalpha,DM_OEMlambda
library(stats) set.seed(637351) K=5 alpha1=c(rep(1/K,K)) lambda1=c(1,2,3,4,5) n=300 U=sample(c(1:n),n,replace=FALSE) y= c(rep(0,n)) for(i in 1:n){ if(U[i]<=0.2*n){ y[i] = rpois(1,lambda1[1])} else if(U[i]>0.2*n & U[i]<=0.4*n){ y[i] = rpois(1,lambda1[2])} else if(U[i]>0.4*n & U[i]<=0.6*n){ y[i] = rpois(1,lambda1[3])} else if(U[i]>0.6*n & U[i]<=0.8*n){ y[i] = rpois(1,lambda1[4])} else if(U[i]>0.8*n ){ y[i] = rpois(1,lambda1[5])} } M=5 seed=637351 set.seed(123) e=sample(c(1:n),K) alpha0=e/sum(e) lambda0=c(1.5,2.5,3.5,4.5,5.5) a=1 b=5 DM_OEM(y,M,K,seed,alpha0,lambda0,a,b)
library(stats) set.seed(637351) K=5 alpha1=c(rep(1/K,K)) lambda1=c(1,2,3,4,5) n=300 U=sample(c(1:n),n,replace=FALSE) y= c(rep(0,n)) for(i in 1:n){ if(U[i]<=0.2*n){ y[i] = rpois(1,lambda1[1])} else if(U[i]>0.2*n & U[i]<=0.4*n){ y[i] = rpois(1,lambda1[2])} else if(U[i]>0.4*n & U[i]<=0.6*n){ y[i] = rpois(1,lambda1[3])} else if(U[i]>0.6*n & U[i]<=0.8*n){ y[i] = rpois(1,lambda1[4])} else if(U[i]>0.8*n ){ y[i] = rpois(1,lambda1[5])} } M=5 seed=637351 set.seed(123) e=sample(c(1:n),K) alpha0=e/sum(e) lambda0=c(1.5,2.5,3.5,4.5,5.5) a=1 b=5 DM_OEM(y,M,K,seed,alpha0,lambda0,a,b)
The DMOEM is an overrelaxation algorithm in distributed manner, which is used to solve the parameter estimation of Poisson mixture model.
DMOEM( y, M, K, seed, alpha0, lambda0, MOEMalpha0, MOEMlambda0, omega, T, epsilon )
DMOEM( y, M, K, seed, alpha0, lambda0, MOEMalpha0, MOEMlambda0, omega, T, epsilon )
y |
is a data matrix |
M |
is the number of subsets |
K |
is the number of Poisson distribution |
seed |
is the recommended way to specify seeds |
alpha0 |
is the initial value of the mixing weight under the EM algorithm |
lambda0 |
is the initial value of the mean under the EM algorithm |
MOEMalpha0 |
is the initial value of the mixing weight under the monotonically overrelaxed EM algorithm |
MOEMlambda0 |
is the initial value of the mean under the monotonically overrelaxed EM algorithm |
omega |
is the overrelaxation factor |
T |
is the number of iterations |
epsilon |
is the threshold value |
DMOEMtime,DMOEMalpha,DMOEMlambda
library(stats) set.seed(637351) K=5 alpha1=c(rep(1/K,K)) lambda1=c(1,2,3,4,5) n=300 U=sample(c(1:n),n,replace=FALSE) y= c(rep(0,n)) for(i in 1:n){ if(U[i]<=0.2*n){ y[i] = rpois(1,lambda1[1])} else if(U[i]>0.2*n & U[i]<=0.4*n){ y[i] = rpois(1,lambda1[2])} else if(U[i]>0.4*n & U[i]<=0.6*n){ y[i] = rpois(1,lambda1[3])} else if(U[i]>0.6*n & U[i]<=0.8*n){ y[i] = rpois(1,lambda1[4])} else if(U[i]>0.8*n ){ y[i] = rpois(1,lambda1[5])} } M=5 seed=637351 set.seed(123) e=sample(c(1:n),K) alpha0= MOEMalpha0=e/sum(e) lambda0= MOEMlambda0=c(1.5,2.5,3.5,4.5,5.5) omega=0.8 T=10 epsilon=0.005 DMOEM(y,M,K,seed,alpha0,lambda0,MOEMalpha0,MOEMlambda0,omega,T,epsilon)
library(stats) set.seed(637351) K=5 alpha1=c(rep(1/K,K)) lambda1=c(1,2,3,4,5) n=300 U=sample(c(1:n),n,replace=FALSE) y= c(rep(0,n)) for(i in 1:n){ if(U[i]<=0.2*n){ y[i] = rpois(1,lambda1[1])} else if(U[i]>0.2*n & U[i]<=0.4*n){ y[i] = rpois(1,lambda1[2])} else if(U[i]>0.4*n & U[i]<=0.6*n){ y[i] = rpois(1,lambda1[3])} else if(U[i]>0.6*n & U[i]<=0.8*n){ y[i] = rpois(1,lambda1[4])} else if(U[i]>0.8*n ){ y[i] = rpois(1,lambda1[5])} } M=5 seed=637351 set.seed(123) e=sample(c(1:n),K) alpha0= MOEMalpha0=e/sum(e) lambda0= MOEMlambda0=c(1.5,2.5,3.5,4.5,5.5) omega=0.8 T=10 epsilon=0.005 DMOEM(y,M,K,seed,alpha0,lambda0,MOEMalpha0,MOEMlambda0,omega,T,epsilon)
The E-OEM algorithm replaces E-step with stochastic step, which is used to solve the parameter estimation of Poisson mixture model.
E_OEM(y, K, alpha0, lambda0, a, b)
E_OEM(y, K, alpha0, lambda0, a, b)
y |
is a data vector |
K |
is the number of Poisson distribution |
alpha0 |
is the initial value of the mixing weight |
lambda0 |
is the initial value of the mean |
a |
represents the power of the reciprocal of the step size |
b |
indicates that the M-step is not implemented for the first b data points |
E_OEMtime,E_OEMalpha,E_OEMlambda
library(stats) set.seed(637351) K=5 alpha1=c(rep(1/K,K)) lambda1=c(1,2,3,4,5) n=300 U=sample(c(1:n),n,replace=FALSE) y= c(rep(0,n)) for(i in 1:n){ if(U[i]<=0.2*n){ y[i] = rpois(1,lambda1[1])} else if(U[i]>0.2*n & U[i]<=0.4*n){ y[i] = rpois(1,lambda1[2])} else if(U[i]>0.4*n & U[i]<=0.6*n){ y[i] = rpois(1,lambda1[3])} else if(U[i]>0.6*n & U[i]<=0.8*n){ y[i] = rpois(1,lambda1[4])} else if(U[i]>0.8*n ){ y[i] = rpois(1,lambda1[5])} } M=5 seed=637351 set.seed(123) e=sample(c(1:n),K) alpha0=e/sum(e) lambda0=c(1.5,2.5,3.5,4.5,5.5) a=0.75 b=5 E_OEM(y,K,alpha0,lambda0,a,b)
library(stats) set.seed(637351) K=5 alpha1=c(rep(1/K,K)) lambda1=c(1,2,3,4,5) n=300 U=sample(c(1:n),n,replace=FALSE) y= c(rep(0,n)) for(i in 1:n){ if(U[i]<=0.2*n){ y[i] = rpois(1,lambda1[1])} else if(U[i]>0.2*n & U[i]<=0.4*n){ y[i] = rpois(1,lambda1[2])} else if(U[i]>0.4*n & U[i]<=0.6*n){ y[i] = rpois(1,lambda1[3])} else if(U[i]>0.6*n & U[i]<=0.8*n){ y[i] = rpois(1,lambda1[4])} else if(U[i]>0.8*n ){ y[i] = rpois(1,lambda1[5])} } M=5 seed=637351 set.seed(123) e=sample(c(1:n),K) alpha0=e/sum(e) lambda0=c(1.5,2.5,3.5,4.5,5.5) a=0.75 b=5 E_OEM(y,K,alpha0,lambda0,a,b)
The M-OEM algorithm replaces M-step with stochastic step, which is used to solve the parameter estimation of Poisson mixture model.
M_OEM(y, K, alpha0, lambda0, a, b)
M_OEM(y, K, alpha0, lambda0, a, b)
y |
is a data vector |
K |
is the number of Poisson distribution |
alpha0 |
is the initial value of the mixing weight |
lambda0 |
is the initial value of the mean |
a |
represents the power of the reciprocal of the step size |
b |
indicates that the M-step is not implemented for the first b data points |
M_OEMtime,M_OEMalpha,M_OEMlambda
library(stats) set.seed(637351) K=5 alpha1=c(rep(1/K,K)) lambda1=c(1,2,3,4,5) n=300 U=sample(c(1:n),n,replace=FALSE) y= c(rep(0,n)) for(i in 1:n){ if(U[i]<=0.2*n){ y[i] = rpois(1,lambda1[1])} else if(U[i]>0.2*n & U[i]<=0.4*n){ y[i] = rpois(1,lambda1[2])} else if(U[i]>0.4*n & U[i]<=0.6*n){ y[i] = rpois(1,lambda1[3])} else if(U[i]>0.6*n & U[i]<=0.8*n){ y[i] = rpois(1,lambda1[4])} else if(U[i]>0.8*n ){ y[i] = rpois(1,lambda1[5])} } M=5 seed=637351 set.seed(123) e=sample(c(1:n),K) alpha0=e/sum(e) lambda0=c(1.5,2.5,3.5,4.5,5.5) a=0.75 b=5 M_OEM(y,K,alpha0,lambda0,a,b)
library(stats) set.seed(637351) K=5 alpha1=c(rep(1/K,K)) lambda1=c(1,2,3,4,5) n=300 U=sample(c(1:n),n,replace=FALSE) y= c(rep(0,n)) for(i in 1:n){ if(U[i]<=0.2*n){ y[i] = rpois(1,lambda1[1])} else if(U[i]>0.2*n & U[i]<=0.4*n){ y[i] = rpois(1,lambda1[2])} else if(U[i]>0.4*n & U[i]<=0.6*n){ y[i] = rpois(1,lambda1[3])} else if(U[i]>0.6*n & U[i]<=0.8*n){ y[i] = rpois(1,lambda1[4])} else if(U[i]>0.8*n ){ y[i] = rpois(1,lambda1[5])} } M=5 seed=637351 set.seed(123) e=sample(c(1:n),K) alpha0=e/sum(e) lambda0=c(1.5,2.5,3.5,4.5,5.5) a=0.75 b=5 M_OEM(y,K,alpha0,lambda0,a,b)
The PeMSD3 data
data("PeMSD3")
data("PeMSD3")
A data frame with 26208 observations on the following 12 variables.
X315836
a numeric vector
X315837
a numeric vector
X315838
a numeric vector
X315841
a numeric vector
X315842
a numeric vector
X315839
a numeric vector
X315843
a numeric vector
X315846
a numeric vector
X315847
a numeric vector
X317895
a numeric vector
X315849
a numeric vector
X315850
a numeric vector
It is the traffic data of Sacramento in California, the United States.
Song, C., Lin, Y., Guo, S., Wan, H. Spatial-temporal synchronous graph convolutional networks: a new framework for spatial-temporal network data forecasting[C]. Proceedings of the AAAI Conference on Artificial Intelligence, 34(1), 914-921.
Song, C., Lin, Y., Guo, S., Wan, H. Spatial-temporal synchronous graph convolutional networks: a new framework for spatial-temporal network data forecasting[C]. Proceedings of the AAAI Conference on Artificial Intelligence, 34(1), 914-921.
data(PeMSD3) ## maybe str(PeMSD3) ; plot(PeMSD3) ...
data(PeMSD3) ## maybe str(PeMSD3) ; plot(PeMSD3) ...
The PeMSD7 data
data("PeMSD7")
data("PeMSD7")
A data frame with 17568 observations on the following 20 variables.
X773656
a numeric vector
X760074
a numeric vector
X760080
a numeric vector
X716414
a numeric vector
X760101
a numeric vector
X760112
a numeric vector
X716419
a numeric vector
X716421
a numeric vector
X716424
a numeric vector
X765476
a numeric vector
X760167
a numeric vector
X716427
a numeric vector
X716431
a numeric vector
X716433
a numeric vector
X760187
a numeric vector
X760196
a numeric vector
X716440
a numeric vector
X760226
a numeric vector
X760236
a numeric vector
X716449
a numeric vector
It is the traffic data of Los Angeles in California, the United States.
Xu, D., Wei, C., Peng, P., Xuan, Q., Guo, H. Ge-gan: a novel deep learning framework for road traffic state estimation[J]. Transportation Research Part C Emerging Technologies, 2020, 117, 102635.
Xu, D., Wei, C., Peng, P., Xuan, Q., Guo, H. Ge-gan: a novel deep learning framework for road traffic state estimation[J]. Transportation Research Part C Emerging Technologies, 2020, 117, 102635.
data(PeMSD7) ## maybe str(PeMSD7) ; plot(PeMSD7) ...
data(PeMSD7) ## maybe str(PeMSD7) ; plot(PeMSD7) ...
The weekend data in PeMSD7
data("PeMSD7_weekend")
data("PeMSD7_weekend")
A data frame with 5184 observations on the following 20 variables.
X773656
a numeric vector
X760074
a numeric vector
X760080
a numeric vector
X716414
a numeric vector
X760101
a numeric vector
X760112
a numeric vector
X716419
a numeric vector
X716421
a numeric vector
X716424
a numeric vector
X765476
a numeric vector
X760167
a numeric vector
X716427
a numeric vector
X716431
a numeric vector
X716433
a numeric vector
X760187
a numeric vector
X760196
a numeric vector
X716440
a numeric vector
X760226
a numeric vector
X760236
a numeric vector
X716449
a numeric vector
The weekend data set only records traffic flow data on weekends.
Xu, D., Wei, C., Peng, P., Xuan, Q., Guo, H. Ge-gan: a novel deep learning framework for road traffic state estimation[J]. Transportation Research Part C Emerging Technologies, 2020, 117, 102635.
Xu, D., Wei, C., Peng, P., Xuan, Q., Guo, H. Ge-gan: a novel deep learning framework for road traffic state estimation[J]. Transportation Research Part C Emerging Technologies, 2020, 117, 102635.
data(PeMSD7_weekend) ## maybe str(PeMSD7_weekend) ; plot(PeMSD7_weekend) ...
data(PeMSD7_weekend) ## maybe str(PeMSD7_weekend) ; plot(PeMSD7_weekend) ...
The workday data in PeMSD7
data("PeMSD7_workday")
data("PeMSD7_workday")
A data frame with 12384 observations on the following 20 variables.
X773656
a numeric vector
X760074
a numeric vector
X760080
a numeric vector
X716414
a numeric vector
X760101
a numeric vector
X760112
a numeric vector
X716419
a numeric vector
X716421
a numeric vector
X716424
a numeric vector
X765476
a numeric vector
X760167
a numeric vector
X716427
a numeric vector
X716431
a numeric vector
X716433
a numeric vector
X760187
a numeric vector
X760196
a numeric vector
X716440
a numeric vector
X760226
a numeric vector
X760236
a numeric vector
X716449
a numeric vector
The workday data set only records traffic flow data on workdays.
Xu, D., Wei, C., Peng, P., Xuan, Q., Guo, H. Ge-gan: a novel deep learning framework for road traffic state estimation[J]. Transportation Research Part C Emerging Technologies, 2020, 117, 102635.
Xu, D., Wei, C., Peng, P., Xuan, Q., Guo, H. Ge-gan: a novel deep learning framework for road traffic state estimation[J]. Transportation Research Part C Emerging Technologies, 2020, 117, 102635.
data(PeMSD7_workday) ## maybe str(PeMSD7_workday) ; plot(PeMSD7_workday) ...
data(PeMSD7_workday) ## maybe str(PeMSD7_workday) ; plot(PeMSD7_workday) ...