Processing math: 100%

Important Notice !!!

This blog has been discarded and no update any more.

Please visit http://www.quantlego.com for active updates.

Sorry for any inconvenience.





Thursday, July 18, 2013

Configure Eclipse IDE to work for both 32-bit and 64-bit R

| |
0 comments
Sometime we need to make Eclipse compatible simultaneously for both 32-bit and 64-bit versions of R. For example, we may have the 64-bit R as the default configuration. However, if we want to run the odbcConnectExcel function which only works under 32-bit scenary, we have to switch the current active configuration to 32-bit R. This tutorial...
Read More

Monday, July 15, 2013

Use Eclipse as IDE for R under Windows

| |
0 comments
Background Eclipse is an open source Integrated Development Environment (IDE). As with Microsoft's Visual Studio product, Eclipse is programming language-agnostic and supports any language having a suitable plugin for the IDE platform. For Eclipse, the R language plugin is StatET. The StatET plugin enables Eclipse to connect to R. You...
Read More

Sunday, July 14, 2013

Import date from Excel spreadsheet into R using RODBC package

| |
0 comments
Package RODBC can be used not only for ODBC database connectivity, but also for importing Excel spreadsheet data into R, as shown in following R code: library(RODBC) data=odbcConnectExcel(file.choose()) mydata=sqlFetch(data,"Sheet1") odbcClose(data) mydata Here, the odbcConnectExcel establishes a connection to an external Excel spreadsheet. Note: Function 'odbcConnectExcel' is only usable with 32-bit R. Under Eclipse...
Read More

Import data from Microsoft SQL server to R using RODBC package

| |
0 comments
As preparation, first create an ODBC driver connection for SQL Server by Control Panel >> Administrative Tools >> Data Sources (ODBC) Then import data from SQL server with following R code library(RODBC) conn <- odbcConnect(dsn="ACCPAC 54 SQL",uid="my_ID",pwd="my_PWD") #sqlTables(channel) queryResult <- sqlQuery(conn,...
Read More

Import data from Microsoft SQL server to R using RJDBC package

| |
0 comments
Environment Windows 7, 64-bit R 2.15.1 (32- & 64-bit) Microsoft SQL Server 2008 Installation & Usage Download JDBC driver from Microsoft ( Link ) and install it so that RJDBC plugin is able to interact with SQL Server database via the Java interface. You can install the driver to a local folder, such as C:\Program Files\Microsoft SQL Server JDBC Driver 3.0 The latest RJDBC release...
Read More

Saturday, June 22, 2013

Truncate minute and second timestamp from date value in SQL

| |
0 comments
Suppose we retrieve a variable 'Valuation_Date' from SQL database and get following number 2012-01-22 00:00:00.000 We can use convert function to truncate minute and second timestamp using the convert function convert(varchar(8), Valuation_Date, 112) then we will get following reault: 201201...
Read More

Thursday, June 20, 2013

Matlab tip -- finding the indices of the elements of one array in another

| |
0 comments
Suppose all elements in array1 are contained in array2, now we want to get the indices of array1's elements in array2. Here is a simple and neat solution, using Matlab's arrayfun function, which applies a function to each element of an array. array1=[1,6,2,3,7]; array2=[3,6]; arrayfun(@(x)find(array1==x,1),array2) The output is: ans =       4    ...
Read More

Monday, June 17, 2013

A beginner's tutorial for R

| |
0 comments
Some common commands # Quit R q() q(save="no") # Setting the default working directory setwd(file="c:\\AnyDirectory\\") setwd(file="c:/AnyDirectory/") # Get the default working directory getwd() # See which variables are currently in the workspace ls() # Remove a list of variables rm(var1,var2,var3,...) # Remove all objects from workspace rm(list=ls()) # Note: the variables whose names begin with a dot are not listed...
Read More

Control Excel chart position with row and column numbers in Matlab

| |
0 comments
Sometimes we want to align, in Excel spreadsheet, a chart with a cell which, for example, may contain a label for the chart. We can easily drag (with mouse) the chart to make it aligned with the cell, but it may not be so easy to do this by program. The challenge here is that in Excel spreadsheet a cell position is expressed in row and columns, while a chart position is expressed in points. Depending on the screen resolution,...
Read More

