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...
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.
Please visit http://www.quantlego.com for active updates.
Sorry for any inconvenience.
Saturday, June 22, 2013
Thursday, June 20, 2013
Matlab tip -- finding the indices of the elements of one array in another
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 ...
Monday, June 17, 2013
A beginner's tutorial for R
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...
Control Excel chart position with row and column numbers in Matlab
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,...
A latex template for writing an technical article
\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,...
Southeast and Gulf Coast electricity markets

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...
New England electricity market (ISO-NE)

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...
New York electricity market (NYISO)

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...
Midwest electricity market (MISO)

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:
...
Mid-Atlantic electricity market (PJM ISO)

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,...
Pacific northwest electricity market

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...
Desert southwest electricity market

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...
California electricity market (CAISO)

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...
Subscribe to:
Posts (Atom)
Powered by Blogger.