sampling error from multivariate skew normal distribution using sn package in r

Viewed 9

I am trying to sample from skew normal distributions of following 4 variables (MAT - mean annual temperature, Tmin - minimum temperature, MAP - mean annual precipitation, and WQP - precipitation of warmest quarter) using sn package in r. And, their xi, omega, and alpha are as follows.

s_xi <- c(8.9, -1.5, 673.5, 202.7)
s_Omega <- matrix(c(2.1, 2.9, 76.3, -2.3,  
                2.9, 4.9, 9.4, 0.4, 
                76.3, 94.6, 22614.1, 2519.0, 
                -2.3, 0.37, 2519, 915.2), 4,4, byrow=TRUE)
s_alpha <- c(1.8, -4, 6.7, -3.6)

camp_sample2 <- rmsn(n=1000, xi=s_xi, Omega=s_Omega, alpha=s_alpha)

When I ran bivariate sampling of MAT and MAP, it worked fine with the same code. However, above code of 4 variables would not work. I get following error message.

camp_sample2 <- rmsn(n=1000, xi=s_xi, Omega=s_Omega, alpha=s_alpha) Error in pd.solve(Omega) : x appears to be not symmetric

Can anyone interpret this error message? and help me with the correct coding?

0 Answers
Related