[R] fitting data with conditions

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed Mar 28 16:50:56 CEST 2007


This mailing list is in english ....

If you know that for the quantiles, say:

  1%: 3
90%: 5.2
99%: 6.1

then you could quickly look for the minimum of the following function

foo <- function(x){
     (qlnorm(0.01, meanlog = x[1], sdlog = x[2]) - 3)^2 +
     (qlnorm(0.9, meanlog = x[1], sdlog = x[2]) - 5.2)^2 +
     (qlnorm(0.99, meanlog = x[1], sdlog = x[2]) - 6.1)^2
}

using optim() as in

optim(c(1,1), foo)

Uwe Ligges



yseiler at bluewin.ch wrote:
> Mich beschäftig folgende Fragestellung. Ich kenne die Verteilung 
> (lognormal) zusätzlich weiss ich das 99%, das 90% und das 1% Quantil. 
> Gibt es in R eine Möglichkeit die Lognormalverteilung zu finden, das 
> heisst den korrespondierenden logmean und logsd?
> 
> Vielen Dank für ihre Hilfe
> Gruss
> Yvonne
> 
> ______________________________________________
> 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
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list