How to run maximum likelihood optimization (BFGS) in STAN? - r

According to the STAN homepage, STAN is capable of penalized maximum likelihood (BFGS) optimization. I am using R package rstan but I haven't found any way how to use this method. I tried to look at the ?stan help for the stan() function, but the only available options algorithms are "NUTS" and "HMC".
I am using rstan version 2.5.0.

You want to look at help(optimizing, package = "rstan"), i.e. the optimizing() function in the RStan package.

Related

Difference between brglm & logistf?

I am currently fitting a penalized logistic regression model using the package logistf (due to quasi-complete separation).
I chose this package over brglm because I found much more recommendations for logistf. However, the brglm seems to integrate better with other functions such as predict() or margins::margins(). In the documentation of brglm it says:
"Implementations of the bias-reduction method for logistic regressions can also be found in thelogistf package. In addition to the obvious advantage ofbrglmin the range of link functions that can be used ("logit","probit","cloglog"and"cauchit"), brglm is also more efficient computationally."
Has anyone experience with those two packages and can tell me whether I am overlooking a weakness in brglm, or can I just use it instead of logistf?
I'd be grateful for any insights!

R alternatives to JAGS/BUGS

Is there an R-Package I could use for Bayesian parameter estimation as an alternative to JAGS? I found an old question regarding JAGS/BUGS alternatives in R, however, the last post is already 9 years old. So maybe there are new and flexible gibbs sampling packages available in R? I want to use it to get parameter estimates for novel hierarchical hidden markov models with random effects and covariates etc. I highly value the flexibility of JAGS and think that JAGS is simply great, however, I want to write R functions that facilitate model specification and am looking for a package that I can use for parameter estimation.
There are some alternatives:
stan, with rstan R package. Stan looks well optimized but cannot do certain type of models (like binomial/poisson mixture model), since he cannot sample a discrete variable (or something like that...).
nimble
if you want highly optimized sampling based on C++, you may want to check Rcpp based solutions from Dirk Eddelbuettel

How to use Truncated Multivariate Normal distribution in Julia

I am running an (Markov Chain Monte Carlo) MCMC in Julia where one of the steps requires that I simulate from a Truncated Multivariate Normal Distribution(TMvN).
Right now, I call the package TruncatedNormal from R using RCall.
The Distributions package in Julia offers the Truncated options but only seems to work for ivariate distributions.
Is there a native Julia package I can use to directly simulate from a TMvN?

fmincon in R - disappeared from 'pracma' package?

In the 'pracma' package manual there is function fmincon to Minimize Nonlinear Constrained Multivariable Function (page 116). However I've installed this package, but there is no such function.
Has it been removed from this package?
Could anyone indicate any other R ackage or function with such funcionality (Minimize Nonlinear Constrained Multivariable Function) ?
What version of pracma do you have installed? The manual you linked to is from version 2.2.5, and that's also the version on CRAN, and it does have fmincon.
Perhaps you forgot
library(pracma)
to attach it? Installing isn't enough to make the contents visible.

Huber loss function parameter in GBM R package

I'm using GBM package for a regression problem. I would like to test the Huber loss function. I can use the "huberized" value for the distribution. However, how do you set the cutting edge parameter?
Maybe I missed it somewhere in the help.

Resources