I have a dataset with labels and datapoints, problem is that rather then a classification problem I want to get a linair estimator, for example :

dataset=prdataset([2,4,6,8]',[1,2,3,4]') testset=prdataset([3,5,7,9]') classifier=dataset*ldc %should probably be changed? result=testset*classifier

result.data now becomes

ans = 1.0e-307 *

0.2225 0.2225 0.2225 0.2225

0.2225 0.2225 0.2225 0.2225

0.2225 0.2225 0.2225 0.2225

0.2225 0.2225 0.2225 0.2225

which is very wrong.

Ideally it would be [1.5,2.5,3.5,4.5]' or something to close to it. Any idea how to do this in PRtools or in something simulair? This is a linair dependancy but I would also like to be able to play around with other types of dependancies? Also it would be a huge bonus of the system was somewhat clever about NaN values which heavily polute my real dataset. I have already found that linearr class but when I use that I get weirdly sized datasets in return,

dataset=prdataset([2,4,6,8]',[1,2,3,4]') testset=prdataset([3,5,7,9]') classifier=dataset*linearr%should probably be changed? result=testset*classifier

gives me the values

0.1000 -0.3000 -0.7000 -1.1000

-0.5000 -0.5000 -0.5000 -0.5000

-1.1000 -0.7000 -0.3000 0.1000

-1.7000 -0.9000 -0.1000 0.7000

which is again incorrect.

In chat they suggested using .* instead of * that resulted in Error using * Inner matrix dimensions must agree.

Error in linearr (line 42)

beta = prinv(X'*X)*X'*gettargets(x);

Error in prmap (line 139)

[d, varargout{:}] = feval(mapp,a,pars{:});

Error in *

Error in dyadicm (line 81)

v1 = a*v1; % train first mapping

Error in prmap (line 139)

[d, varargout{:}] = feval(mapp,a,pars{:});

Error in *

In the linearr code.

Just to be clear I'm looking for a way to, given a large set of values find the set of polynomials that best describes their relation (where the polynomials that are considered is a parameter of the program, in the example 1st order). So in our example the polynomial is 1/2a+0. In my final version I want to use a larger number of parameters (10-20) and it may require quadratic estimation.