It doesn't have anything to do with QUADGK. You need to sort out which
variables are the independent variables in the call. The first argument of
QUADGK is a function handle for a function of one independent variable. If
you define
Fy = @(z)quadgk(firm_1_pdf(z),...)
Then the first input argument to QUADGK is not a function handle. Normally,
I would expect to see something like
Fy = @(z)quadgk(@(t)foo(t,z), ...)
if z is a parameter of the integrand or
Fy = @(z)quadgk(@foo,a,z,...)
if z is a limit of integration. In no case would I ever expect to see
Fy = @(z)quadgk(foo(z),...)

Mike
"Dhrue " <dhritimanbhattacharya@uiowa.edu> wrote in message
news:h4oqio$8td$1@fred.mathworks.com...
> My objective is to derive the distribution of z2 when I know the
> distribution of z is lognormal (4,1.3).
>
> zh= logninv(.999,4,1.3); %upper bound
> density=@(z) lognpdf(z,4,1.3);
> mass=quadgk(density,100,zh);
> firm_1_pdf=@(z) density(z)./mass %a new distribution derived form
> lognormal
> Now I want to know pdf of z2 given "firm_1_pdf" above
> z2=@(z) z.^.4 %
> Fy=@(z) quadgk(firm_1_pdf(z),z2(100),z2(zh)
> hh=@(z) gradient(Fy(z))
> THis does not work. It seems quadgk cannot be used in this way.....Please
> can you suggest another method!!
> Thanks
> Dhrue
