Friday, November 24, 2017

We were talking about linear regression. One of the best advantage of a linear regression is the prediction with regard to time as in independent variable. When the data point have many factors contributing to their occurrence, a linear regression gives an immediate ability to predict where the next occurrence may happen. This is far easier to do than come with up a model that behaves as good fit for all the data points. It gives an indication of the trend which is generally more helpful than the data points themselves. Also a scatter plot s only changing in one dependent variable in conjunction with the independent variable. Thus lets us pick the dimension we consider to fit the linear regression independent of others. Lastly, the linear regression also gives an indication of how much the data is adhering to the trend via the estimation of errors.
Non-linear equations can also be "linearized" by selecting a suitable change of variables.  This is quite popular because it makes the analysis simpler. But reducing the dimensions is prone to distortion of the error structure. It is a oversimplification of the model.  It violates key assumptions and impacts the resulting parameter values. All of this contributes toward incorrect predictions and are best avoided.  Non-linear squares analysis has well defined techniques that are not too difficult with computing. Therefore it is better to do non-linear square analysis when dealing with non-linear inverse models.
#codingexercise
double maximizeScalarProductWhenSwappingIsAllowed(List<int> A, List<int>B) 
{ 
assert (A.Count == B.Count); 
A.Sort(); 
B.Sort() 
A.Reverse(); 
B.Reverse(); 
Return GetScalarProduct(A,B); 
} 
Double GetScalarProduct(List<int>A, List<int>B) 
{ 
Double result = 0; 
For (int I = 0;  < A.Count; i++) 
{ 
result += A[I] * B[I]; 
} 
Return result; 
} 

No comments:

Post a Comment