Skip to content
Back to formatted view

Raw Message

Message-ID: <E1D82A70-3A57-11D9-B879-000393B2DF14@earthlink.net>
Date: 2004-11-19T18:21:50Z
From: Jim McLoughlin
Subject: Performing regression using R & C
In-Reply-To: <111C3CD246AB774790496EBB3CD220080334F4@mothra.hcjp.com>

> 	Is it possible to perform OLS using C code? I am trying to
> optimize a n-period "moving window" OLS on a huge dataset hence was
> wondering if such a thing is possible.
>
> 	Ideally the solution that I am looking for would involve a
> C-code accepting two float arrays and returning back computed 
> parameters
> such as t-stat, coefficient etc.

It is probably not worth trying to call R to do OLS from C.  I would 
look at GSL:

http://www.gnu.org/software/gsl/manual/gsl-ref_toc.html

GSL has a simple but elegant C interface for doing OLS and weighted 
least squares.  It will give you the covariance matrix of the model 
parameters, from which you can derive t-stats.

Jim M