A latex template for writing an technical article

| |
0 comments
\documentclass[8pt,onecolumn,letterpaper]{article} \usepackage[top=0.5in, bottom=0.5in, left=1.0in, right=1.0in]{geometry} \setlength{\columnseprule}{0.25pt} \usepackage[utf8x]{inputenc} \usepackage{ucs} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{bm} \setlength{\parindent}{0in} \setlength\parskip{0.1in} \linespread{1.25} \usepackage{graphicx} \usepackage{color} \usepackage[colorlinks=true, pdfstartview=FitV,...
Read More

Southeast and Gulf Coast electricity markets

| |
0 comments
Unlike regions with independent power grids, power in the Southern states is provided by integrated power companies. Each of these companies is linked to nearby grids and power can be traded between them. However, because these are still regulated markets, there is little opportunity to trade power within the service area of any of these...
Read More

New England electricity market (ISO-NE)

| |
0 comments
There is only a single trading hub in the New England region. The price at thsi hub are based on selected nodes around the Boston area. New England has to import fuel for almost all of its power generation requirements. The marginal fuel for the region is natural gas. The bulk of this supply comes from the U.S. Gulf Coast and eastern...
Read More

New York electricity market (NYISO)

| |
0 comments
The New York power grid is self-contained in the state of New York. The southeastern part of this region the most heavily concentrated areas of demand for electricity in the country: New York City and Long Island. The region is characterized by the flow of low cost power from the northern and western sections of the state into the high...
Read More

Midwest electricity market (MISO)

| |
0 comments
The Midwest ISO coordinates power for the north-central United States The eastern part of the MISO region is heavily industrialized. The western section of th MISO region is more rural. There are several major trading locations in the region. among them Cinergy Hub is the most influential. From a climate perspective: ...
Read More

Mid-Atlantic electricity market (PJM ISO)

| |
0 comments
The Mid-Atlantic region contains many large population centers, like Washington D.C., Baltimore, and Philadelphia, on the eastern seaboard. This area formed one of the first independent power grids, the PJM ISO, named after its condtituent states: Pennsylvania, New Jersey, and Maryland.PJM has since expanded to include West Virginia,...
Read More

Pacific northwest electricity market

| |
0 comments
In most years, the Pacific Northwest sells surplus power into California and the Southwest. About two-thirds of all the electricity in this region comes from hydroelectric production ==> the quantity of surplus power depends heavily on precipitation ==> Water flow in this region directly affects the price of power in California. Melting...
Read More

Desert southwest electricity market

| |
0 comments
The desert southwest has moderate winter and prolonged hot summers Mush of the year, the area has a surplus of generation capacity and is a major exporter of power to South California. Natural gas is the most common marginal fuel due to the abundant natural gas reserves, but coal and hydropower are relatively common too. The area also...
Read More

California electricity market (CAISO)

| |
0 comments
California is a heavily populated state that is divided into two major zones: NP-15 and SP-15. Most of the year, the daily temperatures are moderate to warm. However, the dense population and hot summers can cause spikes in the electrical loads due to a demand for air conditioning. One of the major transmission lines, Path-15, bisects...
Read More

Monday, May 13, 2013

Regional power markets in United States

| |
0 comments
There are three major integrated power grids in the United States: Eastern Interconnect --- east of the Rocky Mountains Western Interconnect --- west of the Rocky Mountains Texas Interconnect --- Texas Inside each interconnection, all of the transmission lines are synchronized ==> allows power to be transported across long distances...
Read More

Sunday, May 12, 2013

Heat rate and spark spreads

| |
0 comments
Heat rates Heat rate represent the efficiency of a power plant to convert fuel into electricity ==> Lower heat rate implies a more efficient power plant. Heat Rate=Quantity of fuel usedQuantity of power produced The unit of heat rate is Btu/KWh or MMBtu/MWh, with 1 MMBtu/MWh = 1000 Btu/KWh For...
Read More

Design of electrical trading markets

| |
0 comments
Spot vs forward power markets The forward power market is where the bulk of speculative tradings occur, while the spot power market is where daily auctions occur. The forward market is open to anyone with sufficient money to meet trading requirements, while the spot market is open only to power providers with the ability to generate power...
Read More

Overview of electricity markets

| |
0 comments
It is hard to store electricity and expensive to transmit electricity over long distance ==> No unified national electricity market, instead just a collection of small regional markets with their own unique characteristics and regulations.In each market, supply and demand must constantly be matched, resulting in highly volatile prices. Regulations...
Read More

Factors affecting natural gas prices

| |
0 comments
Natural gas prices are a function of market supply and demand. Because of limited alternatives for natural gas consumption or production in the short run, even small changes in supply or demand over a short period can result in large price movements to bring supply and demand back into balance. See Today in Energy, June 11, 2012 for recent...
Read More

The price of natural gas

| |
0 comments
The price that residential consumers pay for natural gas has two main parts (all cost components include a number of taxes): Commodity costs — the cost of the natural gas itself, known as the wellhead cost. Transmission and distribution costs — the cost to move the natural gas by pipeline from where it is produced to the customer's local...
Read More

Natural gas consumption in United States

| |
0 comments
Natural Gas Is a Major Energy Source for the United States About 25% of energy used in the United States came from natural gas in 2011. The United States used 24.37 trillion cubic feet (Tcf) of natural gas in 2011. How Natural Gas Is Used Natural gas is used to produce steel, glass, paper, clothing, brick, electricity, and as an essential...
Read More

Natural gas reserves in United States

| |
0 comments
Underground Reservoirs Hold Oil and Gas A "reservoir" is a place where large volumes of methane, the major component of natural gas, can be trapped in the subsurface of the Earth at places where the right geological conditions occurred at the right times. Reservoirs are made up of porous and permeable rocks that can hold significant amounts...
Read More

Natural gas imports and exports

| |
0 comments
The United States consumes more natural gas than it produces. While most of the natural gas consumed in the United States is produced domestically, imports from other countries are also an important source of supply. The United States is a "net importer" of natural gas, meaning that it imports more natural gas than it exports. Reliance...
Read More

Where our natural gas comes from

| |
0 comments
Most of the Natural Gas Consumed in the United States Comes from Domestic Production U.S. natural gas production and consumption were nearly in balance through 1986. After that, consumption began to outpace production, and imports of natural gas rose to meet U.S. demand for the fuel. Production increased from 2006 through 2011, when it...
Read More

Liquefied natural gas (LNG)

| |
0 comments
Liquefied natural gas (LNG) is natural gas that has been cooled to about -260°F for shipment and/or storage as a liquid. The volume of the liquid is about 600 times smaller than in its gaseous form. In this compact form, natural gas can be shipped in special tankers to receiving terminals in the United States and other importing countries....
Read More

Natural gas pipelines

| |
0 comments
An intricate transportation system, made up of about 1.5 million miles of mainline and other pipelines, links production areas and natural gas markets. The U.S. natural gas transportation network delivered more than 24 trillion cubic feet of natural gas during 2010 to about 71 million customers. What Makes Up This Transportation Network? Transporting...
Read More

Delivery and storage of natural gas

| |
0 comments
Natural Gas Is Often Stored Before It Is Delivered Natural gas is moved by pipelines from the producing fields to consumers. Because natural gas demand is greater in the winter, it is stored along the way in large underground storage systems, such as old oil and gas wells or caverns formed in old salt beds. The gas remains there until it...
Read More

Formation and extrapolation of natural gas

| |
0 comments
How Was Natural Gas Formed? The main ingredient in natural gas is methane, a gas (or compound) composed of one carbon atom and four hydrogen atoms. Millions of years ago, the remains of plants and animals (diatoms) decayed and built up in thick layers. This decayed matter from plants and animals is called organic material — it was once...
Read More

Saturday, May 11, 2013

Anatomy of natural gas market in United States

| |
0 comments
Note: This article is extracted from the book: Book name, Author, Publisher, Year. The United States natural gas market can be divided into following sub-regions: Western Gas Region Electrical generators through out this entire region depend on natural gas as a primary fuel. In summers it is very hot, and natural gas is especially...
Read More
Powered by Blogger.