简体   繁体   中英

How to specify additional parameters in R functions?

For Fitting Markov Switching Models with package MSwM (function msmFit) there is 'control' argument which is list of control parameters. Syntax of msmFit is:

msmFit(object, k, sw, p, data, family, control)

The 'control' argument is a list that can supply any of the following components:

-trace: A logical value. If it is TRUE, tracing information on the progress of the optimization is produced.

-maxiter: The maximum number of iterations in the EM method. Default is 100. and so on.

My question is how to specify for example '-maxiter'? I tried: component(maxiter=50), component-maxiter=50, component[["maxiter"]]=50. Everything gives an error. "unexpected '='" or other errors connected to argument.

格式化您的呼叫,如下所示:

mod=msmFit(model,k=2,sw=rep(TRUE,8),control=list(maxiter=10))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM