clm {complex} | R Documentation |
Complex Linear Model
Description
Function estimates complex variables model
Usage
clm(formula, data, subset, na.action, loss = c("likelihood", "OLS", "CLS",
"MSE", "MAE", "HAM"), orders = c(0, 0, 0), scaling = c("normalisation",
"standardisation", "max", "none"), parameters = NULL, fast = FALSE, ...)
## S3 method for class 'clm'
sigma(object, type = NULL, ...)
## S3 method for class 'clm'
vcov(object, type = NULL, ...)
## S3 method for class 'clm'
summary(object, level = 0.95, ...)
Arguments
formula |
an object of class "formula" (or one that can be coerced to
that class): a symbolic description of the model to be fitted. Can also include
|
data |
a data frame or a matrix, containing the variables in the model. |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
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. Value na.exclude can be useful. |
loss |
The type of Loss Function used in optimization.
A user can also provide their own function here as well, making sure
that it accepts parameters
|
orders |
vector of orders of complex ARIMA(p,d,q). |
scaling |
NOT YET IMPLEMENTED!!! Defines what type of scaling to do for the variables. See cscale for the explanation of the options. |
parameters |
vector of parameters of the linear model. When |
fast |
if |
... |
Other parameters passed to internal functions. |
object |
Object of class "clm" estimated via |
type |
Type of sigma to return. This is calculated based on the residuals
of the estimated model and can be |
level |
What confidence level to use for the parameters of the model. |
Details
This is a function, similar to lm, but supporting several estimation techniques for complex variables regression.
Value
Function returns model
- the final model of the class
"clm", which contains:
coefficients - estimated parameters of the model,
FI - Fisher Information of parameters of the model. Returned only when
FI=TRUE
,fitted - fitted values,
residuals - residuals of the model,
mu - the estimated location parameter of the distribution,
scale - the estimated scale parameter of the distribution. If a formula was provided for scale, then an object of class "scale" will be returned.
logLik - log-likelihood of the model. Only returned, when
loss="likelihood"
and in a special case of complex least squares.loss - the type of the loss function used in the estimation,
lossFunction - the loss function, if the custom is provided by the user,
lossValue - the value of the loss function,
df.residual - number of degrees of freedom of the residuals of the model,
df - number of degrees of freedom of the model,
call - how the model was called,
rank - rank of the model,
data - data used for the model construction,
terms - terms of the data. Needed for some additional methods to work,
B - the value of the optimised parameters. Typically, this is a duplicate of coefficients,
other - the list of all the other parameters either passed to the function or estimated in the process, but not included in the standard output (e.g.
alpha
for Asymmetric Laplace),timeElapsed - the time elapsed for the estimation of the model.
Author(s)
Ivan Svetunkov, ivan@svetunkov.ru
References
Svetunkov, S. & Svetunkov I. (2022) Complex Autoregressions. In Press.
See Also
Examples
### An example with mtcars data and factors
x <- complex(real=rnorm(1000,10,10), imaginary=rnorm(1000,10,10))
a0 <- 10 + 15i
a1 <- 2-1.5i
y <- a0 + a1 * x + 1.5*complex(real=rnorm(length(x),0,1), imaginary=rnorm(length(x),0,1))
complexData <- cbind(y=y,x=x)
complexModel <- clm(y~x, complexData)
summary(complexModel)
plot(complexModel, 7)