GitHunt

crvftw_eiv crvftw_eiv

Polynomial EIV regression

Overview

1.Regression based on multivariate probability density function (pdf) without auto-correlated input variables

$$\text{pdf}(z_i) = \text{err}(z_i, X_i) = \frac{1}{2\pi} \frac{1}{\sqrt{\det(\boldsymbol{X}_i)}} e^{-\frac{1}{2} z_i^T \boldsymbol{X}_i^{-1} z_i}$$

With:

$$z_i = \begin{bmatrix} \hat{x}_i - x_i \\ y_i - \hat{y}_i \end{bmatrix} = \begin{bmatrix} \hat{x}_i - x_i \\ y_i - f(\hat{x}_i) \end{bmatrix}$$

and

$${X_i} = \begin{bmatrix} u^2(x_i) \ \quad \ f(x_i)u^2(x_i) \\ f(x_i)u^2(x_i) \ \quad \ g^2(x_i)+u^2(y_i) \end{bmatrix}$$ $$\max_{\boldsymbol{\hat{c}}, \boldsymbol{b}} \frac{1}{(2\pi)^n} \frac{1}{\sqrt{\det(\boldsymbol{X})}} e^{-\frac{1}{2} \boldsymbol{z}^T \boldsymbol{X}^{-1} \boldsymbol{z}}$$

2.Error-in-both-variables polynomial regression procedure (Deming regression)

$$\min_{\boldsymbol{\hat{y}}, \boldsymbol{b}} \sum_{i=1}^{n} \left( \frac{(\hat{x}_i - x_i)^2}{u^2(x_i)} + \frac{(f(\hat{x}_i, \boldsymbol{b}) - y_i)^2}{u^2(y_i)} \right)$$

Installation

Install R

To use this R package from GitHub, the user needs to install R at first. ​R​ is the core programming language and environment required to run and install any R package. It must be installed on the user's system.

Install R on Windows

  1. Go to the R Project website.
  2. Click on ​Download R for Windows.
  3. Click on install R for the first time.
  4. Click Download R for Windows. Open the downloaded file.
  5. Select the language you would like to use during the installation. Then click OK.
  6. Click Next.
  7. Select where you would like R to be installed. It will default to your Program Files on your C Drive. Click Next.
  8. You can then choose which installation you would like. If your computer is a 64-bit, you can choose the 64-bit User Installation. Then click Next.
  9. Then specify if you want to customized your startup or just use the defaults. Then click Next.
  10. Then you can choose the folder that you want R to be saved within or the default if the R folder that was created. Once you have finished, click Next.
  11. You can then select additional shortcuts if you would like. Click Next.
  12. Click Finish

Install R on Linux

  1. Go to the R Project website.
  2. Click on ​Download R for Linux.
  3. Click on one of the following links according to your operating system
  4. Follow the installation guide to install R.
  5. Open R Console by typing R on your console
  6. Run the following commmand to confirm the installation of R:
    version
    

Install R on Mac

  1. Go to the R Project website.

  2. Click on ​[Download R for macOS]([https://cran.r-project.org/bin/macosx/]

  3. Download the latest version of R for macOS and open the .pkg file.

  4. Follow the installation instructions.

  5. Open R Console by typing R on your console

  6. Run the following commmand to confirm the installation of R:

    version
    

Install RStudio

While RStudio is not mandatory, it is a popular integrated development environment (IDE) for R. It provides a more user-friendly interface for coding, debugging, and managing R projects. If the user prefers working with a GUI, RStudio can make the process easier.

Install RStudio on Windows

  1. Visit the RStudio website.
  2. Download the RStudio Desktop Installer for Windows.
  3. Run the installer and follow the on-screen instructions.

Install RStudio on Linux

  1. Visit the RStudio download website.
  2. Download the RStudio .deb or .rpm package according to your operating system and version
  3. Install the package

Install RStudio on Mac

  1. Visit the RStudio download website.
  2. Download the RStudio .dmg package according to your MacOS version
  3. Install the package

Install APPAC

The user can install a GitHub package directly in R using tools like devtools.
If RStudio is used, the same commands can be run in its console. However, the installation process itself relies only on R.

# Install devtools if not already installed
install.packages("devtools")

# Use devtools to install the package from GitHub
devtools::install_github("ErikvanderWerff/crvftw_eiv")

⚠️ Attention