> print(fit, "mu1")Stan model 'mymodel' does not contain samples.
Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
Exception thrown at line 48:
stan::math::normal_log: Scale parameter has dimension = 2, expecting dimension = 943; a function was called with arguments of different scalar, array, vector, or matrix types, and they were not consistently sized; all arguments must be scalars or multidimensional values of the same shape.
If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
Rejecting initial value:
Error evaluating the log probability at the initial value.
Initialization between (-2, 2) failed after 100 attempts.
Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
error occurred during calling the sampler; sampling not done
lambda0 ~ normal(0,sigsq_lambda0); #the effect of age and gender
Thank you very much Ben! I tried to set the length of sigsq_lambda0 to U and it works! Although my computer has not enough capacity to run the model.... it stucks for hours and still can't give me the coefficients. Still, thank you very much! I didn't expect to get my problem solved so soon online.
for(i in 1:U)
lambda[i] ~ multi_normal(mu1,Sigma1);