On Wed, Jun 11, 2014 at 4:30 AM, William Lane <
wilan...@gmail.com> wrote:
> I am trying to develop a functional surrogate model to reduce simulations.
> Essentially I simulated my system over a wide range of parameters
> (predictors), and now I want to use the results to derive a function based
> on the predictors. It is really just a case of non-linear multiple
> regression, where I need the final model, e.g., f = a*x^2 + b*(y - c)^2 +
> d*z + ...
>
> I have yet to find something that will do this. I have tried using a MARS
> approach (py-earth and earth packages) but can't get them to provide
> anything by piecewise linear models (I'd like to get piecewise quadratic or
> spline at the least). To give you an idea of the trends, I've attached a
> figure (of 5 predictors: phi, Us, Vs, Dcyl, acyl).
>
> If you have any recommendations, please share them, I am desperate!
I have no practical experience with response surface modeling.
Kernel regression or RBF in scipy would work but don't create
"parameters", we need the entire sample to predict.
(penalized) splines should also work, but you will also have to model
interaction effects.
However, I'm a fan of series approaches, and would just try out
different basis functions instead of using piecewise or local function
estimation. Your trends look pretty smooth and don't have clear
breaks, AFAICS.
Since I just saw this yesterday when I looked up what GEP Box was
doing besides time series analysis:
some classes of nonlinear models might provide a more parsimonious
parameterization
http://en.wikipedia.org/wiki/Polynomial_and_rational_function_modeling#Rational_function_models
--
Series expansion (including splines) or polynomials are nice because
we can use linear models and the extra features we have.
I don't know how far numpy got with multivariate polynomials, Charles
had code for multivariate Bernstein polynomials.
If multivariate polynomials are not available, I would just start with
univariate polynomials, for example Chebychev
(numpy.polynomial.chebvander), and add interaction terms (the design
won't be orthogonal, but that doesn't really matter).
Another type that I bump into more often recently are fractional
polynomials that don't just have positive integer powers, but also
negative, fractional powers and logs.
http://www.stata.com/stata13/fractional-polynomials/ and the link to
the manual entry at the bottom. Something I want to try out soon,
because Stata has it, and it looks very useful and easy to implement.
In terms of estimation, I would heavily overparameterize and penalize.
Maybe some of scikit-learn methods will help to regularize or select
variables.
But I'm not a big fan of default penalization priors when we have
specific information about the structure of the model.
I would choose stronger penalization for higher order terms and
interaction effects, and not or only weakly penalize low order effects
(constant, linear trend and maybe one more).
I only worked with L2 penalization so far (sparse is only really
interesting if we have a huge number of regressors, IMO)
https://picasaweb.google.com/106983885143680349926/Joepy?noredirect=1#5688102596988651330
Similar for splines, the common penalizations is by the difference in
consecutive parameters, or on total variation of derivatives (? I
never tried) not a Ridge or L1 uniform/standardized penalization to
zero.
aside 1: Since this is just "curve-fitting", it won't be relevant that
the final results statistics (standard errors and so on) can or will
be heavily biased because of the specification search.
It would be useful to have a response surface category in statsmodels,
but there is currently nothing out of the box available.
aside 2:
In case someone thinks I'm doing Bayesian analysis with informative prior:
No, I'm not. I'm doing classical analysis that "just happens" to use
"prior" information and that produces the same parameter estimates as
a normal-normal conjugate Bayesian analysis. And, I use robust
classical standard errors for the parameter estimate. :)
Josef