Thanks for the tip. I've used print to check the values for the different variables and steps in the sampling statement. What I've learned is that there is never an illegal parameter state (always between 0 and 1), which is good. I've changed the init argument for the cmdstan call to init=1 just to help limit possible concerns. I've not really found anything obvious which could be causing this problem, though I did fix a tiny error in the math. This didn't change anything, however.
What i have noticed is that the parameter estimate aren't updating between iterations. I have no idea what could be causing this (flat likelihood surface?), but I'm guessing this is the big problem. My code will print out the vectors with for sample, and they all appear to be valid values for the parameters. But, after it has all run, I still get the initialization failed message and the model stops.
Would this be a situation where putting non-uniform priors on, say, logit(gamma) might help with inference? Any help would be appreciated.
Sample from print output.
phi = [0.360966,0.35698,0.325728,0.269452,0.581838,0.474542,0.617086,0.456718,0.627167,0.520624,0.650452,0.676364,0.679755,0.400965,0.636721,0.343335,0.345352,0.511662,0.286681,0.673628,0.57874,0.388223,0.531224,0.727612,0.575721,0.566106,0.546064,0.434811,0.417624,0.354157]
gamma = [0.618148,0.571221,0.723834,0.394825,0.272438,0.660337,0.290158,0.672112,0.582204,0.312558,0.609324,0.399239,0.606841,0.282272,0.587201,0.618179,0.388153,0.422873,0.343704,0.36921,0.535746,0.514768,0.406327,0.32313,0.675828,0.472903,0.597111,0.549852,0.694149,0.594616,0.595549]
p = [0.396419,0.550119,0.626042,0.727947,0.679115,0.50664,0.334636,0.394073,0.653771,0.304764,0.418969,0.659981,0.373409,0.390601,0.492196,0.634144,0.678902,0.31745,0.529694,0.509664,0.3234,0.533394,0.477587,0.402319,0.4981,0.667508,0.393094,0.587889,0.320695,0.490758,0.593029]
phi = [0.360966,0.35698,0.325728,0.269452,0.581838,0.474542,0.617086,0.456718,0.627167,0.520624,0.650452,0.676364,0.679755,0.400965,0.636721,0.343335,0.345352,0.511662,0.286681,0.673628,0.57874,0.388223,0.531224,0.727612,0.575721,0.566106,0.546064,0.434811,0.417624,0.354157]
gamma = [0.618148,0.571221,0.723834,0.394825,0.272438,0.660337,0.290158,0.672112,0.582204,0.312558,0.609324,0.399239,0.606841,0.282272,0.587201,0.618179,0.388153,0.422873,0.343704,0.36921,0.535746,0.514768,0.406327,0.32313,0.675828,0.472903,0.597111,0.549852,0.694149,0.594616,0.595549]
p = [0.396419,0.550119,0.626042,0.727947,0.679115,0.50664,0.334636,0.394073,0.653771,0.304764,0.418969,0.659981,0.373409,0.390601,0.492196,0.634144,0.678902,0.31745,0.529694,0.509664,0.3234,0.533394,0.477587,0.402319,0.4981,0.667508,0.393094,0.587889,0.320695,0.490758,0.593029]
phi = [0.360966,0.35698,0.325728,0.269452,0.581838,0.474542,0.617086,0.456718,0.627167,0.520624,0.650452,0.676364,0.679755,0.400965,0.636721,0.343335,0.345352,0.511662,0.286681,0.673628,0.57874,0.388223,0.531224,0.727612,0.575721,0.566106,0.546064,0.434811,0.417624,0.354157]
gamma = [0.618148,0.571221,0.723834,0.394825,0.272438,0.660337,0.290158,0.672112,0.582204,0.312558,0.609324,0.399239,0.606841,0.282272,0.587201,0.618179,0.388153,0.422873,0.343704,0.36921,0.535746,0.514768,0.406327,0.32313,0.675828,0.472903,0.597111,0.549852,0.694149,0.594616,0.595549]
p = [0.396419,0.550119,0.626042,0.727947,0.679115,0.50664,0.334636,0.394073,0.653771,0.304764,0.418969,0.659981,0.373409,0.390601,0.492196,0.634144,0.678902,0.31745,0.529694,0.509664,0.3234,0.533394,0.477587,0.402319,0.4981,0.667508,0.393094,0.587889,0.320695,0.490758,0.593029]
phi = [0.360966,0.35698,0.325728,0.269452,0.581838,0.474542,0.617086,0.456718,0.627167,0.520624,0.650452,0.676364,0.679755,0.400965,0.636721,0.343335,0.345352,0.511662,0.286681,0.673628,0.57874,0.388223,0.531224,0.727612,0.575721,0.566106,0.546064,0.434811,0.417624,0.354157]
gamma = [0.618148,0.571221,0.723834,0.394825,0.272438,0.660337,0.290158,0.672112,0.582204,0.312558,0.609324,0.399239,0.606841,0.282272,0.587201,0.618179,0.388153,0.422873,0.343704,0.36921,0.535746,0.514768,0.406327,0.32313,0.675828,0.472903,0.597111,0.549852,0.694149,0.594616,0.595549]
p = [0.396419,0.550119,0.626042,0.727947,0.679115,0.50664,0.334636,0.394073,0.653771,0.304764,0.418969,0.659981,0.373409,0.390601,0.492196,0.634144,0.678902,0.31745,0.529694,0.509664,0.3234,0.533394,0.477587,0.402319,0.4981,0.667508,0.393094,0.587889,0.320695,0.490758,0.593029]
phi = [0.360966,0.35698,0.325728,0.269452,0.581838,0.474542,0.617086,0.456718,0.627167,0.520624,0.650452,0.676364,0.679755,0.400965,0.636721,0.343335,0.345352,0.511662,0.286681,0.673628,0.57874,0.388223,0.531224,0.727612,0.575721,0.566106,0.546064,0.434811,0.417624,0.354157]
gamma = [0.618148,0.571221,0.723834,0.394825,0.272438,0.660337,0.290158,0.672112,0.582204,0.312558,0.609324,0.399239,0.606841,0.282272,0.587201,0.618179,0.388153,0.422873,0.343704,0.36921,0.535746,0.514768,0.406327,0.32313,0.675828,0.472903,0.597111,0.549852,0.694149,0.594616,0.595549]
p =[0.396419,0.550119,0.626042,0.727947,0.679115,0.50664,0.334636,0.394073,0.653771,0.304764,0.418969,0.659981,0.373409,0.390601,0.492196,0.634144,0.678902,0.31745,0.529694,0.509664,0.3234,0.533394,0.477587,0.402319,0.4981,0.667508,0.393094,0.587889,0.320695,0.490758,0.593029]