# Re: [R] Graph and function

From: Petr Pikal <petr.pikal_at_precheza.cz>
Date: Tue 20 Jun 2006 - 02:07:08 EST

Hi

well I am a bit puzzled

> a<-0.2
> t<-rexp(1,a)
> xn<-rpois(1,t)
> B<-(xn+1)/(1+a)

so B has nothing to do with n

> b<-mean(x)
> BE<-(1+xn)*b/(1+b)

so as Be
you can use
n <- 1:100
and n as an input vector for some vectorized function but I wonder where to put such vector in your pieces of code?

Petr

On 19 Jun 2006 at 17:29, Ahmed Elhabti wrote:

```Date sent:      	Mon, 19 Jun 2006 17:29:03 +0200 (CEST)
From:           	Ahmed Elhabti <a_elhabti@yahoo.fr>
To:             	R-help@stat.math.ethz.ch
Subject:        	[R] Graph and function

```

>
> I have a program which make calculate them of 4 estimator, B, BE, wB
> and wBE.
>
> Now I want to varied n example: "n<-seq(1,100,1)", and to make a
> graph of "B" and "Be" according to "n", to make a comparison.
>
> Tank you very much.
>
>
> n<-50
>
> a<-0.2
>
> theta<-rexp(n,a)
>
> x<-rpois(length(theta),theta)
>
> t<-rexp(1,a)
>
> xn<-rpois(1,t)
>
> b<-mean(x)
>
>
>
> B<-(xn+1)/(1+a)
>
> BE<-(1+xn)*b/(1+b)
>
> r<-b/(1+b)
>
> wB<-1/(a*(1+a))
>
> wBE<-wB+(2/(a^2)+5/a+4)*(b/(1+b)-1/(1+a))^2
>
>
>
>
>
> B
>
> BE
>
> wB
>
> wBE
>
>
> ---------------------------------
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> http://www.R-project.org/posting-guide.html

Petr Pikal
petr.pikal@precheza.cz

R-help@stat.math.ethz.ch mailing list