[R] Two dimensional likelihood surface plot

Gyanendra Pokharel gyanendra.pokharel at gmail.com
Tue Nov 11 23:53:23 CET 2014


Thanks David, what do you mean by organized data in regular manner?

Gyanendra Pokharel
University of Guelph
Guelph, ON

On Tue, Nov 11, 2014 at 3:53 PM, David Winsemius <dwinsemius at comcast.net>
wrote:

>
> On Nov 11, 2014, at 11:17 AM, Gyanendra Pokharel wrote:
>
> > Hi R users,
> > I am trying to plot two dimensional posterior likelihood surface. I have
> a
> > data like
> >
> > para1     para2     likehood
> > .......      ........      ...........
> > .......      ........      ...........
> >
> >
> >
> > I looked at contour plot but it needs a shorted values of parameters and
> a
> > matrix of likelihood values. Is there any way to get the plot? or how
> can I
> > change my likelihood values to a matrix for the function "contour"?
>
> If the data are organized in a regular manner, then this might succeed:
>
> with( df, contour( x=unique(para1), y=unique(para2)
>                    z= matrix( likehood, length(unique(para1),
> length(unique(para2) )
>      )           )
>
> >
> > Any suggestions are appreciated.
> >
> >
> > GP
> > University of Guelph
> > Guelph, ON
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > 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.
>
> David Winsemius
> Alameda, CA, USA
>
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list