循环统计模型

机器算法验证 随机效应模型 固定效应模型
2022-04-18 14:14:25

我正在寻找有关循环统计的建议。特别是,我想知道是否有人有任何建议/参考来处理循环变量的回归模型,以及是否也可以包括随机效应。

目前我可以使用包装的柯西分布在 WinBUGS 中拟合非常简单的模型,但我不知道如何继续下一步并添加固定或随机效果。下面是我迄今为止一直在使用的 WinBUGS 代码。我已经用模拟数据对其进行了测试,到目前为止它表现良好,但尝试添加固定/随机效果到目前为止还没有奏效。

model{
 for (t in 1:N) {

 # likelihood for angles. We use the “ones” trick to sample from the
 # Wrapped Cauchy distribution (see WinBUGS manual)

 ones[t]<- 1
 ones[t] ~ dbern(wc[t])
 wc[t] <- (1/(2*Pi)*(1-rho[t]*rho[t])/(1+rho[t]*rho[t]-2*rho[t]*cos(theta[t]-
 mu.t[t])))/ 300 # Density function for Wrapped Cauchy distribution

 rho[t] <- lambda.t    # mean cosine for the circular distribution
 mu.t[t]<- nu.t# mean direction for turns
 }



 ###### priors for mean direction of angles
 nu.t ~ dunif(-3.14159265359, 3.14159265359)
lambda.t ~ dunif(0,1) # prior for mean cosine of circular distribution
 Pi <- 3.14159265359 # define Pi
 }

## Simulated Data ##
list(theta=c(1.57086666107637,0.624281203067249,4.83586153543422,5.52517105399153,0.250167755691792,5.24413183188724,0.175711907822086,0.503670499719972,0.00587906094477884,0.290131613934322,0.759047889069672,0.57973291007534,3.03128168541491,0.497790655905849,6.24730873150114,2.61159637947433,6.19811892339656,2.21476872674273,0.163464826891718,5.79300356573004,5.65352466175931,-0.0100726021401003,0.00574503925995024,0.260777171784755,5.8545805891331,6.09628602098184,6.07018161953988,5.90921466125829,0.0387070377090986,5.96019978900552,0.270388591408335,0.539775794451919,6.16303548945592,5.54317029065067,1.09867887761604,0.546155012914554,5.73154203573232,6.04837644493341,.242217723020124,0.201937287826239,6.19111529531002,0.602897213838987,5.53590129760264,0.304328180646957,6.12364810518025,0.0781317192586082,2.12148311222615,5.41742779164167,0.109722984863423,0.546244633029087,1.72483899231817,5.81142848191977,5.77431670621736,5.94852063016486,1.21880980868771,0.761391412364464,6.13385885651117,2.3278212791841,-0.00886837423371834,0.0509442654103693,0.919346146608449,0.22243489212092,0.0605109486858312,6.26215798187548,3.35930515203348,4.49262316826849,0.393662386151002,0.408276217352091,5.48604197934124,1.2319358669625,0.290890698266516,0.0356807866706245,5.01603150661483,2.13110569190685,5.58637984768018,0.705401496640296,0.474940761772081,5.58728776070886,6.12311166642116,0.00848809261322299,3.35074107197193,5.82089972193407,0.0531213061461832,5.97904289602246,4.31610462188531,5.61206825679503,0.184081838885041,0.288450927211418,0.594322121025956,1.07062485671203,0.400068367390392,5.08834932305335,4.35542895067301,6.08614182924595,6.14530696852739,5.25070254271081,5.91716602109256,1.78589020077607,6.23955405139402,6.09356179129423), N =100)
1个回答

Nick Fisher 的这本书很受欢迎。它涵盖了许多圆形分布,包括心形分布、包裹 Cauchy、包裹正态分布和 von MIses 分布。我不知道它是否告诉您如何从这些分布中生成观察结果,但它为您提供了很多分布、理论和方法。

循环数据的统计分析