# Visualization of a multivariate function

This is somewhat vague, but suppose you have a black box function $f(x_1,x_2,\ldots,x_k)$, for which you have code, and you are interested in the behaviour of $f$ when the $x_i$ are i.i.d. standard Gaussian random variables. What are some good ways to visualize this function? To make it easier, we may assume that $k$ is smallish, say less than 10.

One particular relationship of interest is how $f$ varies with one of the input, say $x_i$. An easy way to visualize this relationship would be to sample the function for fixed values of $x_i$ while varying the other input (either in a structured way, or randomly, say), then box-plotting, which could show how the mean trend is affected by $x_i$, but also whether the scatter is affected (i.e. heteroskedasticity). However, interaction between $x_i$ and the levels of the other input might be masked by this approach.

What I am looking for is somewhat open-ended. I do not have a particular hypothesis that I am testing, but rather am looking for new ways of visualizing the response which might reveal peculiarities of the function.

• p.s. maybe this should be a community wiki? I'm not sure how that works... Sep 2, 2010 at 3:32
• if you don't give us more info on $f$ and on what type of characteristic then it seems to be community wiki but I am not sure neither :) Sep 2, 2010 at 5:47
• The fact that $f$ in undefined makes it a feed of a different multivariate visualization methods, so it should be CW. And now it is.
– user88
Sep 2, 2010 at 7:20
• it's fairly easy for me to fit $f$ to linear model, so we should assume that has already been done, and we are looking at the residual from that fit. As I mentioned in the question, I am looking for interesting facts about the function, so I don't yet know what I might find. Because of this open-ended nature, I thought maybe it should be a CW. I am still not sure on how one decides whether a Q should be CW. Sep 2, 2010 at 17:25
• At first blush this question seems purely mathematical: visualizing the function has nothing to do with the distribution of its arguments. However, the reference to "heteroskedasticity" suggests you're really trying to visualize an object that is more explicitly represented as $f(x_1, ..., x_k) + \epsilon$ or more generally as $g(f(x_1, ..., x_k), \epsilon)$ where $epsilon$ is a zero-mean random variable and $g(z,0) = z$ for all z. Isn't this just a response-surface analysis?
– whuber
Sep 2, 2010 at 19:42

Given that you are at the initial, exploratory stages of the analysis I would start simple. Consider sampling your inputs using a Latin Hypercube strategy. Then, a tornado chart can be used to get a quick assessment of the multiple,one-way sensitivities f() has to the various input variables. Here is an example chart (from here)

This chart is not that interesting, but an interpretation would be "NPV is most sensitive to Shipments, all other things being equal. But, the sensitivity is mostly on the upside, which is good. The Escalation variable induces sensitivity into NPV, but what looks to be skewed negatively a bit...".

You could do something similar for Mean(f) on the X-axis as well as Var(f)

Given what you find from some first glance visualizations like this, you could then slice and dice more and focus on specific variables or relationships between variables. Maybe you can revisit this thread in coming months and post the visualizations you found useful :)

Just a thought, although I've never tried it.

• you could obtain a large number of values from the function across different parameter values
• take a tour of the resulting data in ggobi (check out Mat Kelcey's video)
• ggobi looks interesting, but I am repelled by the xml data format. maybe I'll get over that, but it is not high priority. Sep 2, 2010 at 22:55
• @shabbychef Then check out the interface from R called rggobi ggobi.org/rggobi Sep 3, 2010 at 2:30
• Bump for rggobi. I just downloaded it after reading @shabbychef's comment and it changed/rocked my world. Sep 3, 2010 at 18:39

You could apply some sort of dimensionality reduction technique like principal components and plot the value of the function as you vary the first, second, third etc. principal components, holding all others fixed. This would show you how the function varies in the directions of the maximal variance of the inputs.

• The inputs are assumed to be iid Gaussian, implying there is no direction of maximal variance. But perhaps I have misinterpreted this assumption?
– whuber
Sep 2, 2010 at 22:07