[R] the function doesn´t work

Joshua Wiley jwiley.psych at gmail.com
Mon Sep 27 05:38:14 CEST 2010


As long as p <= 1, the minimum value of H will be log(m).  Here are
some more (I think clearer) graphs.  They show the basic function
p[,i] * log(p[,i] (the log function defaults to natural logarithm),
for values ranging from 0 to 1.  Then include log(m) for different
values of m.  I included the code, and also attached a PDF in incase
there was any trouble running the code.

x <- seq(0, 1, by = .01)
par(mfrow = c(3, 2))
plot(x = x, y = log(x ^ x), type = "l",
     ylab = bquote(f(x) == ln(x^x)), main = "Basic graph")
plot(x = x, y = -log(x ^ x), type = "l",
     ylab = bquote(f(x) == -ln(x^x)), main = "Basic negative graph")
plot(x = x, y = log(0.5) - log(x ^ x), type = "l",
     ylab = bquote(f(x) == ln(0.5) - ln(x^x)), main = "m = 0.5")
plot(x = x, y = log(1) - log(x ^ x), type = "l",
     ylab = bquote(f(x) == ln(1) - ln(x^x)), main = "m = 1")
plot(x = x, y = log(2) - log(x ^ x), type = "l",
     ylab = bquote(f(x) == ln(2) - ln(x^x)), main = "m = 2")
plot(x = x, y = log(6) - log(x ^ x), type = "l",
     ylab = bquote(f(x) == ln(6) - ln(x^x)), main = "m = 6")


So the way I see it, you have 3 ways to get different values:
1) Increase your matrix p
2) Decrease m
3) Increase your selection region (this in turn depends on alpha, the
mean, and the standard deviation)


Cheers,

Josh

On Sun, Sep 26, 2010 at 7:58 PM, jethi <kartija at hotmail.com> wrote:
>
> wow thnx a lot josh. so now i understand the most of the things. so my power
> function is depent on the number of the blocks "m". how u said, if i take
> m=0.8 or lower i get a different value than a 1. ofcourse  a number between
> 0 or 1. but i can just take positive interger number for m, because m
> representet die value for the blocks and they could be only a positiv
> number. moreover the graphic show that my H will never reach log(m) because
> like u said p are probilities. so if i would now plot the powerfunction for
> different m(positiv integer), the graph would be a constant value. am i
> right?
>
> thank u very very much. its help me a lot.
> --
> View this message in context: http://r.789695.n4.nabble.com/the-function-doesn-t-work-tp2714105p2714875.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graphs.pdf
Type: application/pdf
Size: 24875 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100926/c8ecce9d/attachment.pdf>


More information about the R-help mailing list