Calculating EOF with CDO gives Eigenvalue computation warning jacobi scheme did not converge - cdo-climate

I need to get the principal coefficients (daily) of the first EOF of the daily geopotential height field (data = geopot.nc). I use only the cold season (N,D,J,F,M,A). My code is as follows:
cdo selmon,11,12,1,2,3,4 geopot.nc geopotw.nc
cdo --reduce_dim - copy geopotw.nc geopotw3.nc #delete 1 dimension of level=1)
cdo sub geopotw3.nc -ydaymean geopotw3.nc deseason.nc
cdo mulcoslat deseason.nc deseasoncos.nc
cdo eof,3 deseasoncos.nc eval.nc eof.nc
I got a warning message: statistics-module (Warning): Eigenvalue computation with one-sided jacobi scheme did not converge properly. 7017371 of 7244721 pairs of columns did not achieve requested orthogonality of 1e-12.
What I am doing wrong? Maybe I am missing something? Or maybe there are other better ways to achieve the result I am looking for? For example in R. Thank you for the help!

I'm not sure if this post will help, you can change the max iteration number using an environmental variable in the following way:
export MAX_JACOBI_ITER=100
See if that will help with your convergence issue?

Related

How to compute p-value when number of degrees of freedom and chi-square value are known?

I know how to do this in R: e.g. pchisq(18.98, df=2, lower.tail=FALSE)
However, I've no idea about how to write Stata code to solve this problem.
In case you're interested in more general post-estimation tests check out: help test.
Otherwise is seems like chi2(2,18.98) or chi2tail(2,18.98) are what you're after (depending on what lower.tail=FALSE means.
Note that in Stata you'll probably want to put this into a "local" in order to do other things with the output.
For example if you say the following to Stata:
local pchi2 = chi2(2,18.98)
display "chi2: `pchi2'"
Stata should reply:
chi2: .9999243958967154
See for more detail and links to the Stata manual section on statistical functions:
help chi2
help chi2tail

EViews: How to estimate by OLS a more complex regression model?

For example I estimated by OLS the following model:
using an Eviews program file with code:
equation e1.ls log(cons) c log(sw) log(nsw) log(inc)
However, I have to now estimate this model:
But I am not sure how to go about writing the code. I tried typing:
equation e1.ls log(costs|kwh,pl,pk,pf) c log(kwh) log(pl) log(pk) log(pf) (log(kwh))^2
However, the first and last terms do not work and I'm not sure how to do it. I would appreciate any help, thank you!
EViews allows you to put the regression in equation form, as in
equation e1.ls log(costs)= c(1)*log(kwh)+ c(2)*log(pl)+ c(3)*log(pk) + c(4)*log(pf) + c(5)*(log(kwh))^2
but costs|kwh,pl,pk,pf doesn't mean anything in EViews.

Negative test score for random forest

Hi I am using a random forest classifier to product logerror. The log error contains both =ve & -ve values. After running the classifier with different settings. i am able to get training test score of around 0.8 but the test score is always negative. why is that so?
should i be using abs(log error) for prediction or is my choice for random forest wrong?
Choice of the random forest might be wrong but you better check it in context of data as if you have shared data here it would be easy to help you at the exact point. But, I suggest you try Knn if your total observations are around 1000-2000.
Also, if you are using any kind of encoding to convert categorical data to nominal please use only one hot encoding as other my add values to attributes.
You should have checked correlation of attributes to the target variable as the low correlation of target variable in test data may result in the negative score.
Apart from above all, distribution of data plays a vital role in randomforest regresssion. So, try to check distribution and apply methods such as box-cox to convert data in normal distribution.

methods does not give confusion matrix in weka

I want to do classification in weka. I am using some methods(Random Tree, Random Forest, Decision Table, RandomSubspace...) but they give results like below.
=== Cross-validation ===
=== Summary ===
Correlation coefficient 0.1678
Mean absolute error 0.4832
Root mean squared error 0.4931
Relative absolute error 96.6501 %
Root relative squared error 98.6323 %
Total Number of Instances 100000
However I want results as accurancy and confusion matrix. How can I get results like that?
Note: When I use small dataset, it gives results as confusion matrix. Can it be related with the size of dataset?
The output of the training/testing in Weka depends on the type of the attribute that you are trying to predict. If your attribute is nominal, you will get a confusion matrix and accuracy value. If your attribute is numeric, you will get a correlation coefficient.
In your small and large datasets that you mention, what is your type of the attribute that you are predicting?
I have run a 2-class problem using J48 and RandomForest with 100000 instances and the confusion matrix appeared correctly. I additionally increased the problem complexity to run 20 different classes and the confusion matrix appeared correctly as well.
If you look under more options, please ensure that the 'output confusion matrix' is checked and see if this resolves the issue.

Stata seems to be ignoring my starting values in maximum likelihood estimation

I am trying to estimate a maximum likelihood model and it is running into convergence problems in Stata. The actual model is quite complicated, but it converges with no troubles in R when it is supplied with appropriate starting values. I however cannot seem to get Stata to accept the starting values I provide.
I have included a simple example below estimating the mean of a poisson distribution. This is not the actual model I am trying to estimate, but it demonstrates my problem. I set the trace variable, which allows you to see the parameters as Stata searches the likelihood surface.
Although I use init to set a starting value of 0.5, the first iteration still shows that Stata is trying a coefficient of 4.
Why is this? How can I force the estimation procedure to use my starting values?
Thanks!
generate y = rpoisson(4)
capture program drop mypoisson
program define mypoisson
args lnf mu
quietly replace `lnf' = $ML_y1*ln(`mu') - `mu' - lnfactorial($ML_y1)
end
ml model lf mypoisson (mean:y=)
ml init 0.5, copy
ml maximize, iterations(2) trace
Output:
Iteration 0:
Parameter vector:
mean:
_cons
r1 4
Added: Stata doesn't ignore the initial value. If you look at the output of the ml maximize command, the first line in the listing will be titled
initial: log likelihood =
Following the equal sign is the value of the likelihood for the parameter value set in the init statement.
I don't know how the search(off) or search(norescale) solutions affect the subsequent likelihood calculations, so these solution might still be worthwhile.
Original "solutions":
To force a start at your initial value, add the search(off) option to ml maximize:
ml maximize, iterate(2) trace search(off)
You can also force a use of the initial value with search(norescale). See Jeff Pitblado's post at http://www.stata.com/statalist/archive/2006-07/msg00499.html.