Git Product home page Git Product logo

quadvar's Introduction

quadVAR

CRAN status R-CMD-check

Estimate quadratic vector autoregression models with the strong hierarchy using the RAMP algorithm, compare the performance with linear models, and construct networks with partial derivatives.

Installation

You can install the development version of quadVAR from GitHub with:

# install.packages("devtools")
devtools::install_github("Sciurus365/quadVAR")

Example

library(quadVAR)
set.seed(1614)
data <- sim_4_emo(time = 200, sd = 1)
plot(data[, "x1"])

qV1 <- quadVAR(data, vars = c("x1", "x2", "x3", "x4"))
summary(qV1)
#> # A tibble: 6 × 5
#>   Model        Sumdf SumIC DiffIC    Weight
#>   <chr>        <dbl> <dbl>  <dbl>     <dbl>
#> 1 NULL_model       0 3580. 1132.  1.96e-246
#> 2 AR               4 2775.  326.  1.83e- 71
#> 3 VAR             16 2544.   95.4 1.95e- 21
#> 4 VAR_full        16 2544.   95.4 1.95e- 21
#> 5 quadVAR         28 2449.    0   1.00e+  0
#> 6 quadVAR_full    56 2519.   70.1 5.95e- 16
coef(qV1)
#>  model effect estimate
#>     x1     x1   1.6273
#>     x1     x3   0.0329
#>     x1     x4  -0.0751
#>     x1  x1:x1  -0.1019
#>     x1  x1:x3  -0.1177
#>     x1  x1:x4  -0.1065
#>     x1  x3:x3  -0.0104
#>     x1  x4:x4   0.0157
#>     x2     x1   0.2520
#>     x2     x2   1.4055
#>     x2     x3   0.4096
#>     x2     x4   0.0446
#>     x2  x1:x3  -0.0760
#>     x2  x2:x2  -0.0863
#>     x2  x2:x3  -0.0822
#>     x2  x2:x4  -0.1158
#>     x2  x3:x3  -0.0565
#>     x3     x1  -0.1685
#>     x3     x2   0.1035
#>     x3     x3   1.6050
#>     x3  x1:x3  -0.0769
#>     x3  x2:x2   0.0018
#>     x3  x2:x3  -0.1377
#>     x3  x3:x3  -0.1004
#>     x4     x1   0.0675
#>     x4     x2  -0.1798
#>     x4     x4   0.8196
#>     x4  x1:x4  -0.1138
plot(qV1)
#> ℹ The quadVAR model, being nonlinear, generates a network meaningful only for
#>   specific variable values. If values are unspecified, the linearization/the
#>   plot defaults to 0 (i.e., the mean values of all variables if
#>   `value_standardized = TRUE`), but this is not a complete description of the
#>   model estimation and may not be meaningful in all cases.
#> This message is displayed once every 8 hours.

# Compare the estimation with the true model
plot(true_model_4_emo())

plot(qV1, value = rep(2.80, 4), value_standardized = FALSE, layout = plot(true_model_4_emo())$layout)

quadvar's People

Contributors

sciurus365 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.