How to include a normal inverse function power Pivot DAX? - dax

I am interested in calculating confidence intervals in PowerPivot using DAX. Unfortunately the formula editor doesn't show a NORM.INV function.
Is this formula included in PowerPivot DAX?
Here's the formula I tried:
=Norm.Inv(.9, 0, 1)

It's part of the DAX statistical functions, read the docs: NORM.INV

Related

Model Evaluations (Precision,Recall, F1 Score) using Stratified K-Fold Cross Validation Machine Learning

I have a data Set on which i have applied Stratified K Fold Cross Validation and split the data into 5 folds. Then i have applied Logistic Regression.
For Evaluation i have got precision recall and f1 score for each fold.
Finally i have to report these evaluations in numbers (precision,recall and f1 score)
am i allowed to average precision for all the 5 folds to present just average value
same for recall and f1 score.
as i have list of five values for each evaluation score after K Fold.
Yes of course you can calculate the mean to get the mean performance over your 5 folds. You can also get the standard deviation of your 5 values. Applying a 5-fold cross-validation is equivalent to training your Logistic Regression model 5 times, so what you need to think about is what to do with the 5 values you get. Maybe you just want to get the max or min of them. It really depends on what kind of evaluations you want to report, which means it depends on real-life scenarios.
Hope my answer helps.

genetic algorithm matlab minimization

I would like to use the Optimization-ToolBox of Matlab that provide a tool for the Genetic Algorithms. I have a small equation (Score= alpha*(\sum(L[i])^(1/alpha) + Beta*(\sum(R[i])^(1/Beta)) that compute a score where L and R are vectors of values that I computed before and alpha and beta are parameters that I want to optimize via the GA. The constraint is that the scores should be close to another vector of scores called ground truth.
We can formalize this constraint by : " ||score - ground_truth_score||_2^{2}=0"
So for every \sum(L[i]) and \sum(R[i]), an Alpha and Beta would optimize the constraint defined before.
I'm trying to discover the GA in Matlab, however, I don't know how to formalize the constraint with the fitness function (the equation).
After reading this example, which i think is a similar problem as mine http://fr.mathworks.com/help/gads/examples/coding-and-minimizing-a-fitness-function-using-the-genetic-algorithm.html?prodcode=GD&language=fr
I made this objective function to manage the minimization of my problem, however i'm not sure if it's the right answer:
function y=parametrized_fitness_fct(x,ground_truth_score)
y=x(1)*(L^(1/x(1))) + x(2)*(R^(1/x(2))) + ground_truth_score;
% ground_truth_score, L and R are single values
end
FitnessFunction =#(x) parametrized_fitness_fct(x,ground_truth_score);
[x,score] = ga(FitnessFunction,numberOfVariables)%numberOfVariables=2
%x will be a vector containing the searched values "alpha and beta",
%and score is the score optimized to be close to the ground_truth_score

Display graph of x versus number of prime factors of x

I am trying to get wolfram alpha website to display a graph where you have x on one axis and the number of not necessarily distinct prime factors on the other axis. I tried this query:
plot f(x) = number of factor x
Did not work.
How can I do this? Thank you
After the usual lots of trial and error that WolframAlpha didn't understand, finally
WolframAlpha PrimeOmegaPlot link
The function you are looking for is called PrimeOmega in Mathematica.
Here is the doc
http://reference.wolfram.com/language/ref/PrimeOmega.html
where you can find a plot of the first 100 values.
It used to be quite simple to just enter a correct Mathematica statement into Wolfram Alpha and get its output but not anymore in the public version.
If you type PrimeOmega in Wolfram Alpha you will get its definition and the first few values in a table.
If you have access to Mathematica, use
DiscretePlot[PrimeOmega[n],{n,1,1000}]
and experiments with various options.

Excel Polynomial Curve-Fitting Algorithm

What is the algorithm that Excel uses to calculate a 2nd-order polynomial regression (curve fitting)? Is there sample code or pseudo-code available?
I found a solution that returns the same formula that Excel gives:
Put together an augmented matrix of values used in a Least-Squares Parabola. See the sum equations in http://www.efunda.com/math/leastsquares/lstsqr2dcurve.cfm
Use Gaussian elimination to solve the matrix. Here is C# code that will do that http://www.codeproject.com/Tips/388179/Linear-Equation-Solver-Gaussian-Elimination-Csharp
After running that, the left-over values in the matrix (M) will equal the coefficients given in Excel.
Maybe I can find the R^2 somehow, but I don't need it for my purposes.
The polynomial trendlines in charts use least squares based on a QR decomposition method like the LINEST worksheet function ( http://support.microsoft.com/kb/828533 ). A second order or quadratic trend for given (x,y) data could be calculated using =LINEST(y,x^{1,2}).
You can call worksheet formulas from C# using the Worksheet.Evaluate method.
It depends, because there are a lot of ways to do such a thing depending on the data you supply and how important it is to have the curve pass through those points.
I'm guessing that you have many more points than you do coefficients in the polynomial (e.g. more than three points for a 2nd order curve).
If that's true, then the best you can do is least square fitting, which calculates the coefficients that minimize the mean square error between all the points and the resulting curve.
Since this is second order, my recommendation would be just create the damn second order terms and do a linear regression.
Ex. If you are doing z~second_order(x,y), it is equivalent to doing z~first_order(x,y,x^2,y^2, xy).

What is the spaced repetition algorithm to generate the day intervals?

I am implementing a flashcard game and I want to implement spaced repetition. I don't need something complex like in SuperMemo, but simply space the learning based on the score for each card.
What I am looking for at the moment is how to calculate the number of days until a card is shown again, based on its score. I found that ZDT uses the list in the screenshot below (1, 2, 3, 5, etc.). Does anybody know how to dynamically generate this list (so that I can calculate beyond a score of 12)?
Or perhaps could someone guess what math function I could use to generate the numbers on the ZDT list? They increase exponentially.
It looks very similar to a logistic curve. I'll run a logistic regression on it and see what comes out.
Here is the data (plotted using WolframAlpha)
Here is the equation I got:
f(x) = 115/(1+2192*EXP(-0.79*x))
Here is the plot with the curve:
Unfortunately the curve isn't very accurate for small numbers.

Resources