What’s for dynr: A package for linear and nonlinear dynamic modeling in R

What’s for dynr: A package for linear and nonlinear dynamic modeling in R

The past several decades have seen the rise of intensive longitudinal data (e.g. via ecological momentary assessments) and the resulting dynamic modeling methods in social and behavioral sciences. To make the estimation of these models more accessible to researchers, we have created an R package that is based on a novel and efficient state-space estimation algorithm in C.

This is a demo of the beta version of the dynr R package: an R package that utilizes computationally efficient algorithms for a broad class of dynamic models that are increasing in use while maintaining a simple and easy-to-learn interface. The R interface allows users to specify models in two distinct ways. First, models can be specified directly by defining a set of C functions which dynr has the ability to compile and link to the rest of the dynr C algorithms. Second, for a very broad class of linear and non-linear models, dynr provides R helper functions that write and compile the C functions based on user input in R so that the user never has to write or even see the C code that underlies dynr.

There are several features that make dynr unique and innovative. Other programs are available for dynamic modeling. However, they tend to fall in one of three camps. Either they rely entirely on linear models or only handle very specific forms of nonlinear relations among latent variables, or they require that the user write the complex compiled code that provides computational speed at the cost of high user burden. The dynr package allows for both linear and non-linear models while performing all computations quickly and efficiently in C, but still has a user interface in the familiar R language. This removes some of the barriers to dynamic modeling, opening it as a possibility to a broader class of users. Online demo examples are forthcoming.

In addition to the QuantDev contributors listed, other key contributors and current/past team members include Michael Hunter, Hongtu Zhu, Zhaohua Lu, Peifeng Yin, Sukruth Nagarimadugu Reddy, and Hui-Ju Hung.

The Social Science Research Institute is committed to making its websites accessible to all users, and welcomes comments or suggestions on access improvements. Please send comments or suggestions on accessibility to web@ssri.psu.edu.