From: Bruno Luong on
"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hp05u1$rdg$1(a)fred.mathworks.com>...
> "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hp055k$fde$1(a)fred.mathworks.com>...
> > "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hp03qv$o35$1(a)fred.mathworks.com>...
> > >This results in NaNs in certain parts of the graph, were the samples fall outside the upper and lower bounds of the LSF data.
> >
> > No, in the graphs show the four corner (+/-7,+/-7) fall outside the range (r=7) but the results are extrapolated with finite values; take look again.
> =======================
>
> Then the OP hasn't shown the code that actually generated the plots. In the posted code, interp1() wasn't called with an extrap option. That makes finite values for r>7 impossible

Yes, then try his code with 'extrap' then you get the exact same graphics as he showed (including negative values). I'm sure you knew it already.

Bruno
From: Matt J on
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hp05kl$mu9$1(a)fred.mathworks.com>...
> "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hp03qv$o35$1(a)fred.mathworks.com>...
> > The OP claimed to see negative values there, but there are none.
>
> Yes there *are*, because he extrapolates. What he said is *correct* and I have verified it.
======

Again though

(1) That's not apparent from the posted code. I tested the posted code and got NaNs, just as the interp1 doc predicts.

(2) It would be fixed by zero-padding LSF out to a sufficiently large radius
From: Bruno Luong on
"Royi Avital" <RoyiREMOVEAvital(a)yahoo.com> wrote in message <hp069o$3mv$1(a)fred.mathworks.com>...
>
> I try running your code yet it wouldn't work (Matlab 2010a, Downloaded the file you referred me to).

You need to download QPAS solver, or use Matlab QUADPROG (optimization toolbox). The other quadratic programming engine (minqdef) is not good and cannot handle shape constraints. The QPAS solver downloading needs to be approved by the author. Note that also QPAS for 64bit window is not supported. I have request the author for extension for this platform, but it is still obviously not done. Contact me privately if you are in a hurry and you do not run Matlab under Windows 64-bit OS.

The SLM tool requires optimization toolbox. If you can't run mine may be you don't have better luck with runing SLM tool.

Bruno
From: Royi Avital on
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hp07vl$11g$1(a)fred.mathworks.com>...
> "Royi Avital" <RoyiREMOVEAvital(a)yahoo.com> wrote in message <hp069o$3mv$1(a)fred.mathworks.com>...
> >
> > I try running your code yet it wouldn't work (Matlab 2010a, Downloaded the file you referred me to).
>
> You need to download QPAS solver, or use Matlab QUADPROG (optimization toolbox). The other quadratic programming engine (minqdef) is not good and cannot handle shape constraints. The QPAS solver downloading needs to be approved by the author. Note that also QPAS for 64bit window is not supported. I have request the author for extension for this platform, but it is still obviously not done. Contact me privately if you are in a hurry and you do not run Matlab under Windows 64-bit OS.
>
> The SLM tool requires optimization toolbox. If you can't run mine may be you don't have better luck with runing SLM tool.
>
> Bruno

I do have the Optimization Pack.
I can run SLM, yet can't figure how to you use it properly to my case.
From: Matt J on
"Royi Avital" <RoyiREMOVEAvital(a)yahoo.com> wrote in message <hp18i5$eeh$1(a)fred.mathworks.com>...

>
> I do have the Optimization Pack.
> I can run SLM, yet can't figure how to you use it properly to my case.
====================

Well, as I've been saying, we can't know either, since you haven't explained what caused your LSF to be truncated and explained only partially what it has to look like when extrapolated. If there is no smoothness requirement on the extrapolation (you haven't mentioned any) then you don't need the SLM tool at all. Just extrapolate with zeros.

If you need to extrapolate in a way that preserves slope at the boundary, you might do something like this for the right hand side extrapolation

y=[LSF(end), zeros(1,N-1)];
x=1:N
weights=logical(y);

prescription=slmset('decreasing,'on','minvalue',0,...
'leftvalue',y(1),'leftminslope',something, 'leftmaxslope',something,'weights',weights);

model=slmfit(x,y,prescription);