Message Boards Message Boards

Regression Formulation

Posted 9 years ago

Hi Everyone! I am trying to formulate a regression problem in the form of the following equation (which is from a portfolio optimization example code found here)

Eq. 1 - Portfolio Optimization Equation enter image description here For the regression we have that enter image description here Which simplifies to: enter image description here? Thus this should be the same form as Eq. 1? With the Betas=x, Lambda=1, Q=X'X and r = 2y'X? Since y'y is a scalar it can be ignored?

The reason I ask is because I want to modify some code (http://in.mathworks.com/help/optim/examples/mixed-integer-quadratic-programming-portfolio-optimization.html) so that I can run a regression problem instead, but the code is giving some errors (not converging). I would like help in verifying my approach of reformulating this problem is correct?

Thank you, Priyan.

POSTED BY: Priyan Fernando
2 Replies

Hi Otto,

Thank you for your comments. Yes I am indeed trying to run a regression (chose x to minimize ||Ax-b|| ) but with the additional constraint that, for the elements of x: x=0 or lb<= x <= ub. Here lb/up are the lower and upper bounds respectively. If I only had the constraint: lb<= x <= ub then I could solve that using quadratic programming. The complication arises because elements of x could also be 0.

I think solving there is no built in function to solve this in Mathematica? I have however spotted such a feature in Matlab (http://in.mathworks.com/help/optim/examples/mixed-integer-quadratic-programming-portfolio-optimization.html). Do you know of how to solve this in Mathematica? The actual problem is also quite large, e.g. x has 20000 elements, and A is of dimension 20000x500.

Thanks!

POSTED BY: Priyan Fernando

Priyan,

It looks like you are solving the standard linear regression problem (minimum distance from a subspace to a given point). This problem is solved in Mathematica with the LinearModelFit function. This function not only gives you the functional form of the best fit, but also a whole array of statistical results from the fit which is probably more than you will ever need (including confidence intervals, ANOVA tables, prediction bands, etc.). The list of properties (shown below) has 64 entries. Have you tried to use this function for the regression problem you are trying to solve? The identification you describe looks correct, but it is impossible to say why your code is giving an error without looking at it.

Regards,

OL.

{"AdjustedRSquared", "AIC", "AICc", "ANOVATable", \
"ANOVATableDegreesOfFreedom", "ANOVATableEntries", \
"ANOVATableFStatistics", "ANOVATableMeanSquares", \
"ANOVATablePValues", "ANOVATableSumsOfSquares", "BasisFunctions", \
"BetaDifferences", "BestFit", "BestFitParameters", "BIC", \
"CatcherMatrix", "CoefficientOfVariation", "CookDistances", \
"CorrelationMatrix", "CovarianceMatrix", "CovarianceRatios", "Data", \
"DesignMatrix", "DurbinWatsonD", "EigenstructureTable", \
"EigenstructureTableEigenvalues", "EigenstructureTableEntries", \
"EigenstructureTableIndexes", "EigenstructureTablePartitions", \
"EstimatedVariance", "FitDifferences", "FitResiduals", "Function", \
"FVarianceRatios", "HatDiagonal", "MeanPredictionBands", \
"MeanPredictionConfidenceIntervals", \
"MeanPredictionConfidenceIntervalTable", \
"MeanPredictionConfidenceIntervalTableEntries", \
"MeanPredictionErrors", "ParameterConfidenceIntervals", \
"ParameterConfidenceIntervalTable", \
"ParameterConfidenceIntervalTableEntries", \
"ParameterConfidenceRegion", "ParameterErrors", "ParameterPValues", \
"ParameterTable", "ParameterTableEntries", "ParameterTStatistics", \
"PartialSumOfSquares", "PredictedResponse", "Properties", "Response", \
"RSquared", "SequentialSumOfSquares", "SingleDeletionVariances", \
"SinglePredictionBands", "SinglePredictionConfidenceIntervals", \
"SinglePredictionConfidenceIntervalTable", \
"SinglePredictionConfidenceIntervalTableEntries", \
"SinglePredictionErrors", "StandardizedResiduals", \
"StudentizedResiduals", "VarianceInflationFactors"}
POSTED BY: Otto Linsuain
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract