Re: pdf[d,x] vs. function(x)
- To: mathgroup at smc.vnet.net
- Subject: [mg52878] Re: pdf[d,x] vs. function(x)
- From: Bill Rowe <readnewsciv at earthlink.net>
- Date: Wed, 15 Dec 2004 04:27:30 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
On 12/14/04 at 6:00 AM, user at domain.com (Scout) wrote: >Given the symbol p = PDF [ NormalDistribution, x ] (where PDF is >the Probability Density Function) which declares an expression in >x, I want to build a new function, i.e. f(z)=p with the parameter z >instead, but I obtain an error. How can I do? Thanks, Scout? I am not entirely sure I understand what you are trying to do. It looks to me as if you are trying to simply replace x with z when f(z) is defined. If so, then look at the following: In[1]:=<< "Statistics`" In[2]:=p = PDF[NormalDistribution[0, 1], x] Out[2]=1/(E^(x^2/2)*Sqrt[2*Pi]) In[3]:=f[z_] = p /. x -> z Out[3]=1/(E^(z^2/2)*Sqrt[2*Pi]) But if this is your goal, it seems to me it would have been simpler to define p as a function in the first place, i.e., p[x]:= PDF[NormalDistribution[0,1],x] then whenver you want to use a different variable such as z you would simply use p[z] -- To reply via email subtract one hundred and four