[R] Graph and function

Petr Pikal petr.pikal at precheza.cz
Mon Jun 19 18:07:08 CEST 2006


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 at yahoo.fr>
To:             	R-help at 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 at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

Petr Pikal
petr.pikal at precheza.cz



More information about the R-help mailing list