Compare Excel simulation results from two separate equations - excel

I am using Excel to build a product recommendation tool, which will take user inputs and use simple calculations to recommend the right product. The results will include a.) a product and b.) a numeric spec of that product.
There are two potential equations I can use in the underlying calculations. In testing, they frequently produce the same result. However, there are cases where they differ. I would like to use simulation with random numbers to understand the situations that produce different results.
Here's a simple structure:
User Input I (random numbers)
User Input II (random numbers)
Equation A Results - Product recommendation and numeric spec
Equation B Results - Product recommendation and numeric spec
Simulation Needs
how often are the results different? On what input conditions is this most likely to happen?
When the products are the same, but the numeric spec is different, what are the stats (stdev, average) of the numeric spec?
what equation is optimal to use in the recommender.
Monte Carlo simulation would seem suitable for this exercise. Formulas and macros are documented here and in videos. I'm struggling with the structure/syntax to compare the outputs of two different equations.

Related

Why is my independent t-test different in SPSS or Excel?

I want to compare the output of my simulation model to the observed data in various ways, like using an independent t-test to compare the means. However, when I do the independent t-test in SPSS, I get a different result than the independent t-test in Excel. I don't know why so I don't know which one I should use. Can anybody tell me why the results are different?
Here is the independent t-test in SPSS (with t-value 0,181 and p-value 0,857):
Here is the t-test: Two-Sample Assuming Equal Variances in Excel (also the t-test assuming unequal variances is different than the one in SPSS):
After running the TTest on your original data in SPSS, with the FULL data, I got perfectly matching results from spss and excel (see below).
The problem you had has to do with one case seemingly missing from your "observed" set (as noted by #TomSharpe).
This could be due to a simple error in copying the data to SPSS. In SPSS you had to have the two ranges in the same column - you may have done this manually with an error - in which case you should learn to use restructure commands, namely varstocases, to avoid such mistakes.
On the other hand, if the data is full but still a case seems to be missing from the analysis, you should check if the data is weighted by another variable. Weighted data can change the apparent number of observarions in the analysis, and of course change the results.
.

Small data anomaly detection algo

I have the following 3 cases of a numeric metric on a time series(t,t1,t2 etc denotes different hourly comparisons across periods)
If you notice the 3 graphs t(period of interest) clearly has a drop off for image 1 but not so much for image 2 and image 3. Assume this is some sort of numeric metric(raw metric or derived) and I want to create a system/algo which specifically catches case 1 but not case 2 or 3 with t being the point of interest. While visually this makes sense and is very intuitive I am trying to design a way to this in python using the dataframes shown in the picture.
Generally the problem is how do I detect when the time series is behaving very differently from any of the prior weeks.
Edit: When I say different what I really mean is, my metric trends together across periods in t1 to t4 but if they dont and try to separate out of the envelope, that to me is an anomaly. If you notice chart 1 you can see t tries to split out from rest of the tn this is an anomaly for me. in other cases t is within the bounds of other time periods. Hope this helps.
With small data the best is if you can come up with a good transformation into a simpler representation.
In this case I would try the following:
Distance to the median along the time-axis. Then a summary of that, could be median, Mean-Squared-Error etc
Median of the cross-correlation of the signals

Comparing two contingency tables

I have two 6x4 contingency tables for frequency data. They are based on the same type of sampling criteria of a number of discreet variables but for two condition (before and after). I would like to compare these statistcally to see how much - or not - they differ.
A Chi square related test seems appropriate but normally this gives a result in comparison to the theoretical to calculate the statistic. So in other words I need to swap the theoretical for the second table. Of course it doesn't have to be a basic chi square test - any other appropriate test would be ok.
I have access to XLSTAT, Excel and SPSS. And would appreciate some help on this.

Excel Solver, way to maximize two values?

I am a user of microsoft excels solver, and am pretty sure it is not possible to solve to maximize for two values. I was wondering if anyone might have another clever way to do this.
Basically I have a column of numbers between 1 and 30 that I need to look over about and pull out 9 to 10 values (out of 200) based on a couple other constraints. I would also like to not just maximize this value, but also a probability value (range from 0 to 1) that I would also like to maximize.
Adding them up won't work as that would grossly undervalue the probability value and multiplying may do the opposite by overvaluing the probability. Any Strategies to handle this problem would be greatly appreciated.
This is an example of multi-objective optimization, which has an extensive literature. As the Wikipedia article shows, this can lead to some pretty deep waters.
By far the easiest approach is that of linear scalarization. This refers to replacing a vector of 2 (or more) objective functions by a single (hence scalar) objective function which is a linear combination of the objective function. What you can do with the solver is to create 2 cells to hold the relative weights to assign to the two objectives. These will be 2 numbers in the range 0 and 1 which sum to 1. Then create a new objective function which is the SUMPRODUCT (linear combination) of these weights and the objectives. Then -- jut use the solver to optimize this objective function. If you aren't happy with the results -- adjust the weights. There is no one right answer. One of the advantages of this approach is that it allows a decision maker to clarify the relevant importance of the objectives.

Compute statistical significance with Excel

I have 2 columns and multiple rows of data in excel. Each column represents an algorithm and the values in rows are the results of these algorithms with different parameters. I want to make statistical significance test of these two algorithms with excel. Can anyone suggest a function?
As a result, it will be nice to state something like "Algorithm A performs 8% better than Algorithm B with .9 probability (or 95% confidence interval)"
The wikipedia article explains accurately what I need:
http://en.wikipedia.org/wiki/Statistical_significance
It seems like a very easy task but I failed to find a scientific measurement function.
Any advice over a built-in function of excel or function snippets are appreciated.
Thanks..
Edit:
After tharkun's comments, I realized I should clarify some points:
The results are merely real numbers between 1-100 (they are percentage values). As each row represents a different parameter, values in a row represents an algorithm's result for this parameter. The results do not depend on each other.
When I take average of all values for Algorithm A and Algorithm B, I see that the mean of all results that Algorithm A produced are 10% higher than Algorithm B's. But I don't know if this is statistically significant or not. In other words, maybe for one parameter Algorithm A scored 100 percent higher than Algorithm B and for the rest Algorithm B has higher scores but just because of this one result, the difference in average is 10%.
And I want to do this calculation using just excel.
Thanks for the clarification. In that case you want to do an independent sample T-Test. Meaning you want to compare the means of two independent data sets.
Excel has a function TTEST, that's what you need.
For your example you should probably use two tails and type 2.
The formula will output a probability value known as probability of alpha error. This is the error which you would make if you assumed the two datasets are different but they aren't. The lower the alpha error probability the higher the chance your sets are different.
You should only accept the difference of the two datasets if the value is lower than 0.01 (1%) or for critical outcomes even 0.001 or lower. You should also know that in the t-test needs at least around 30 values per dataset to be reliable enough and that the type 2 test assumes equal variances of the two datasets. If equal variances are not given, you should use the type 3 test.
http://depts.alverno.edu/nsmt/stats.htm

Resources