Re: integrate the PDF of normal distribution

Themos Tsikas <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Organization NAG Ltd
Message-ID <[email protected]>
(1) -> sigma:=(theta^2)

             2
   (1)  theta
                                                     Type: Polynomial Integer
(2) -> f:= x/(sigma*sqrt(2*%pi))*exp(-(x-mu)**2/(2*sigma**2))

               2             2
            - x  + 2mu x - mu
            ------------------
                        4
                  2theta
        x %e
   (2)  ----------------------
                  2 +----+
             theta \|2%pi
                                                     Type: Expression Integer
(3) -> result:EXPR INT:=integrate(f,x=%minusInfinity..%plusInfinity)

             +---+
         2mu\|%pi
   (3)  -----------
         +-+ +----+
        \|2 \|2%pi
                                                     Type: Expression Integer

-- to simplify one way
(4) -> tower:= tower result

                 +-+  +---+  +----+
   (4)  [mu,%pi,\|2 ,\|%pi ,\|2%pi ]
                                         Type: List Kernel Expression Integer
(5) -> eval(result,[tower.5 =((tower.3)::EXPR INT )*((tower.4)::EXPR INT)])

   (5)  mu
                                                     Type: Expression Integer
-- to simplify another way 
(6) -> simplify1:= rule sqrt(2*%pi) == sqrt(2)*sqrt(%pi)

          +----+     +-+ +---+
   (6)  \|2%pi  == \|2 \|%pi
                        Type: RewriteRule(Integer,Integer,Expression Integer)
(7) -> simplify1  result

   (7)  mu
                                                     Type: Expression Integer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.