Dear Adam,
ML is indeed hard-coded into the sem() function. Depending upon its
complexity, modifying the code to use a different "fitting function"
shouldn't be difficult, particularly if you are content not to supply
derivatives for the optimization. Providing for different "fitting
functions" is on my to-do list but isn't a high priority for me. On the
other hand, the task seems simple enough that I might pick it up when I have
some spare time. I'm sorry that I can't be more definite.
If you want to experiment yourself, look at the function sem.default() in
the package sources. Currently, two "fitting functions" are provided
--
objective.1() and objective.2(); these are local to sem.default(). Both
implement ML, one without and the other with an analytic gradient. (I
experimented at one point with providing an analytic Hessian, but it slowed
down the optimization.)
Regards,
John
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at
r-project.org]
On> Behalf Of Adam D. I. Kramer
> Sent: April-24-09 7:36 PM
> To: r-help at r-project.org
> Subject: [R] Sem and nlm and ols instead of ml
>
> Dear colleagues,
>
> Has anybody any experience using the sem package to fit structural
> equation models using a fitting function other than ML? I have heard tell
> that OLS may provide better estimates when using standardized matrices
> generated from small sample sizes, so I was interested in comparing the
two> for a few models. However, ML appears to be hard-coded into the source for
> sem...but maybe there is some way around this.
>
> So, if anybody has done this, has a hint as to how to do this, or
> would be able to say that this is perhaps way too much trouble to try, I
> would appreciate advice on the topic.
>
> --
> Adam D. I. Kramer
> Ph.D. Candidate, Social and Personality Psychology
> University of Oregon
> adik at uoregon.edu
>
> ______________________________________________
> 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.