From: Kurt L on
Hi, I'm trying to estimate an inverse cdf and I'm having the following problems:

When I estimate:
x1 = ksdensity(x,u1,'function','icdf');
I get negative values for x1 even though the supports for both u1 and x are positive.
When I try to correct this by estimating:
x1 = ksdensity(x,u1,'function','icdf','support','positive');
I get the following set of error messages:
"??? Input argument "foldpoint" is undefined.

Error in ==> ksdensity>compute_pdf_cdf at 508
foldpoint = log(foldpoint);

Error in ==> ksdensity>compute_initial_icdf at 609
[Fi,xi,u] = compute_pdf_cdf(xi,true,m,L,U,weight,kernel_c,...

Error in ==> ksdensity>compute_icdf at 642
[Fi,xi,cutoff,u] = compute_initial_icdf(m,u,L,U,weight,cutoff,...

Error in ==> ksdensity at 118
[fout,xout]=compute_icdf(xi,xispecified,m,u,L,U,weight,cutoff,..."

I get the same error messages when I specify the bounds of the support as [L U]. I have also tried changing the bandwidth without specifying the support, but haven't been successful at obtaining a positive support this way.
Any advice?
From: Peter Perkins on
On 3/5/2010 4:16 PM, Kurt L wrote:
> When I try to correct this by estimating:
> x1 = ksdensity(x,u1,'function','icdf','support','positive');
> I get the following set of error messages:
> "??? Input argument "foldpoint" is undefined.
>
> Error in ==> ksdensity>compute_pdf_cdf at 508
> foldpoint = log(foldpoint);

Kurt, I can't reproduce this with the current version of KSDENSITY,

x = gamrnd(2,2,1000,1);
u1 = rand(1000,1);
x1 = ksdensity(x,u1,'function','icdf','support','positive');

so it may be something special about your data. But by the line numbers in that error msg, it appears that you're using an older version, and there have been changes made.

Can you say what version of MATLAB you are using, and if possible post some data that reproduces the problem?

Thanks.

- Peter Perkins
The MathWorks, Inc.
From: Kurt L on
Peter Perkins <Peter.Perkins(a)MathRemoveThisWorks.com> wrote in message <hn3i19$lra$1(a)fred.mathworks.com>...
> On 3/5/2010 4:16 PM, Kurt L wrote:
> > When I try to correct this by estimating:
> > x1 = ksdensity(x,u1,'function','icdf','support','positive');
> > I get the following set of error messages:
> > "??? Input argument "foldpoint" is undefined.
> >
> > Error in ==> ksdensity>compute_pdf_cdf at 508
> > foldpoint = log(foldpoint);
>
> Kurt, I can't reproduce this with the current version of KSDENSITY,
>
> x = gamrnd(2,2,1000,1);
> u1 = rand(1000,1);
> x1 = ksdensity(x,u1,'function','icdf','support','positive');
>
> so it may be something special about your data. But by the line numbers in that error msg, it appears that you're using an older version, and there have been changes made.
>
> Can you say what version of MATLAB you are using, and if possible post some data that reproduces the problem?
>
> Thanks.
>
> - Peter Perkins
> The MathWorks, Inc.


Thanks Peter!
I was using 2008b. I just reran with 2009b and it works fine.

Cheers,
Kurt
 | 
Pages: 1
Prev: Generate random sample
Next: Out Of Memory error