Steve, I don't profess to be an expert in R (by ANY means), but I've used the sn.mle function in package sn to do something similar. So, for example, if you have data (y), you can do the following:
y = c(5,4,6,4,5,6,7,7,55,64,23,13,1,4,1,14,1,15,11,12) sn.mle(y=y) I just made up this stream of data, so please forgive if it doesn't make sense. The function will produce a number of things, including the mles for the mean, sd, and skew, as well as a histogram with the density overlayed onto it. Maybe this helps? Hope so. Greg -----Original Message----- >From: "R. Michael Weylandt" <michael.weyla...@gmail.com> >Sent: Nov 3, 2011 10:39 PM >To: steve_fried...@nps.gov >Cc: r-help@r-project.org >Subject: Re: [R] Plotting skewed normal distribution with a bar plot > >It seems like you'll need to apply some sort of MLE to estimate the >parameters directly from the data before using dsn() to get the >density. This might help with some of it: >http://help.rmetrics.org/fGarch/html/snorm.html > >Michael > >On Thu, Nov 3, 2011 at 2:54 PM, <steve_fried...@nps.gov> wrote: >> >> Hi, >> >> I need to create a plot (type = "h") and then overlay a skewed-normal >> curve on this distribution, but I'm not finding a procedure to accomplish >> this. I want to use the plot function here in order to control the bin >> distributions. >> >> I have explored the sn library and found the dsn function. dsn uses known >> location, scaling and shape parameters associated with a given input vector >> of probabilities. However, how can I calculate the skewed-normal curve if >> I don't know these parameters in advance? >> >> Is there another function to calculate the skew-normal, perhaps in a >> different package? >> >> >> I'm working with R 2.13.2 on a windows based machine. >> >> Steve Friedman Ph. D. >> Ecologist / Spatial Statistical Analyst >> Everglades and Dry Tortugas National Park >> 950 N Krome Ave (3rd Floor) >> Homestead, Florida 33034 >> >> steve_fried...@nps.gov >> Office (305) 224 - 4282 >> Fax (305) 224 - 4147 >> >> ______________________________________________ >> R-help@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. >> > >______________________________________________ >R-help@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. ______________________________________________ R-help@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.