instruction
stringlengths
9
38.7k
Receiver operating characteristics (ROC) curves provide critical performance insights for the evaluation of an authentication algorithm. However, there are two different versions of it in literature I'm not sure which one to follow. ROC curves mostly appear to have the FAR or FPR on the $x$-axis and the sensitivity or ...
I have a small data set of $150$ points each with four features. I plan to fit a SVM regression for the reason that the $\varepsilon$ value gives me the possibility of define a tolerance value, something that isn't possible in other regression techniques. I have run cross-validated grid search on the $\gamma$ and $C$ v...
I am building a movie recommender. But unlike common recommender from movielens data, features of my movies are sets like actor list, genre list, list of producers and writers etc. I know I can use Jaccard similarity to find similarity of 2 movies on one feature but I cant figure out how to combine these features to fi...
I'm trying to compare the prevalence of a specific lesion (binary) at the symptomatic side to the asymptomatic side within a group of patients. I've already performed a McNemar test to compare the prevalence at the symptomatic versus asymptomatic side within patients. However, I'm asked to also perform a conditional l...
I have a wood-burning lambda-controlled furnace that collects a number of variables during its operation once a minute, such as: exhaust oxygen content (lambda probe) exhaust temperature furnace temperature air inlet opening percentage (0-100%) exhaust fan speed mode of operation (off, ignition, full power, half po...
I have 14 observations. There are 11 independent variables $(x_1,x_2,\dots,x_{11})$. Dependent variables and all independent variables are continuous. I am not sure which regression model we use in this case to predict y( dependent variable). Any hints ?
I am performing a regression on one variable against a set of predictors. I am trying to test whether a certain variable (constructed by myself from 3 other variables) had a significant effect on the response. Feasibly, the other three variables could have had an impact on the response by themselves. Therefore, I have...
Consider $\theta \sim N(\mu,\sigma^2)$. And let $\Phi(\cdot)$ denote the CDF of standard normal distribution. Then what is the distribution of $\Phi(\theta)$?
I'm trying to do text detection thanks to Naive Bayes Algorithm. If I teach my tool: "Football is a great hobby" and assign it to the label "football", I'm totally fine with it detecting "I play football" as "football" The issue is, if I have a sentence that does not match ANY label, the probability will be the same f...
Problem Background: I have free form text data with more or less arbitrary formatting/structure, but semantically it can be broken down like this: {header} {title} {subtitle} {article} {boilerplate} However, not all sections need necessarily have Length > 0, except {article} and {title}. Another thing to consider is t...
Is there a theorem indicating that the OBB obtained by PCA from a point cloud is almost the same (or the same) than the one obtained with a subset of points (regularly distributed) on the surface of this point cloud ? So that if you are given a set of points laying on the boundary of an object you do not need to use i...
$\newcommand{\P}{\mathbb{P}}$I have three variables $X_a, X_b, X_c \in \{0, 1\}$ and I define a joint distribution: $$ \P(X_a, X_b, X_c) \propto \exp \left \{ \theta_{abc} \mathbb{I}_{\{X_a = 0 \wedge X_b = 0 \wedge X_c = 0\}} \right \} $$ from which we get the following conditional probabilities of $X_a$ $$ \P(X_a...
I am attempting to analyze the relationship between exchange rates and stock market prices using the regression model below. What software package can I use to achieve this? How would I get the variables $a, \beta_1$ and $\varepsilon_t$? Model: bivariate regression model with GARCH (1, 1) error term ($\varepsilon_t$):...
I have written a short function in R to estimate the expected number of mutations that will be observed in a set of DNA sequences. The parameters are the mutation rate (x), the length of the DNA sequence (y) and the number of stretches of DNA being observed (z). I want to simulate how many mutations one expects to obs...
What to do when qqplots aren't as nice as they should be? Do you disregard the model and go look for another one? If so, how? How do you figure out from a qqplot what model you should look for? Or do you continue with the model but stress that it may not be the appropriate one? I am doing some exercises in my stat clas...
Background: I am trying to show an increase in a number of variables over time, so initially I ran a simple linear regression. However, I subsetted the data so that I could get a regression estimate for each species and reef combination (which would indicate the change per year). The entire regression would look som...
I have a data that consists of some "after treatment" and "before treatment" observations from some individuals. Specifically the data looks like this: A B C D before 10 15 4 0 after 12 12 2 3 A = not agree B = slightly not agree C = agree D = definitely agree Basically I have a group of in...
My doubt is regarding Balanced Incomplete Block Design (BIBD) Consider the following design with 9 treatments and 12 blocks each of size 3, is this design BIBD or not ? in my opinion it's not BIBD (but I am not sure whether my logic is correct). This is what my logic is: since we have 9 treatments we must have $9\c...
I know that lmer() from lme4 is the function to use to specify complex random effects. However, I need to translate the following lmer() functions into lme()from nlme package, to be able to use them in the package piecewiseSEM: canopy_mfinal <- lmer(log(Canopy) ~ Bulk_Density + H + fGrazing + (...
I am facing some weird issue on calculating $R^2$. Probably, I am messing it up somewhere badly. I am applying a LR model like this: linmodel = lm(helpfulness~., data = train) summary(linmodel) The summary of this model gives me an $R^2$ = 0.1948 I am now trying to check this $R^2$ value by using the "predict" functio...
I have a data, which looks like mixture of $\gamma$ and Gausian distributions: Could you help me to find parameters of these distributions?
I am taking a course in machine learning and just made a neural network, but I don't know how to interpret it. The input variables are related to wine, and the output variable is representing whether it is red or white wine. From the figure I should be able to interpret how the network predicts the type of wine, but I...
I'm doing some anomaly detection, basically classifying stuff as normal (0) or aberrant (1) As with all anomalies, they are rare, so during the train/test phase it's not good enough for me to just look at general training error (which would be reduced to 10% if I just guessed class 0 (normal) all the time!) with 90% no...
General Regression Neural Network is a one-pass neural network. The spread of the data sigma is updated based on output error. But I did not quite understood how it is changed. Anyone knowledgeable about this neural network can answer this? Thanks. https://www.ncbi.nlm.nih.gov/pubmed/18282872 http://easyneuralnetwork.b...
Given a sample function X(t) of a random process as \begin{equation} X(t) = \sum_{n=-\infty}^{\infty} {[\mathcal{H}(t-nT-to) - \mathcal{H}(t-nT-to-T/2)]} \end{equation} where A and B are constants, and to is uniformly distributed from 0 to T. The process is an ergodic one since it is an ensemble of pulse functions ...
In regressions, can someone explain me the difference between mean square residual and mean square error. What is the significance of each?
I am doing critical appraisal of a paper. The study has missing covariate data. The missing data is listed but it does not state what categories the data is missing? Is it appropriate to impute missing covariate data or was the study correct in just listing the amount missing and continuing with analysis. Independent ...
I'm trying to test random forest's ability to classify samples between 2 groups; There are 54 samples and varying numbers of variables used for classification. I was wondering why the out-of-bag (OOB) estimates can vary as much as 5% from one another even when I'm using 50k trees? Is this something that bootstrapping ...
I've followed the discussion stream about different types of means, towards which end I'd like to pose the following query: I have two columns of biological data tht have been log-transformed (e.g. 1000 -> 3, 100 -> 2), and I've taken the difference between them (e.g. 3 - 2 = 1). I wish to know the "mean" for the data...
If we have a probability density function, we can integrate it and now we have a cumulative probability distribution function. Can you help my intuition on why this works?
According to this paper by Meinshausen and Bühlmann (2006) the variable subset selection coming out of a Lasso is not always consistent in high-dimensional cases. It is bounded by the neighbourhood stability criterion. Is there somebody who can explain me in layman terms what this condition implies? If I understand co...
I understand that we can use time as a categorical or continuous variable in multilevel models (MLM). In which cases would it be better to use time as a categorical variable? And how is the analysis of time as a categorical variable different from that when time is continuous variable?
Do you have any case in which fitting a multivariate regression (so having multiple output nodes) outperforms the fitting of a single output one at a time in terms of accuracy? I ask this because there is not, as I see it, a sharing of information between output nodes, as could be the case in a linear multivariate reg...
I am working on a project training neural networks with an LSTM layer using Q-Learning. I haven't been able to achieve optimal results on my test bench problems. I believe my problem has to do with the internal state of the LSTM. When predicting an action using the network to modify the game state, the internal state i...
Consider the below scenario. llegal immigrant behavior: Suppose you want to interdict with illegal immigrants to catch them enter a country. Let say they wait/observe some certain condition set X (e.g., patrol schedule(if known somehow), hour of the day, day of the week, weather conditions, etc.) to move and pass the b...
$y=\beta_1+\beta_2x_2+\beta_3x_3+\beta_4x_3^2+\beta_5x_5+\beta_6x_6$ for a sample size of 50. Doing an F-test for joint significance, t-tests gives that $x_3,x_3^2,x_5$ are not significant. If I remove $x_3^2,x_5$, then $x_3$ becomes significant. Why? At first I thought of some collinearity, but one is the square of th...
How can I generate 1000-element sample using inverse CDF method? It should be easy but I'm a complete beginner. I know what it is mathematically but I don't know how to implement it in Python
I want to predict the performance of several students by using their grades during the first three years of high school in order to produce the grades of the next three years. I'm interested in any suggestion of regression methods. Here's an example of my data Year1 Year2 Year3 Year4 Year5 Year6 Student1 58 ...
If the result of series A and B shows cointegration, is this a spurious regression if series A,B,C,D,E,F were found cointegration as well? My explanation is that , if the stochastic trend series A can be explained by the stochastic trend of series B with residual being white noise, it can't be at the same time when sto...
Let $x_i$ represent samples from a Truncated Exponential distribution between $0$ and $1$, with rate parameter $\lambda$. Defining $\tilde x = \dfrac{\sum_{i=1}^{n}x_i}{n}$ What is the PDF of $\tilde x$?
My guess is that if a take a sample with $n$ observations ($n$ = sample size), average them and plot it and repeating the same thing for a lot of times then I am getting "dupplicates along the way", meaning that observations which occured in the sample nr 1 could also occur in the sample nr $x$. So I don't always get n...
Two variables $X_1, X_2$ are independent and identically distributed as $N(0,1)$. I need to find Cov($X_1$, $X_1 X_2$). Thanks!
The goal is to have groups emerge bottom-up from the data. I have a number of measures (variables A, B, C, D), each with a value 1-10, for a large number of subjects. Now, knowing that there will be different patterns of correlation between the variables for different subjects, I would like to know which subjects exhib...
Please, I'm a newby with Restricted Boltzmann Machine, I'm a psychologist (not very good with math) and and I've some confusion about the use of Gaussian visible units. Note I'm working on the original Hinton code, in particular: I'm using the Matlab code "rbm.m" (implementing a RBM with binary visible and binary hid...
What is the meaning of the || in this equation? I haven't been able to find it from googling. It's from page 8 of https://arxiv.org/pdf/1606.05908.pdf Thanks!
Why should I be concerned with applying a significance test to raw data that indicate a right skewed distribution? I am not sure if the following info helps: I am faced with data for two samples (n=20) for T4 cell count in two groups (Hodgkins vs non Hodgkins leukemia); the means are 823 and 522, respectively, and the ...
This is an issue that has plagued me for a long time and I have found no good answers in textbooks, Google, or Stack Exchange. I have data set of >100,000 patients for which four treatments are being compared. The research question is whether survival is different between these treatments after adjusting for a bunch o...
I have a large list of numeric (decimal) values ranging from approximately [-2, 2] with some of them being equal to 0 and I need to scale them so that their sum is equal to 0 while keeping their sign (i.e. negative numbers must remain negative after scaling). The first try was to divide each number by the sum of all nu...
I am confused that whether the variance used in the formula from Borenstein's method is the square of standard deviation or standard error of the mean? Could you help me? I thought it should be SD. However, at page 230 from the book (introduction to Meta-analysis) mentioned that "variance is 0.0036 and standard error i...
I have started reading about Bambi and I don't quite understand its notation. For example what does the following random=['condition|subject', '1|stimulus'] mean below? from bambi import Model # Assume we already have our data loaded model = Model(data) results = model.fit('rt ~ condition', random=['condition|subject'...
Suppose I can only observe people who visit Starbucks. My posterior probabilities will be like $\Pr(\text{male} \mid \text{visits Starbucks})$, $\Pr(\text{has hair} \mid \text{visits Starbucks})$, etc. – where all of these are independently distributed. I want to use a naive Bayes classifier to analyze if the probab...
How can I generate multi-dimensional data from a (estimated) Gaussian mixture pdf? In general, what would be ways to generate multi-dimensional data from a pdf? I read rejection sampling can be used, but it requires estimating an upper bound for the pdf, which is not an easy task for me.
After reading Ferson et al's (2003) paper on spurious regression, I understand that he uses extensive simulations to generate the true regressors and then compare them with those in the literature to find out those spurious regressors. What I am still confused about is, how spurious regression can be discovered by this...
I have data in the form of a $n \times t$ matrix $X$ where $n$ is a number of variables and $t$ a (large) number of time points. At any given time point the elements of the matrix can be expressed as a proportion of the column sum of all elements at that time point. So, for example, summing all elements in the first co...
Here is a toy survival model with age only. But I still do not know how the surv numbers in survfit are calculated: $\exp(\beta x)$ is exp(fit$coefficients*60)=1.135894 then what's the next step? How to get $h_0(t)$? All the resources say $h_0(t)$ is non-parametric, but how it was calculated? library(survival) fit<-cox...
I am currently working on a project where I need to evaluate the influence of physiographic region (5 levels) and age (3 levels) on a continuous variable called ASI. I originally planned on a 2-way ANOVA using the following coding: results=lm(ASI~PHYS_CODE*AGE,data=combinedData) The output: After running the analys...
I have a data set with 4 time points and around 200 'subjects' (in my case local authorities). I want to look at predictors of my dependent variable and changes over time in my dependent variable. I want to do a multi-level model using the MIXED command in SPSS. I know I need to use the /REPEATED subcommand, because I...
I'm trying to fit a model with the function glmer (lmer4 1.1-7 package) in R using REML. I tried to use the argument method=REML to do it, but this argument is deprecated. It seems that the way to produce greater accuracy in the evaluation of the log-likelihood is by mean of the adaptive Gauss-Hermite quadrature (i.e....
I would like to find a computationally quick and sufficiently accurate way (i.e., either analytically or numerical approximation) to compute a conditional probability for a specific multi-variate normal distribution, which is defined as follows: Let $X_1, \dots, X_n$ be n independent (univariate) normal random variable...
Suppose I have a probability distribution $P$, and suppose that $U$ is the uniform distribution on the same sample space. Then the KL divergence from P to U is $D_{KL}(U||P) = \sum_x u(x) \log\frac{u(x)}{p(x)}$ We can decompose this as follows: $D_{KL}(U||P) = \sum_x u(x) \log u(x) - \sum_x u(x) \log p(x)$ The first te...
For a multivariate data set, I test normality on the marginals, and I get plots like above. That's not my actual plot.... mine is not that obvious, the middle part is actually quite straight.... but the sharp decline/rise near the ends is the same as in my plots. So, what does this tell us. Which model, if not the mu...
I'm still trying to understand dropout completely, but this is what think is happening so far: At each step there is a chance p of a unit being set to zero. If a rectified linear unit (ReLU) is used for activation, then a weight of zero can often result in 'dead' units. If I run a network for a long time (i.e. towards...
i have to do a report on uk house prices and their effect on consumption, looking at research clearly a time series and regression is the best method. Please can someone answer me what they both achieve and if using both may be better for facialitating my research not just one? also what figures will i have to input to...
Here is how I test contagion effect between six FX series (deleted two due to VAR specification). I first split the whole period into two subperiods exogenously suggested by Forbes Rigobon. By observation of the data, I decided to split the data by 2009 week 35. Previous research before Forbes Rigobon (2002) based on c...
I have got a file that contains 1024 subjects, each have 3 data points. I need to find a corrupted data among them. I know for sure that there is just one data that is corrupted and it is quite evident when I look at the data but how do I do it through R? Need to find the row number that has the corrupted file. Thanks...
Long time lurker, first time question writer in CV, so please be kind. Currently, I'm exploring the benefits and drawback to performing imputation with cosine similarity and with random forest. Rather than using imputation for missing values, I'm using to use imputation for indexing a reference dataset. I think this w...
Suppose we know $\mu_1,\mu_2, \dots,\mu_n $ which are true values. Suppose we simulate data $x_{i1},\dots, x_{in}$ from some model or distribution involving, $\mu_i$. Using this we want to calculate the Mean Squared Error(MSE), thinking that the mean is a good estimate for $\mu_i$. $$\hat{MSE}=\frac{1}{n}\sum^n_{i=1} (...
Suppose you have a data set consisting of 25 samples and you decide to do 10-fold cross validation. Since 10 does not divide 25 evenly, how are the bins for each fold decided? Are the bins necessarily disjoint (in which case, you'd have to round down to 20 and have bins of size 2) or are certain samples shared between...
Hypothetical example: A researcher counts the number of persons entering a building over a one hour period and records this number. The following day the researcher performs the same count during the same hour of the day. Can these two numbers be compared for a statistically significant difference using a t-test, despi...
Linear regression: $Y = X_1 + X_2$ Is that possible that $X_1$ could have a low $VIF (1.25)$ and the same time, have a $0.35$ correlation with $X_2$? If $X_1$ has almost 1 of correlation with $X_2$, implies that VIF will be higher for $X_1$?
In a maximum likelihood fit, one estimates the parameter with the mode of the likelihood $L$, and the variance of this estimator with the second derivative of $\log(L)$: $$ \bar\theta = \mathrm{Mode}[L] $$ $$ \mathrm{Var}[\bar\theta] \approx -\left(\frac{\partial^2}{\partial \theta^2}\log(L(\theta))\Big|_{\bar\theta}\r...
I have 10 measurements $(x, y)_i \in \mathbb{R}^2, \, i \in 1..10$. Each is measured with uncertainty in both x and y. Furthermore, each measurement and its uncertainty is correlated with each other measurement, and I know the full covariance matrix. What is the best way to show this graphically?
I have a list of datapoints that falls within some sort of zipfian distribution or gamma distribution: population = [139212, 70192, 50000, 21000, 16000, 5000, 2000, 500, 600, 100, 10, 5, 5, 5, 5] And I took a sample out of the population: sample = [139212, 70192, 21000, 2000, 100, 5, 5] And the mean and the standard ...
Fitted a logistic regression to predict if a member would default the loan payment. The coefficient for 'loan_amnt' is positive as shown below: As it is positive, an increase in loan_amnt would mean that odds/probability of 'defaulting' also increases. But, the average defaults based on quartile of loan_amnt indicates...
I am working on data set of "Number of days taken to get a reply to mail". I have studied Power-law distributions in empirical data by Aaron Clauset Cosma Rohilla Shalizi and M. E. J. Newman. I have used powerLaw package in R to find if my data is well fit by a power law. It shows that power law is a good fit for my da...
A survey of 170 randomly selected undergraduate students show that 119 prefer to study in their room. What is the point estimation of the proportion of students who prefer to study in their room? Would it just be 119/170 = 70%
One thing that struck me as odd when going through literature on reinforcement learning is how "theoretical" everything is. I expected the results in this field to be things that you can immediately punch into Python or MATLAB and get your hands dirty, but I am seeing most things in reinforcement learning is not expres...
For example, if i write "helo wrld" in a text box could i write an algorithm that would change it to "hello world" or find all the closest solutions to what i write? without actually telling the algorithm that "hello world" is what i'm looking for.
I need to conduct a moderation study using 3-4 raters, a scale of 5-10 items, and between 1 and 5 samples. Would my Kappa coefficient be meaningful with this sample size? Would I be able to generalise to the population that the scale provides sufficient information to the raters to produce reliable results, consistent ...
I wonder if only me feel there are certain connections between them, I googled it for a long time, but found no where mentioned these two method. But to me, they indeed looked so related, Could anyone help?
As this paper (http://www.statnlp.org/research/ta/rnn_truecase.pdf) illustrates, a char rnn can be used to true-case some text i..e capitalize the necessary characters. The paper just says it uses a beam search after the softmax over characters at the final layer of the char rnn. How can you do that? My problem is: I...
I got the results to the multiple regression, but don't know how to form a graph from it? #Final Output with Significant Values summary(lm(volume~ method.C+ subject.2 + subject.6))
I am familiarizing myself with multivariate Gaussian distributions and Gaussian processes using george, and I am trying to understand how sampling from a multivariate Gaussian distribution works. The following is a sample from the prior of a multivariate Gaussian distribution, using numpy.random.multivariate_normal. Ea...
In our lab, we work with the retina which yields very little sample. Although we have a reasonable sample size of six animals in each group, I don't understand which test to be used to test for significance among groups. This is because we mix the sample (from all 6 animals) since it is too less in quantity. So, we mix...
We have a system in which we offer users a selection of items in the form of a list. Hard coded rules are ranking the items in this list. They have to select one of these items (we don't want to model the reasons behind this choice). We record the position of the items for each list displayed and we record which item i...
I have 2 samples: disease (n=21) vs no disease (n=13). I am using histogram features (percentiles) of 8 different type of diagnostic tests. Individual "histograms" are built using hundreds of pixel values over one anatomical location. "Tests" are different imaging modalities. I want to know which test out of the 8 con...
I am working on a regression model of quite complicated dataset. Dataset is heterogenous in the sense that it contains elements of significantly different properties. I am using $\epsilon$ type regression with radial basis kernel (RBF) (libsvm implementation). When I arbitarily set parameter C (~$200$) and leave the re...
Say that we are dealing with a time series of 25 years of daily measurements of a variable with seasonal cycles, e.g. it reaches higher values in winter than in summer. The objective is to compute the monthly weights that produce the seasonal oscillation. Let's say that the amplitude of the cycles does not seem to incr...
I am just curious why there are usually only $L_1$ and $L_2$ norms regularization. Are there proofs of why these are better?
This is a rather theoretical question, so I'm sorry if that's not appropriate to the platform. I have trained a decision tree (partykit) on an imbalanced data set, and to force the model to learn both positive and negative examples I have up-sampled the data to be balanced. On a validation/test set performance was more...
I was trying to get the optimum features for a decision tree classifier over the Iris dataset using sklearn.grid_search.GridSearchCV. I used StratifiedKFold (sklearn.cross_validation.StratifiedKFold) for cross-validation, since my data was biased. But on every execution of GridSearchCV, it returned a different set of p...
I was recently asked a question by my colleague: Can we use multiple LINEAR regression for a binary classification problem? Will the regression model be equally good as a classification model or it is not advisable at all to use multiple regression for a classification problem. The dependent variable(y) is 0 or 1 and t...
I've found a nice presentation describing PLS1 and PLS2 algorithms (pages 16-19). It's pretty clear but there is a thing confusing me. For PLS1. Let's look at the algorithm. The first steps are $w = X'y$ (which maximizes $\operatorname{cov}(Xw,y)$) $w = w / ||w||$ $t = Xw$ $p = X't / t't$ On the one hand one can say...
I am analyzing the results of my VAR model, where the original non-stationary variables are presented as growth rates, and after differentiation they are interpreted as change of growth rates and used in the model. Question: Which impulse-response function (irf) is appropriate for me to present, the original impulse...
What is meant by the condition for a binomial distribution that the number of trials must be fixed? Does this mean the number of trials must be fixed before the experiment?
I have time series data, it's about the wind speed and direction at each time (minute, or hour). If I plot the histogram of the data by grouping in years, the histograms would look like this It can be seen that the distribution is not stable across the years. And recent year is a little bit more smoother and more sta...
Problem: Lets say there is a staging table with four columns. There are incoming CSV files that arrive daily from thousands of sources. They all have different number of columns and the names of the columns are different for files coming from different sources. I have to write an ML program that identifies the four req...
I'm doing some research on CNN for text classification using tensorflow. When I run my model I get a very high training accuracy (arround 100%). However, on test split I get an inconsistent accuracy results (sometimes 11% and sometimes 90%). Moreover, I noticed also that the loss in training is decreasing until it rea...
I would like to fit the data with a linear model for each participant that would look like this: $$ Y=B_0 + B_1X_1 + (B_2 + B_3X_1)X_2$$ where $B_i$ are the regression coefficients and $X_i$ the regressors. Depending on participant's particularities, $B_2$ could be positive or negative. But my hypothesis is that $B_3$...
From what I understand, OLS gives consistent estimates for stationary AR(1) time series but not for unit-root ones. I am trying to illustrate this phenomenon with a small simulation in R but the OLS estimates in the unit-root case seem alright: res <- c() for (i in 1:1000) { ar <- c(0) for (j in 2:1000) ar[j] <- 1...