# Sensitivity Analysis — Total Variation for a function with categorical arguments?

I have an application in sensitivity analysis of complex system models with moderately nonlinear interactions between arguments

• Arguments potentially dozens or hundreds in number
• Arguments mostly real-valued but some categorical with a handful of levels (unordered settings) per variable
• The outputs of interest are real-valued and highly interdependent, and respond well to the usual dimensionality reduction techniques
• Assume for present purposes that the model output is a single real number.

I have the compute resource to evaluate the model several hundred or a few thousand times, but not millions of times, and I will typically do this on random or Sobol'-gridded points in the design space, i.e. I will have the output value at a few thousand points randomly scattered in a few dozen dimensions.

I want to do the usual thing of assigning importance rankings to inputs and combinations of inputs using techniques from Saltelli et al -- see this paper to get a flavor. I want to estimate the total variation of the expectation of the model output conditional on one or a few inputs at a time.

I plan to do this by fitting a low-order smoothing spline through the space of one input, or a few possibly interacting inputs, plus the model output, and calculating the total variation of the smoother by numerical integration. The interacting sets will typically be three or four variables, so sparsity in high dimensions will never be an issue. I also know how to cross-validate and regularise the splines for optimal fit, and correct for randomness in the total-variation measure.

What I don't know is how to proceed when one or more of the inputs of interest is categorical. I can see what to do for a single binary-valued input, but anything more complex defeats me. I've wiki'ed and googled this up and down without success.

So to summarise the question:

Is there an extension of the concept of total variation to scalar real-valued functions with (possibly multiple) (more than binary) unordered categorical arguments?

and

Is there an explanation digestible by a mere engineer?

Thanks in advance, I hope, but I'm actively looking in multiple places and I'll update this post if I find anything useable elsewhere.

• If there are five categories, the variables can be treated as five-dimensional basis vectors, e. g., (0,1,0,0,0), that span the category space. Not sure why importance ranking will not work for such vectors. Can you explain? – Biswajit Banerjee Nov 3 '16 at 23:28
• Hi @biswajit-banerjee -- dummy variables, right? That begs the question of assigning importance before you can do the ranking, and as far as I know that traditionally involves something like delta variance with the variable free and then fixed (but at what level?), which is too expensive above a few dozen variables, especially when you want to freely explore interactions.I'm more interested in whether the concept of total variation can be extended to this situation, though I appreciate the input (I see from your timezone that you've taken time out from your working day, which is kind). – plucky_underdog Nov 3 '16 at 23:47
• Suppose that $A$, $B$, and $C$ are unordered values that can be inputs to a function $f$. What do you want the TV to be if f(A)=0, f(B)=100, and f(C)=50? The conventional concept of total variation depends on having an ordering. Do you want the maximum over the six permutations of $A$, $B$, and $C$? what makes sense for your application? – Brian Borchers Nov 5 '16 at 2:29
• Hi @brian-borchers -- I know what you're talking about, and I've been down that path as well. However, (a) Biswajit points out the representation of categories as dimensions, and (b) the multi-real-dimensional definition of TV doesn't depend on an ordering of the dimensions, so. Your suggestion of the most "variable" permutation sounds attractive: BAC -> 150, right?. The ordering might change elsewhere in the problem space. That would work for point wise integration, possibly at the expense of a local Travelling Salesman Problem. But that's just a guess! – plucky_underdog Nov 5 '16 at 11:06
• @brian-borchers Sorry, didn't realise I was talking to a professional mathematician. The reason I like your suggestion is that it seems to have faint resonance with the supremum definition of TV in Wikipedia, which looks like a copy from the Springer book which in turn points to stuff like this. Unfortunately my education is in engineering, not math, so I can't think clearly about generalized functions! – plucky_underdog Nov 5 '16 at 11:18