6 years, 26 days

## Doing linear regression with Maple shoul...

Doing linear regression with Maple should not (a priori) be a complex task.
Look to Statistics:-LinearFit.

But your question leaves me dubious: why do you talk about stepwise regression in the title and not in your text?
Are you REALLY interested in stepwise regression (or an alternative like ridge or Lasso regression, ...?), i.e. a method that builds a model based on a balance between its complexity (the number of parameters it contains) and the quality of its "fit" (R^2 for example)?

@Kitonum

Great, I vote up

## @bstuan  Sorry to hear that. I sus...

@bstuan

Sorry to hear that.
I suspect that a reorganization between Assistants and Tutors must have taken place since.
Hope you will get a more appropriate answer

## @acer  Sorry for this late reply. ...

@acer

I appreciate your many workarounds, particularly Matrix([LengthSplit(L,n)]) which is very useful in my case
(this "famous" list is produced by the command Return([seq(seq(Item(..), i=1..m), j=1..n) in a Maplet based application)

## @acer  Thank you acer, case c...

@acer

Thank you acer, case closed.

## @Kitonum Of course, but that was no...

Of course, but that was not my point.
Let's suppose you have  list L of PxQ strings and you want to organize these strings under a PxQ spreadsheet M.
It would be easier to write
M := Matrix(P, Q, L)
M := Matrix(P, Q, (i, j)-> L[j+Q*(i-1)]) (for instance)

And my point was "why is this possible for a list of numbers or names, and not for a list of strings?
(Acer said It works in Maple 2017 onwards)

## @Nikol I believe you use the term c...

I believe you use the term copula without knowing what it really means.
Look here Copula_(probability_theory)

" In mathematics, a closed-form expression is a mathematical expression that uses a finite number of standard operations. It may contain ...., but usually no limitdifferentiation, or integration. ..." .
(https://en.wikipedia.org/wiki/Closed-form_expression)

## @Nikol So there are no statistics o...

So there are no statistics or probabilities behind it.
So why do you use the term copula?

"Now I've got a function f"... No, you don't have a closed-form function in the mathematical sense, you have a procedure which takes as input a couple of values (channels) and returns another scalar value.

I guess that the main question is "Why do you want to fit your histogram ?"

## @Nikol I think you didn't corre...

I think you didn't correctly inderstand the meaning of @tomleslie's reply ".[Lowess]...will not return a "closed-form symbolic" function.
Tom is right, Lowess is a smothing deterministic process, but this doesn't mean it possesses a closed form
(
This term is ambiguous but a closed form is generally considered as some analytical "compact/simple/concise" algebraic expression (no derivatives nor integrals) using only simple operators and "simple" functions.
For instance the error function erf(x) is a very compact expression, but it is not a closed-form of the CDF of some gaussian random variable.

If we omit the term "compact", then Lowess has a closed form, but it is so complex that it is generally considered not closed because we cannot understand it while looking at it.

As an example let us consider a pseudo random number generator (PRNG). This is a perfectly deterministic process, based on elementary functions (+, *, mod generally). Given some seed s, there exists theoritically a function f(x, n) which gives the value of the nth pseudo random number. But this function is so complex that we say that this PRNG soes'n have any closed form.

Other examples are the solution of an ODE or the expression the determinant of a large square matrix M with abstract coefficients (even if det(M) is perfectly defined with only 6 characters).

A last one is a gaussian process emulator (Kriging for instance). Even if the expression, let's say f(x), of this emulator is quite simple, one considers that f(x) has not a closed-form. This because f(x) is, in the simplest case, defined by matrix-vector products: unfolding this compact matrix expression of f would return an intractable closed form/
)

Look here to see what Lowess is

 > restart
 > with(Statistics):
 > X := Sample(Uniform(0, Pi), 200): Yerror := Sample(Normal(0, 0.1), 200): Y := map(sin, X) + Yerror: L := CurveFitting:-Lowess(X, Y, fitorder = 1, bandwidth = 0.3):
 > # L is not a function of x defined by a closed form but a procedure # which, for a given vlue of x, returns the perdicted value of y(x). # # Look at this eval(L)  (1)
 > -

Here is very simple example of Ordinary Least Squares (OLS) where the model a*x+b is fitted on 4 abstract data
Would you say that the model has a closed form?
Think to what it's expression would be for a larger number of points.
OLS.mw

## Given the term copula you use et the end...

Given the term copula you use et the end of your post, I understand that your "256 by 256 matrix" is aimed to represent the bivariate distribution of two dependent random variables X and Y.
Am I riight?

## @vv  You're right. I knew that...

@vv

You're right.
I knew that, but I didn't think that might be what the OP wanted (I didn't focused on complex functions neither, an example could probably help figuring out the true problem).
@janhardo's last comment seems to prove you right

@acer

(which raises the question of how long a question remains "alive" and beyond which its author no longer reads the answers.)

Anyway I thank you for this alternative of @dharr 's by voting up

## @dharr Perfect!(among other things ...

@dharr

Perfect!

(among other things I particularly appreciate the command T,X,V,PX,PV:=rhs~(sol)[ ] )

PS: "I assume you have a more complex case in mind".. you assume well :-)

@Kitonum

Great, I vote up

## @acer What aboutf := "....&quo...

@acer

```f := "....":