instruction
stringlengths
9
38.7k
I am working on binary classification problem. Data set is very large and highly imbalanced. Data dimensionality is also very high. Now I want to balance data by under-sampling the majority class, and I also want to reduce data dimensionality by applying PCA, etc... So my question is that which one should be applied f...
I'm trying to understand how Boltzmann machines work, but I'm not quite sure how weights are learned, and haven't been able to find a clear description. Is the following correct? (Also, pointers to any good Boltzmann machine explanations would also be great.) We have a set of visible units (e.g., corresponding to black...
As I have written in my question "How much undersampling should be done?", I want to predict defaults, where a default is per se really unlikely (average ~ 0.3 percent). My models are not affected by the unequal distribution: It's all about saving computing time. Undersampling the majority class to a ratio [defaulting/...
I have a data-table that has about 26000 rows and about 35 columns. The columns are paired, so the values in columns 6 and 7 (for example) are related to each other, so are 8 and 9 and so on. There are 23 different types of annotations in the table, which I have read in as "factor". The ratio of these pairs of colum...
My question relates mostly around the practical differences between General Linear Modeling (GLM) and Generalized Linear Modelling (GZLM). In my case it would be a few continuous variables as covariates and a few factors in an ANCOVA, versus GZLM. I want to examine the main effects of each variable, as well as one thre...
I am writing about using a 'joint probability distribution' for an audience that would be more likely to understand 'multivariate distribution' so I am considering using the later. However, I do not want to loose meaning while doing this. Wikipedia seems to indicate that these are synonyms. Are they? If not, why not?
How would you get hourly means for multiple data columns, for a daily period, and show results for twelve "Hosts" in the same graph? That is, I'd like to graph what a 24 hour period looks like, for a weeks worth of data. The eventual goal would be to compare two sets of this data, before and after samplings. ...
I have a CSV file with 4 million edges of a directed network representing people communicating with each other (e.g. John sends a message to Mary, Mary sends a message to Ann, John sends another message to Mary, etc.). I would like to do two things: Find degree, betweeness and (maybe) eigenvector centrality measures f...
Hellwig's method is a method of selection of variables in linear model. It is widely used in Poland, probably only in Poland because it is really hard to find it in any scientific paper written in English. Description of method: $m_{k}$ - set of variables in k'th combination (there are $2^{p}-1$ combinations, where p...
I'm tasked with deriving the MGF of a $\chi^2$ random variable. I think the way to do is is by using the fact that $\Sigma_{j=1}^{m} Z^2_j$ is a $\chi^2$ R.V. and that MGF of a sum is the product of the MGFs of the individual terms. Although that may not be right and it may be $E(e^{tX})$ way. I don't need it solved...
What is paired t-test, and under which circumstances should I use paired t-test? Is there any difference between paired t-test and pairwise t-test?
My Aim: I'd like to a have a function that takes an email address and outputs a quasi-random number of 1, 2, 3, or 4. A little detail: By quasi-random number I mean that given a typical population of email addresses, the probabilities of getting a value of 1, 2, 3, or 4 are roughly equal, and that obvious systematic pr...
Random walk Metropolis-Hasitings with symmetric proposal $q(x|y)= g(|y-x|)$ has the property that the acceptance probability $$P(accept\ y) = \min\{1, f(y)/f(x)\}$$ does not depend on proposal $g(\cdot)$. Does that mean that I can change the $g(\cdot)$ as a function of previous performance of the chain, without affect...
If you can measure a time series of observations at any level of precision in time, and your goal of the study is to identify a relationship between X and Y, is there any empirical justification for choosing a specific level of aggregation over another, or should the choice be simply taken based on theory and/or practi...
The following problem comes from a max likelihood calculation for gaussian families, but is of independent interest. Is it possible to find a closed-form approximation for small values of $x$ for $\text{det}(B + xI)$ where I is the identity matrix and B is hermitian rank-deficient positive semidefinite?
Currently i am using RF toolbox on MATLAB for a binary classification Problem Data Set: 50000 samples and more than 250 features So what should be the number of trees and randomly selected feature on each split to grow the trees? can any other parameter greatly affect the results?
I have a smooth but rather complex curve, sampled with a good frequency. I apply the discrete Fourier transform to it using the fast Fourier transform (FFT) algorithm and get its Fourier image. I need to find peaks on the resulting Fourier transform curve, but the image I get contains a substantial amount of noise, whi...
suppose you might buy some software to be used in a ML/NLP/DM laboratory. What software package would you ask for? Let's say: MATLAB (with some toolboxes), SPSS, and what else? I know that there is a lot of free software one can use like R, Weka, Rapidminer, python packages, and so on. However, the above question targe...
Can somebody explain me clear the mathematical logic that would link two statements (a) and (b) together? Let us have a set of values (some distribution). Now, a) Median does not depend on every value [it just depends on one or two middle values]; b) Median is the locus of minimal sum-of-absolute-deviations from it. An...
Jeffrey Wooldridge in his Econometric Analysis of Cross Section and Panel Data (page 357) says that the empirical Hessian "is not guaranteed to be positive definite, or even positive semidefinite, for the particular sample we are working with.". This seems wrong to me as (numerical problems apart) the Hessian must be p...
Per my earlier question I'm trying to find a reasonable metric for the semantic distance between two short text strings. One metric mentioned in the answers of that question was to use shortest hypernym path to create a metric for phrases. So for instance, if I was to find the semantic distance between pig and dog, I...
Winbugs seem to support either stochastic or deterministic relationship between variables. However, many Bayesian Networks represent relationships between variables using conditional probability tables. The "visit to Asia", "burglar alarm", "smoking & cancer" examples are classic introductory material. However, condi...
I have data with many correlated features, and I want to start by reducing the features with a smooth basis function, before running an LDA. I'm trying to use natural cubic splines in the splines package with the ns function. How do I go about assigning the knots? Here's the basic R code: library(splines) lda.pred <- ...
I have an experiment producing results (dependent variables) that don't pass tests of normality, thus I am testing hypotheses using non-parametric tests. My DVs are continuous, while my factors (independent variables) are ordinal or nominal. I've been using the Kruskal-Wallis test and Friedman test (using Matlab). Most...
I am new to statistics, so pardon any mistakes in my question. I have two time series $X_i$ and $Y_i$. Assuming that they're stationary AR(1) processes with possibly different means, how do I test for difference of means? I found this link (but tests only one sample) which discusses using gls: https://stat.ethz.ch/pipe...
Consider a single x axis representing points along a line in space. I've got a set of data (in this case the receptive fields of hippocampal place cells recorded as a rat runs along a linear track), which are themselves spatially extensive, ie. if displayed graphically against the axis they would look like a series of ...
I am working with the dataset of some heights and weights at different ages. My professor wants me to plot the residuals from regression of soma.WT9 against the residuals from regression of HT9.WT9 (don't mind the notation it's just two columns where soma is being regressed on WT9 and HT9 being regressed on WT9). What...
I am new here, so I might have missed a similar question. I am trying to do things good in my research and using proper statistical approaches, but in computer science, we had quite a weak training on statistical methods applied to our research. So, what I am asking is probably trivial. Here is the problem: We have a ...
I have a question about a rotation matrix, which can be represented in 2 dimensions as: $$R_{2}(\theta)=\begin{bmatrix} \cos\theta & \sin\theta \\ -\sin\theta & \cos\theta \end{bmatrix}$$ For some arbitrary angle $\theta$. This can be extended to an arbitrary number of dimensions by adding an identity matrix: $$R_{n}...
I'm running a simulation on R and a cluster of computers and have the following problem. On each of X computers I run: fxT2 <- function(i) runif(10) nessay <- 100 c(mclapply(1:nessay, fxT2), recursive=TRUE) There are 32 computers, each with 16 cores. However, around 2% of the random numbers are identical. What strateg...
Suppose I have a function f, and I want to sample it at 100 points in the interval [0, 100]. For some reason (that seemed smart to me at the time), I decided to not sample at equidistant intervals, but rather use the following function to determine the sample points: log2(x)*(100/log2(100)) This gives me a sequence of...
I'm trying to write a function to graphically display predicted vs. actual relationships in a linear regression. What I have so far works well for linear models, but I'd like to extend it in a few ways. Handle glm models Deal with NAs in the predicted values Does what I have so far seem like a good solution, or is t...
I find R can take a long time to generate plots when millions of points are present - unsurprising given that points are plotted individually. Furthermore, such plots are often too cluttered and dense to be useful. Many of the points overlap and form a black mass and a lot of time is spent plotting more points into tha...
I am trying to get upto speed in Bayesian Statistics. I have a little bit of stats background (STAT 101) but not too much - I think I can understand prior, posterior, and likelihood :D. I don't want to read a Bayesian textbook just yet. I'd prefer to read from a source (website preferred) that will ramp me up quickly....
I know this is a fairly specific R question, but I may be thinking about proportion variance explained, $R^2$, incorrectly. Here goes. I'm trying to use the R package randomForest. I have some training data and testing data. When I fit a random forest model, the randomForest function allows you to input new testing dat...
I've got a particular MCMC algorithm which I would like to port to C/C++. Much of the expensive computation is in C already via Cython, but I want to have the whole sampler written in a compiled language so that I can just write wrappers for Python/R/Matlab/whatever. After poking around I'm leaning towards C++. A coupl...
In Orwin's fail safe N test how to decide the values of criterion for a trivial log odd's ratio and mean log odds ratio in missing studies. I am a medical doctor. Please tell me in simple english. The data are 1. Classic fail-safe N Z-value for observed studies 27.97543 P-value for o...
The standard factor model formulation is $y=W x+\epsilon$ where $x \sim \mathcal{N}(0, I)$, $\epsilon \sim\mathcal{N}(0, \Sigma)$. $W$ and $\Sigma$ are typically estimated from MLE. The solution can be obtained numerically; in general there are no analytical solutions. Question: assume that $\Sigma$ belongs to some cla...
I am a beginner in statistics, therefore I hope I can state my problem in a correct manner. I have a some instances or samples and I can collect below statistical parameters for classification and regression problem: Sample Size Minimum value Maximum value Standard deviation Variance Mean And, I want to use z-scores ...
I would like to check different gradient algorithms. For example: fr <- function(x) { ## Rosenbrock Banana function x1 <- x[1] x2 <- x[2] print(c(x1,x2)) 100 * (x2 - x1 * x1)^2 + (1 - x1)^2 } optim(c(-1.2,1),fr,method="BFGS") prints to the screen the values at which the RBF h...
Inter-market analysis is a method of modeling market behavior by means of finding relationships between different markets. Often times, a correlation is computed between two markets, say S&P 500 and 30-Year US treasuries. These computations are more often than not based on price data, which is obvious to everyone that ...
I'm reading through someone else's code for plotting the results of a psychology experiment, and (according to the code comments) they calculate the accuracy error of their behavioral paradigm as follows: $\textit{accuracy error} = \sqrt{\frac{(\textit{accuracy}) (1-\textit{accuracy})}{\textit{total trials}}}$ It's out...
this is my first post. I'm truly grateful for this community. I am trying to analyze longitudinal count data that is zero-truncated (probability that response variable = 0 is 0), and the mean != variance, so a negative binomial distribution was chosen over a poisson. Functions/commands I've ruled out: R gee() function...
My question deals with how to be able to assert that an "improved" evolutionary algorithm is indeed improved (at least from a statistic point of view) and not just random luck (a concern given the stochastic nature of these algorithms). Let's assume I am dealing with a standard GA (before) and an "improved" GA (after)....
I have seen asserted that the problem of computing the null distribution of Kolmogorov's $D_n^+$ statistic for a finite sample size maps onto the problem of computing the number of lattice paths that stay below the diagonal, and thus can be solved by the ballot theorem. I am familiar with lattice paths and the ballot p...
I have searched a lot, and I can only find tables that show critical values up to n=30. Can someone provide, or point me to, a simple method of estimating this value for different $\alpha$?
Given two histograms, how do we assess whether they are similar or not? Is it sufficient to simply look at the two histograms? The simple one to one mapping has the problem that if a histogram is slightly different and slightly shifted then we'll not get the desired result. Any suggestions?
I know that a Type II error is where H1 is true, but H0 is not rejected. Question How do I calculate the probability of a Type II error involving a normal distribution, where the standard deviation is known?
I recently stumbled upon the concept of sample complexity, and was wondering if there are any texts, papers or tutorials that provide: An introduction to the concept (rigorous or informal) An analysis of the sample complexity of established and popular classification methods or kernel methods. Advice or information on...
Here's a real basic question. I'm trying to teach myself a bit of stats with Verzani's Using R for Introductory Statistics. In question 5.13 he asks: A sample of 100 people is drawn from a population of 600,000. If it is known that 40% of the population has a specific attribute, what is the probability that 35 or fewer...
I want to model how traffic will flow on real networks (not just the internet, also, say, Intel's internal LAN). Is there a place I can get real network topologies data I can use?
What are the statistical techniques to create a sample set, which is representative of the entire population (with a known confidence level)? Also, How to validate, if the sample fits the overall dataset? Is it possible, without parsing the entire dataset (which could be billions of records)?
I have been doing some casual internet research on biclusters. (I have read the Wiki article several times.) So far, it seems as if there are few definitions or standard terminology. I was wondering if there were any standard papers or books that anybody who is interested in algorithms for finding biclusters should ...
I have network traffic data in the following for for each hour of a ten day period as follows in a R dataset. Day Hour Volume Category 0 00 100 P2P 0 00 50 email 0 00 200 gaming 0 00 200 ...
How can I conduct an Egger's test using SPSS17? For each study included in the meta-analysis I know effect size and sample size of patients and controls groups.
What should I do if the expected value in a Chi-square goodness-of-fit test is zero? I know there's Fisher's test but I have a very large table!
A uniform prior for a scale parameter (like the variance) is uniform on the logarithmic scale. What functional form does this prior have on the linear scale? And why so?
In SPSS Version 19 there seems to be a new feature called Automatic Linear Modelling. It creates a 'Model' (which is new to me) and the function seems to combine a number of the functions that is typically required for prediction model development. The functionality seems incomplete with only a subset of prediction se...
As a basic question in Regression Analysis, I wanted to ask how can I calculate Margin of Error when I fit a straight line to a set of data. Assume that I have variation of parameter $A$ as a function of parameter $B$, then $A=mB \pm e$, where $m$ is the tangent of the fitted straight line and $e$ is what i'm looking f...
You can have data in wide format or in long format. This is quite an important thing, as the useable methods are different, depending on the format. I know you have to work with melt() and cast() from the reshape package, but there seems some things that I don't get. Can someone give me a short overview how you do this...
I need to determine the KL-divergence between two Gaussians. I am comparing my results to these, but I can't reproduce their result. My result is obviously wrong, because the KL is not 0 for KL(p, p). I wonder where I am doing a mistake and ask if anyone can spot it. Let $p(x) = N(\mu_1, \sigma_1)$ and $q(x) = N(\mu_2,...
Both Root Mean Square and Average absolute deviation seem like the measures of the magnitude of variability (especially when the variates are both +ve and -ve). What are the rules of thumb to choose one of them over the other?
I have a problem with the estimation parameter for Zipf. My situation is the following: I have a sample set (measured from an experiment that generates calls that should follow a Zipf distribution). I have to demonstrate that this generator really generates calls with zipf distribution. I already read this Q&A How to...
Can someone refer me to a good reference that explains the connection between Bayesian statistics and generative modeling techniques? Why do we usually use generative models with Bayesian techniques? Why it is especially appealing to use Bayesian statistics in the absence of complete data, if at all? Note that I come f...
I'm trying to normalize a set of columns of data in an excel spreadsheet. I need to get the values so that the highest value in a column is = 1 and lowest is = to 0, so I've come up with the formula: =(A1-MIN(A1:A30))/(MAX(A1:A30)-MIN(A1:A30)) This seems to work fine, but when I drag down the formula to populate the ce...
I want to cluster elements in array. The crucial difference from a normal clustering algorithm is that the order of elements is significant. For instance if we look at a simple sequence of numbers like this: 1.1, 1.2, 1.0, 3.3, 3.3, 2.9, 1.0, 1.1, 3.0, 2.8, 3.2 It is obvious that there are two clusters in there (1.1, ...
Background I am overseeing the input of data from primary literature into a database. The data entry process is error prone, particularly because users must interpret experimental design, extract data from graphics and tables, and transform results to standardized units. Data are input into a MySQL database through a w...
Can the standard deviation be calculated for the harmonic mean? I understand that the standard deviation can be calculated for arithmetic mean, but if you have harmonic mean, how do you calculate the standard deviation or CV?
I am trying to do a multiple logistic regression for 2 similar groups. I have a few questions: In doing a univariate analysis, do I enter each independent variable, one at a time, first into the binary regression, before going on to do the multivariate analysis? Or is the significance values from Chi-square or t-test ...
Before submission of my meta-analysis I want to make a funnel plot to test for heterogeneity and publication bias. I have the pooled effect size and the effect sizes from each study, that take values from -1 to +1. I have the sample sizes n1, n2 for patients and controls from each study. As I cannot calculate the stand...
I've performed a study which yielded (?) the following results: - no bike box bike box % change correct procedure 173 55 -27% incorrect procedure 68 50 69% Since a result could only be one of the two - correct and incorrect procedure, do...
Context I have a survey that asks 11 questions about self-efficacy. Each question has 3 response options (disagree, agree, strongly agree). Nine questions ask about self-esteem. I have used a factor analysis of the 11 self-efficacy items and extracted two factors. $x_1$ to $x_{11}$ denote the 11 self-efficacy questio...
If kNN doesn't perform well for classification on a dataset, is there any hope for parametric methods to perform better? Kernel-based methods, SVM, random forests, and neural networks. Could any of these outperform kNN method?
How can I test the statistical significance of regression coefficients in multivariate multiple regression?
There is a catalog of noninformative priors over here: http://www.stats.org.uk/priors/noninformative/YangBerger1998.pdf in page 11, they give the noninformative Jeffreys prior for the Dirichlet distribution. They give the Fisher information matrix for the Dirichlet. Can someone tell me exactly what is cell (i,j) there ...
This is a question about terminology. Is a "vague prior" the same as a non-informative prior, or is there some difference between the two? My impression is that they are same (from looking up vague and non-informative together), but I can't be certain.
When presenting statistical information using bar charts, when will you need to use Error Bar charts?
there is a short introduction to AB Tests in this question or here at 20bits. We are currently testing different versions of landing pages and are using the conversion rate (e.g. 4% vs. 5%) to track which version performs better. This is working fine so far. What I would like to do is start calculating whether a versio...
If I hypothesize that a gene signature will identify subjects at a lower risk of recurrence, that is decrease by 0.5 (hazard ratio of 0.5) the event rate in 20% of the population and I intend to use samples from a retrospective cohort study does the sample size need to be adjusted for unequal numbers in the two hypothe...
We are dealing with a measurement apparatus that is cursed by noise and are trying to find out if a measurement was noise or an actual measurement. Assume we have a beam of light incident on an square array of photo detectors. The "counts" measured in the individual tubes follow Poisson statistics. A typical beam distr...
What is the best way to correlate zero-inflated count variables with a small sample size (n=~50 and N=99)?
Could anyone offer some pointers on how to use the weights argument in R's lm function? Say, for instance you were trying to fit a model on traffic data, and you had several hundred rows, each of which represented a city (with a different population). If you wanted the model to adjust the relative influence of each o...
What are some techniques for sampling two correlated random variables: if their probability distributions are parameterized (e.g., log-normal) if they have non-parametric distributions. The data are two time series for which we can compute non-zero correlation coefficients. We wish to simulate these data in the futu...
If I define a function in IML: start func(a); submit a / R; print(&a); endsubmit; finish; and run it: run func("character string"); I get the error message: object 'character string' does not exist. So R or IML is evaluating the character string into an object. I want R to output "character string." How do I...
Consider a Jeffreys prior where $p(\theta) \propto \sqrt{|i(\theta)|}$, where $i$ is the Fisher information. I keep seeing this prior being mentioned as a uninformative prior, but I never saw an argument why it is uninformative. After all, it is not a constant prior, so there has to be some other argument. I understand...
I have quarterly sales data for a variety of stores and would like to estimate the effect of a regulation on sales. A panel type model would appear to be appropriate in this case, with the regulation as a dummy variable. However, the quantity of sales varies by two-orders of magnitude between stores. How should I acc...
I would appreciate some advice on how best to weight or give more importance to a percentage with a larger denominator. Eg A. 1 out of 2 = 50% B. 5 out of 10 = 50% C. 500 out of 1000 = 50% Some of the data is sparse and continually emerging so A) could just be a blip and could change, B) is emerging and may vary s...
I'm trying to implement a "change point" analysis, or a multiphase regression using nls() in R. Here's some fake data I've made. The formula I want to use to fit the data is: $y = \beta_0 + \beta_1x + \beta_2\max(0,x-\delta)$ What this is supposed to do is fit the data up to a certain point with a certain intercept an...
A simplified regression equation $ES=\frac{a+b}{n_1+n_2}$ has been suggested as an alternative to Egger's regression equation $\frac{ES}{SE}=\frac{a+b}{SE}$, where ES=Effect Size, $n_1$=sample size of the patients, $n_2$=sample size of the controls, SE=Standard Error. This alternative test, that was presented by Peters...
I have the data about process duration (in minutes) and components (procedures) done during it like this (CSV): id,time,p1,p2,p3,p4 1,30,1,0,0,0 2,32,1,0,0,0 3,56,1,1,0,0 4,78,1,1,0,1 5,78,1,1,0,1 6,100,1,1,1,1 7,98,0,1,1,1 I need to estimate the duration of each component(procedure) I want to get something like thi...
I would like to ask you, what is the correct number of Lags in ARCH LM Test? I am referring to ArchTest in FinTS package, but other ArchTest (such as the one in Eviews) provide same results. In many time series, when I choose Lags between 1:5 the p.value is usually higher than 0.05, but with increasing of Lags, p.valu...
I have a contingency table which is not fixed, it varies depending on on the data. I want to know how significant a particular cell is compared with the other cells. Is there a method of doing this?
What is the appropriate strategy for deciding which model to use with count data? I have count data that i need to model as a multilevel model and it was recommended to me (on this site) that the best way to do so this is through bugs or MCMCglmm. However i am still trying to learn about bayesian statistics, and i tho...
I have to demonstrate that a generator of VoIP calls generates calls uniformly distributed between callers. In particular the distribution is the uniform (min, max) one where the volume per caller distribution is uniformly distributed between a minimum and maximum. So by running a test with 10000 users and a min value ...
For R, I understand that the package lme4 and the function glmer roughly corresponds to glimmix in SAS. What is the default covariance structure when fit and can it be changed? If so how?
As the title suggests, I'm pretty well befuddled about which approach makes the most sense for my data. Let me try to succinctly explain the problem. I have binary choice data representing whether a specific person for a specific event took the train or bus. I have event level predictors (location of event, duration of...
I am running an ordinal logistic regression in R and running into trouble when I include dummy variables. My model works great with my first set of predictors. Next I want to add dummy variables for each of the years represented in my dataset. I created the dummy variables with car:recode in this manner (one statem...
I have data about how many unique users do a certain thing for each day of a month. I can average it, and i would like to display the variation in a intuitive format (such as % of something). Is there a standard way of doing this? I've found standard error, which is $\frac{\sigma}{\sqrt{n}}$, which is not particularl...
I am trying to manage a meta-regression in SPSS17 using the effect size as the dependent variable. I want to explore if my independent variables affects the effect size. Some small practical questions: What is the minimum number of studies necessary for a meta-regression? Some people suggest at least 10 studies are r...
The linear SVM in textbook takes form of maximizing $L_D = \sum_i{a_i} - \frac{1}{2}\sum_{i,j}{a_ia_jy_iy_jx_i^Tx_j}$ over $a_i$ where $a_i \geq 0$ and $\sum_i{a_iy_i} = 0$ Since $w = \sum_i{a_iy_ix_i}$, the classifier will take the form $\text{Sgn}(wx - b)$. Thus, it seems to solve linear SVM, I need to figure out $a_...