Skip to content
Prev 68749 / 398502 Next

have to point it out again: a distribution question

Dear R-helpers:
I pointed out my question last time but it is only partially solved.
So I would like to point it out again since I think  it is very
interesting, at least to me.
It is a question not about how to use R, instead it is a kind of
therotical plus practical question, represented by R.

I came with this question when I built model for some stock returns.
That's the reason I cannot post the complete data here. But I would
like to attach some plots here (I zipped them since the original ones
are too big).

The first plot qq1, is qqnorm plot of my sample, giving me some
"S"-shape. Since I am not very experienced, I am not sure what kind of
distribution my sample follows.

The second plot, qq2, is obtained via
qqnorm(rt(10000, 4)) since I run
fitdistr(kk, 't') and got
        m              s              df
  9.998789e-01   7.663799e-03   3.759726e+00
 (5.332631e-05) (5.411400e-05) (8.684956e-02)

The second plot seems to say my sample distr follows t-distr. (not sure of this)

BTW, what the commands for simulating other distr like log-norm,
exponential, and so on?

The third one was obtained by running the following R code:

Suppose my data is read into dataset k from file "f392.txt":
k<-read.table("f392.txt", header=F)    # read into k
kk<-k[[1]]
qq(kk)


qq function is defined as below:
qq<-function(dataset){
l<-qqnorm(dataset, plot.it=F)
diff<-l$y-l$x # difference b/w sample and it's therotical quantile
qqnorm(diff)
}


The most interesting thing is (if there is not any stupid game here,
and if my sample follows some kind of distribution (no matter if such
distr has been found or not)), my qq function seems like a way to
evaluate it. But what I am worried about, the line is too "perfect",
which indiates there is something goofy here, which can be proved via
some mathematical inference to get it. However I used
qq(rnorm(10000))
qq(rt(10000, 3.7)
qq(rf(....))

None of them gave me this perfect line!

Sorry for the long question but I want to make it clear to everybody
about my question. I tried my best :)

Thanks for your reading,

Weiwei (Ed) Shi, Ph.D
On 4/23/05, Vincent ZOONEKYND <zoonek at gmail.com> wrote: