找回密码
 注册
查看: 1615|回复: 0

R语言 quantreg包 dynrq()函数中文帮助文档(中英文对照)

  [复制链接]
发表于 2012-9-24 23:51:11 | 显示全部楼层 |阅读模式
dynrq(quantreg)
dynrq()所属R语言包:quantreg

                                        Dynamic Linear Quantile Regression
                                         动态线性分量回归

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Interface to rq.fit and rq.wfit for fitting dynamic linear  quantile regression models.  The interface is based very closely on Achim Zeileis's dynlm package.  In effect, this is  “syntactic sugar” for formula processing, but one should never underestimate the value of good, natural sweeteners.
接口rq.fit和rq.wfit配件的动态线性位数回归模型。该接口是非常密切是阿希姆·Zeileis的dynlm包。实际上,这是配方加工的“语法糖”,但人们不应该低估值的好,天然甜味剂。


用法----------Usage----------





参数----------Arguments----------

参数:formula
a "formula" describing the linear model to be fit. For details see below and rq.
"formula"描述的线性模型是合适的。有关详细信息,请参阅以下和rq。


参数:tau
the quantile(s) to be estimated, may be vector valued, but all all values must be in (0,1).  
分位数(S)进行估计,可能是向量值,但所有的值必须是在(0,1)。


参数:data
an optional "data.frame" or time series object (e.g., "ts" or "zoo"), containing the variables in the model.  If not found in data, the variables are taken from environment(formula), typically the environment from which rq is called.
一个可选的"data.frame"或时间序列对象(例如,"ts"或"zoo"),包含在模型中的变量。如果没有找到data,变量environment(formula),通常是rq被称为环境。


参数:subset
an optional vector specifying a subset of observations to be used in the fitting process.
一个可选的矢量指定的装配过程中可以使用的观测值的一个子集。


参数:weights
an optional vector of weights to be used in the fitting process. If specified, weighted least squares is used with weights weights (that is, minimizing sum(w*e^2)); otherwise ordinary least squares is used.
在嵌合过程中要使用可选的权重向量。如果指定的话,使用权重加权最小二乘weights(即,最小化sum(w*e^2)),否则为普通最小二乘使用。


参数:na.action
a function which indicates what should happen when the data contain NAs.  The default is set by the na.action setting of options, and is na.fail if that is unset.  The “factory-fresh” default is na.omit. Another possible value is NULL, no action. Note, that for time series regression special methods like na.contiguous, na.locf and na.approx are available.
一个函数,它表示当数据包含NA的,应该发生什么。默认设置是由na.action的options,是na.fail,如果是没有设置的。 “出厂时的默认是na.omit。另一种可能的值是NULL,没有行动。请注意,时间序列回归等特殊的方法na.contiguous,na.locf和na.approx。


参数:method
the method to be used; for fitting, by default method = "br" is used; method = "fn" employs the interior point (Frisch-Newton) algorithm.  The latter is advantageous for problems with sample sizes larger than about 5,000.
使用的方法进行拟合,默认情况下,method = "br"使用,“method = "fn"采用内点算法(弗里施牛顿)。后者是有利的样本大小大于约5000的问题。


参数:contrasts
an optional list. See the contrasts.arg of model.matrix.default.
可选列表。请参阅contrasts.argmodel.matrix.default。


参数:start
start of the time period which should be used for fitting the model.
开始应用于拟合模型的时间段。


参数:end
end of the time period which should be used for fitting the model.
结束应该用于拟合模型的时间周期。


参数:...
additional arguments to be passed to the low level regression fitting functions.
额外的参数被传递到低的水平回归拟合函数。


Details

详细信息----------Details----------

The interface and internals of dynrq are very similar to rq, but currently dynrq offers two advantages over the direct use of rq for time series applications of quantile regression:  extended formula processing, and preservation of time series attributes.   Both features have been shamelessly lifted from Achim Zeileis's package "dynlm".
dynrq是非常相似的rq,但目前dynrq提供了两个优势,直接用rq分位数回归的时间序列应用:扩展式的接口和内部处理,以及保存时间序列属性。这两个功能已被无耻地抬起阿希姆·Zeileis的包"dynlm"。

For specifying the formula of the model to be fitted, there are several functions available which allow for convenient specification of dynamics (via d() and L()) or linear/cyclical patterns (via trend(), season(), and harmon()). These new formula functions require that their arguments are time series objects (i.e., "ts" or "zoo").
对于指定formula以嵌合的模型,有多个函数可允许方便规范的动力学(通过d()和L())或线性/周期性模式(通过trend(),season()和harmon())。这些新的公式和函数需要他们的论据是时间序列对象(即,"ts"或"zoo")。

Dynamic models: An example would be d(y) ~ L(y, 2), where d(x, k) is diff(x, lag = k) and L(x, k) is lag(x, lag = -k), note the difference in sign. The default for k is in both cases 1. For L(), it can also be vector-valued, e.g., y ~ L(y, 1:4).
动态模型:一个例子是d(y) ~ L(y, 2),其中d(x, k)是diff(x, lag = k)和L(x, k)是lag(x, lag = -k),注意区别的标志。默认为k是在这两种情况下,1。对于L(),它也可以是矢量值,例如,y ~ L(y, 1:4)。

Trends: y ~ trend(y) specifies a linear time trend where (1:n)/freq is used by default as the covariate, n is the  number of observations and freq is the frequency of the series (if any, otherwise freq = 1). Alternatively, trend(y, scale = FALSE) would employ 1:n and time(y) would employ the original time index.
趋势:y ~ trend(y)指定了一个线性时间趋势(1:n)/freq默认情况下使用的协变量,n的一些意见和freq是该系列的频率(如果,否则freq = 1)。另外,trend(y, scale = FALSE)将采用1:n和time(y)将采用原来的时间指标。

Seasonal/cyclical patterns: Seasonal patterns can be specified via season(x, ref = NULL) and harmonic patterns via harmon(x, order = 1).  season(x, ref = NULL) creates a factor  with levels for each cycle of the season. Using the ref argument, the reference level can be changed from the default first level to any other. harmon(x, order = 1) creates a matrix of regressors corresponding to cos(2 * o * pi * time(x)) and  sin(2 * o * pi * time(x)) where o is chosen from 1rder.
季节性/周期性模式:,季节性模式可以通过指定season(x, ref = NULL)和谐波模式通过harmon(x, order = 1)。 season(x, ref = NULL)创建的一个因素,与每个周期本赛季的水平。 ref使用参数,参考电平可以改变默认的第一个级别的任何其他。 harmon(x, order = 1)创建一个对应的回归系数矩阵cos(2 * o * pi * time(x))和sin(2 * o * pi * time(x))其中o选择1rder。

See below for examples.
请参阅下面的例子。

Another aim of dynrq is to preserve  time series properties of the data. Explicit support is currently available  for "ts" and "zoo" series. Internally, the data is kept as a "zoo" series and coerced back to "ts" if the original dependent variable was of that class (and no internal NAs were created by the na.action).
dynrq的另一个目的是要保留的数据的时间序列的性能。明确支持目前可用于"ts"和"zoo"系列。在内部,数据被保存为一个"zoo"系列,被迫回到"ts"如果因变量是这个类的(没有内部NA的创建了na.action的)。


参见----------See Also----------

zoo,  dynlm,
zoo,dynlm,


实例----------Examples----------


###########################[##########################]
## Dynamic Linear Quantile Regression Models ##[#动态线性分位数回归模型##]
###########################[##########################]

## multiplicative median SARIMA(1,0,0)(1,0,0)_12 model fitted to UK seatbelt data[#乘法中位数SARIMA(1,0,0),(1,0,0)_12英国安全带的数据模型拟合]
     data("UKDriverDeaths", package = "datasets")
     uk <- log10(UKDriverDeaths)
     dfm <- dynrq(uk ~ L(uk, 1) + L(uk, 12))
     dfm

     dfm3 <- dynrq(uk ~ L(uk, 1) + L(uk, 12),tau = 1:3/4)
     summary(dfm3)
## explicitly set start and end[#明确地设置开始和结束]
     dfm1 <- dynrq(uk ~ L(uk, 1) + L(uk, 12), start = c(1975, 1), end = c(1982, 12))
## remove lag 12[#删除滞后12]
     dfm0 <- update(dfm1, . ~ . - L(uk, 12))
     tuk1  <- anova(dfm0, dfm1)
## add seasonal term[#季节性术语]
     dfm1 <- dynrq(uk ~ 1, start = c(1975, 1), end = c(1982, 12))
     dfm2 <- dynrq(uk ~ season(uk), start = c(1975, 1), end = c(1982, 12))
     tuk2 <- anova(dfm1, dfm2)
## regression on multiple lags in a single L() call[#回归的多滞后单个L()调用]
     dfm3 <- dynrq(uk ~ L(uk, c(1, 11, 12)), start = c(1975, 1), end = c(1982, 12))
     anova(dfm1, dfm3)

###############################[##############################]
## Time Series Decomposition ##[时间序列分解法##]
###############################[##############################]

## airline data[#航空数据]
data("AirPassengers", package = "datasets")
ap <- log(AirPassengers)
ap_fm <- dynrq(ap ~ trend(ap) + season(ap))
summary(ap_fm)

## Alternative time trend specifications:[#另一种趋势规格:]
##   time(ap)                  1949 + (0, 1, ..., 143)/12[#时间(AP)1949 +(0,1,...,143)/ 12]
##   trend(ap)                 (1, 2, ..., 144)/12[#趋势(AP)(1,2,...,144)/ 12]
##   trend(ap, scale = FALSE)  (1, 2, ..., 144)[趋势#(美联社,量度= FALSE)(1,2,...,144)]


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-23 16:42 , Processed in 0.025088 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表