Blog Archives

Modeling Count Time Series with tscount Package

March 31, 2015
By
Modeling Count Time Series with tscount Package

The example below shows how to estimate a simple univariate Poisson time series model with the tscount package. While the model estimation is straightforward and yeilds very similar parameter estimates to the ones generated with the acp package (https://statcompute.wordpress.com/2015/03/29/autoregressive-conditional-poisson-model-i), the prediction mechanism is a bit tricky. 1) For the in-sample and the 1-step-ahead predictions: yhat_

Read more »

rPithon vs. rPython

March 30, 2015
By
rPithon vs. rPython

Similar to rPython, the rPithon package (http://rpithon.r-forge.r-project.org) allows users to execute Python code from R and exchange the data between Python and R. However, the underlying mechanisms between these two packages are fundamentally different. Wihle rPithon communicates with Python from R through pipes, rPython accomplishes the same task with json. A major advantage of rPithon

Read more »

Autoregressive Conditional Poisson Model – I

March 29, 2015
By
Autoregressive Conditional Poisson Model – I

Modeling the time series of count outcome is of interest in the operational risk while forecasting the frequency of losses. Below is an example showing how to estimate a simple ACP(1, 1) model, e.g. Autoregressive Conditional Poisson, without covariates with ACP package.

Read more »

Ensemble Learning with Cubist Model

March 20, 2015
By
Ensemble Learning with Cubist Model

The tree-based Cubist model can be easily used to develop an ensemble classifier with a scheme called “committees”. The concept of “committees” is similar to the one of “boosting” by developing a series of trees sequentially with adjusted weights. However, the final prediction is the simple average of predictions from all “committee” members, an idea

Read more »

Model Segmentation with Cubist

March 18, 2015
By
Model Segmentation with Cubist

Cubist is a tree-based model with a OLS regression attached to each terminal node and is somewhat similar to mob() function in the Party package (https://statcompute.wordpress.com/2014/10/26/model-segmentation-with-recursive-partitioning). Below is a demonstrate of cubist() model with the classic Boston housing data.

Read more »

Query Pandas DataFrame with SQL

November 1, 2014
By
Query Pandas DataFrame with SQL

Similar to SQLDF package providing a seamless interface between SQL statement and R data.frame, PANDASQL allows python users to use SQL querying Pandas DataFrames. Below are some examples showing how to use PANDASQL to do SELECT / AGGREGATE / JOIN operations. More information is also available on the GitHub (https://github.com/yhat/pandasql).

Read more »

Flexible Beta Modeling

October 27, 2014
By
Flexible Beta Modeling

Read more »

Model Segmentation with Recursive Partitioning

October 26, 2014
By
Model Segmentation with Recursive Partitioning

Read more »

Estimating a Beta Regression with The Variable Dispersion in R

October 19, 2014
By
Estimating a Beta Regression with The Variable Dispersion in R

Read more »

Fitting Lasso with Julia

October 7, 2014
By
Fitting Lasso with Julia

Julia Code R Code

Read more »