Questions in topic: "matrix"
https://developer.ibm.com/answers/questions/topics/single/232470.html
The latest questions for the topic "matrix"Pack function with decission variables in OPL (CPLEX)
https://developer.ibm.com/answers/questions/487840/pack-function-with-decission-variables-in-opl-cple.html
Hello,
I'm trying to solve a bin-packing problem (I'm almost new with CPLEX), in which different weighted items are allocated into some bins. My problem is that the weights of the different items depend on another decision variable. For this reason, weights are not integers but integer variables.
Pack function is: pack(dvar int[ ],dvar int[ ],int[])
My problem is that I can not use the pack function in order to allocate the items in the bins because of the third parameter.
Could you give me a clue or hint in order to solve my problem? Thanks in advance.pythoncplexdocplexcloudpackageoplmatrixpackThu, 10 Jan 2019 16:04:07 GMTanguaorCPLEX encountered arrays with inconsistent lengths.
https://developer.ibm.com/answers/questions/473047/cplex-encountered-arrays-with-inconsistent-lengths.html
Dear all,
I try to find an optimum to a MILP problem (see code below). Therefore, I apply the CPLEX solver's Matlab API. I now get the error message:
Error using cplexmilp. CPLEX encountered arrays with inconsistent lengths.
To me, it seems like the reason must either be with the SOSs constraints or the lb, ub constraints, but I just couldn't figure out why. Also, it's my first time using SOSs constraints at all.
%% Optimization Framework
% General Definitions
p = Data.RAW.Marginal_Prices; % price vector
Smax = 13.5; % capacity
Pmax = 5; % maximal charging/discharging power
eta = 0.92; % battery efficiency
eta_c = sqrt(eta); % charge efficiency
eta_d = 1/sqrt(eta); % discharge efficiency
beta = 0.1; % in case penalty term is applied
% CPLEX Manipulation (split between charging and discharging)
p = [p;p];
%% Wholesale Arbitrage
% Cost function (minimize for arbitrage (negative))
f = p; % Double column vector for linear objective function
% Constraints
a1 = eye(length(p));
a2 = a1*-1;
tril1 = tril(ones(length(p)/2));
tril1 = tril1 * eta_c;
tril2 = tril(ones(length(p)/2));
tril2 = tril2 * eta_d;
a3 = [tril1, tril2];
a4 = a3*-1;
b1(1:2*length(p),1) = Pmax;
b2(1:length(p),1) = Smax/2;
lb1(1:length(p)/2,1) = 0;
lb2(1:length(p)/2,1) = -inf;
ub1(1:length(p)/2,1) = inf;
ub2(1:length(p)/2,1) = 0;
Aineq = [a1; a2; a3; a4]; % Linear inequality constraint: Aineq*x <= bineq.
bineq = [b1; b2];
Aeq = []; % Linear Equality constraint: Aeq*x = beq
beq = [];
lb = [lb1; lb2]; % Lower and upper bounds
ub = [ub1; ub2];
sostype = repmat('1', [1, length(p)/2]); % Replicate 1 time vertically, n times horizontally.
v1 = 1:length(p); % Create Vector
v2 = reshape(v1, [], 2)'; % Reshape Vector To 2-Row Matrix
sosind = mat2cell(v2, 2, ones(1,size(v2,2))); % Create Cell Array
v3(1:length(p)/2,1) = 0;
v4(1:length(p)/2,1) = 1;
v5 = [v3 v4]';
soswt = mat2cell(v5, 2, ones(1,size(v5,2)));
ctype = repmat('C', [1, length(p)]); % Replicate 1 time vertically, n times horizontally.
% Solver - IBM ILOG CPLEX
options = cplexoptimset;
options.Display = 'on';
[x,fval] = cplexmilp(f,Aineq,bineq,Aeq,beq,sostype,sosind,soswt,lb,ub,ctype,options);
Does anybody see the flaw here? The vector given by Data.RAW.Marginal_Prices looks like this:
51,52 51,52 51,52 51,52 67,30 67,30 74,01 74,01 74,01 74,01 74,01 74,01 74,01 74,01 74,01 74,01 74,01 74,01 74,01 74,01 74,01 67,30 67,30
Thanks a lot! MathiascplexoptimizationconstraintmatrixWed, 03 Oct 2018 10:35:41 GMTMathias_RWTHOptimization Constraint: One of every two variable pairs must be zero!
https://developer.ibm.com/answers/questions/471330/optimization-constraint-one-of-every-two-variable.html
Dear Community,
I ran into a problem I just couldn't solve:
I apply CPLEX to solve an optimization function as follows, with x being of the dimension of [2*8760 x 1]:
fun = @(x) x(:).'*p(:);
Now, I want to constrain that for every two elements of x, one must equal zero. Means, either x1 or x2 is zero; the same for the elements x3 and x4, x5 and x6 and so on...
Doing so, I can of course only use the constraint syntax as follows:
- a) Aineq*x <= bineq
- b) Aeq*x = beq
So, I would have to define either Aineq or Aeq and bineq or beq to achieve this constraint. Does anybody see any solution here? I am on the edge of losing my mind...
I am really looking forward to your thoughts on this! Thanks a lot!cplexoptimizationconstraintmatrixThu, 20 Sep 2018 15:45:57 GMTMathias_RWTHHesse Matrix is not positively definite - empty multilevel model
https://developer.ibm.com/answers/questions/461953/hesse-matrix-is-not-positively-definite-empty-mult.html
I am currently working on a multilevel model on the individual and small area effect on health which is why I am conducting a linear multilevel analysis with SPSS 24. When modelling the data in an empty model (only including outcome (birth weight) and the group identifier variable (about 80 level 2 units) , the following error occured:
"The final Hessian matrix is not positive definite although all convergence criteria are satisfied. The MIXED procedure continues despite this warning. Validity of subsequent results cannot be ascertained."
SPSS delivers all the required outputs, but the covariance and standard error for the random intercept are zero.
The problem seems to be a filter variable that is included which eliminates all multiple (n=21) and preterm births (n=50). If the multiple births are excluded, the error message occurs. And I can't imagine why, because the number of excluded cases is very low and the variance in the outcome is still high. If only preterm births are excluded, no error message occurs. Including these two variables in the model as covariates seems unwise from a content-related point of view, as these would explain the biggest part of the model. When I continue to include more variables in the model, the error message disappears; the covariance parameter for the random intercept is not significant.
I have tried all the tips I found here in the forum and many others such as: another covariance structure (VC, Identity, UN), increasing the number of iterations, standardizing the variables, trying other models (GENLIN mixed - logistic, Poisson, linear) but none worked out.
Is there anything else I could try? Or is a multilevel model not the right choice for my data?errorfiltermatrixmixedmodelsTue, 31 Jul 2018 19:48:03 GMTLisaWHow to create a confusion matrix inside a node in Modeler 18.1?
https://developer.ibm.com/answers/questions/432825/how-to-create-a-confusion-matrix-inside-a-node-in.html
Hi,
I am trying to create a confusion matrix in a node using python library sci-kit. I tried python script in execution tab in a stream but didn't work.Can you please tell me how to import python libraries or script code into the nodes? or Is there any other way to create matrix without coding inside the modeler?
Thanks!modelerpythonlibrarymatrixWed, 21 Feb 2018 16:07:54 GMTSid GorthyHow do I get a polychoric matrix (correlation) ?
https://developer.ibm.com/answers/questions/415859/how-do-i-get-a-polychoric-matrix-correlation.html
I need to get a polychoric matrix by spsscorrelationmatrixWed, 29 Nov 2017 15:16:32 GMTmayra_blancoHow Do i Select MIP Probing Level on docplex?
https://developer.ibm.com/answers/questions/410885/how-do-i-select-mip-probing-level-on-docplex.html
I was wondering if you could let me know how i could assign the probing level on docplexpythoncplexdocplexcloudmatrixFri, 03 Nov 2017 18:50:16 GMTgknairSPSS: Compute distance matrix w/ weighted cases (PROXIMITIES)
https://developer.ibm.com/answers/questions/383780/spss-compute-distance-matrix-w-weighted-cases-prox.html
Hi!
I am given a matrix with products as variables and product functions as cases. For example, if a product x has a function y, it is indicated in the matrix as 1 (so it's binary).
Now I want to use ALSCAL to have multidimensional scaling. The problem is, that every product function has a specific weight. So the distance between two products generated by PROXIMITIES has to be larger, if they are different in a higher weighted product function compared to a lower weighted product function.
But PROXIMITIES ignores the weighting variable. Do you guys know a solution?
I use the Euclidean distance.
Best wishes,
PeterspssmdsweightmatrixWed, 28 Jun 2017 14:36:24 GMTpete.rHow do I calculate the math behind the structure matrix values for discriminant analysis? I need to understand the math behind it.
https://developer.ibm.com/answers/questions/371546/how-do-i-calculate-the-math-behind-the-structure-m.html
I need to understand how to calculate the structure matrix. I found an equation, but do not know to to physically calculate the values.spssstatisticsmatrixstructuremathstructureddiscriminantThu, 27 Apr 2017 15:40:54 GMT55yo1i4u5oThe results for Pattern and Structure matrix from varimax and promax when kappa is equal to 1 differ. How would be this possible?
https://developer.ibm.com/answers/questions/365768/the-results-for-pattern-and-structure-matrix-from.html
The results for Pattern and Structure matrix from varimax and promax when kappa is equal to 1 differ. How would be this possible?patternmatrixstructureWed, 29 Mar 2017 18:23:27 GMTChristos_PHow to get Pearson correlation coefficient from SSCP Matrix?
https://developer.ibm.com/answers/questions/308033/how-to-get-pearson-correlation-coefficient-from-ss.html
Please assist me to resolve this problem! Thank you so much!
Look at the following SSCP Matrix. Calculate the Pearson correlation coefficient between fungus intake and fear of orthodontics.![alt text][1]
[1]: /answers/storage/temp/9725-screen-shot-2016-10-02-at-10149-am.pngcorrelationmatrixpearsonSun, 02 Oct 2016 04:15:56 GMTyyamImporting Similarity Matrix,Importing similarity matrix
https://developer.ibm.com/answers/questions/294454/importing-similarity-matriximporting-similarity-ma.html
I’m planning on conducting a similarity sort. The resulting output will be a similarity (or dissimilarity) matrix. I currently have the base SPSS module and am wondering if I need to upgrade modules to be able to import this matrix data and then run analyses (proximity mapping, clustering, factor analysis, etc.).
Any advice on the best way to import a similarity matrix and run the analysis would be greatly appreciated.statisticsimportmatrixWed, 10 Aug 2016 15:07:25 GMTmckctWhere can we find the documentation for hardware and software requirement regarding FileNet Content Engine?
https://developer.ibm.com/answers/questions/263038/where-can-we-find-the-documentation-for-hardware-a.html
Where can we find the documentation for hardware and software requirement regarding FileNet Content Engine on different versions?ecmsupportfilenetp8nafncmcpecompatibilitymatrixrequirementFri, 08 Apr 2016 16:20:42 GMTWill He@IBM AnalyticsHow to use compatibility website for version of MQ agent that monitors WebSphere MQ 8.0?
https://developer.ibm.com/answers/questions/258546/how-to-use-compatibility-website-for-version-of-mq.html
We are looking for version of ITCAM for WebSphere MQ which supports WMQ 8.0.
We checked the compatibility web site, but were unable to find the information.
How can we generate compatibility report for MQ monitoring agent?itmv6itcammonitoringkmqmatrixcompatibility reportTue, 15 Mar 2016 20:26:27 GMTsushkCorrelating with N=1
https://developer.ibm.com/answers/questions/247889/correlating-with-n1.html
Dear reader,
For my masterthesis in neuropsychology I want to analyze MRI data. For every individual participating in the study, I have 10 brain signals, each from a different region in the brain. My goal is to correlate these brain regions to each other, producing a correlation matrix for each participant. I can produce a correlation matrix based on groups, but can't make it work for just one individual.
My final goal is to produce new variables, where an average correlation is produced for each of my participants. For example: the correlation for participant 1 between brain region 1 and brain region 2 is .75. Then I'd want to make a new variable "Correlation1-2" which has the score .75 for participant 1.
I hope I have made my problem clear, and hope to find some answers here, as an extended internet search hasn't provided me with a solution.
Thanks in advance!
DavidspsscorrelationmatrixWed, 13 Jan 2016 11:08:28 GMTDavidStatsHow can I work with matrix with DOCplex?
https://developer.ibm.com/answers/questions/247096/how-can-i-work-with-matrix-with-docplex.html
Hello, I'm trying to do a matrix of variables in DOCcplex . I saw that exist continuous var matrix() but I can't do a normal matrix multiplication like matrix A * matrix B. I'm doing now with arrays but is too complicated because I can't do matrix multiplication as well. I've tried to do using numpy: np.matrix(model.integer var()) but it's not allowed.
For example, now i'm doing:
self.var_new_pattern = [[[self.integer_var(lb = 0, name = var_new_pattern_%d_%d_%d" %(m,j,i)) for j in range(0, 3)] for i in range(0,4)] for m in range(0,3)]
but then, when I want multiply my variable self.var_new_pattern with another one, I'm doing:
[self.var_new_pattern [m][j][k] * self.items[i] for i in range (0,3)] for j in range (0,4)......
Instead I just want to do: self.var_new_pattern * self.items
Is it possible in any way?
ThankspythoncplexdocplexcloudmatrixThu, 07 Jan 2016 14:34:49 GMTbetacampelloIs there an APM Support Matrix to show the platforms supported by a specific product?
https://developer.ibm.com/answers/questions/246629/apm-support-matrix.html
Where can I find the platforms supported by a specific product?
What are all the versions of an application monitored by a certain monitoring product in the APM arena?itmv6apmibmapmuiibmmv8supportagentsmatrixTue, 05 Jan 2016 07:42:34 GMTWalterPietroni