instruction
stringlengths
9
38.7k
I need to find the expected value of $\frac{\sum x_i}{n-\sum x_i},\ i=1, 2, \ldots, n$, where the $x_i$'s are negative binomial $NB(1, \theta)$. Edit: More context about the problem: I looked for the MLE for $\theta$ using $x_i$'s, iid negative binomial variables to estimate $\theta$ which gave me $\frac{\sum x_i}{n}$...
Batch normalization is described in this paper as a normalization of the input to an activation function with scale and shift variables $\gamma$ and $\beta$. This paper mainly describes using the sigmoid activation function, which makes sense. However, it seems to me that feeding an input from the normalized distributi...
In a data set I have, all of the results of the residual vs. predicted values appear as parallel lines as pictured below. I interpret this according to my training as a violation of homoscedasticity which makes running a multiple regression untenable. Here is some context about the data sets, type of analysis used,...
Since in skip frame, the same action will be executed the next 4 frames. What should I do if during the the skip frame period, rewards are given? I mean in the game API, if skip frame is used, is the reward the accumulated reward during the skip frame period or only the reward at first frame during the skip frame perio...
I've built a (deep learning) model for a binary classification problem. For this problem I'm interested in sub-dividing my data set to maximize performance (as measured by precision) by essentially throwing out hard-to-predict samples. This would leave a smaller set of easier-to-predict samples with higher precision. H...
I am collecting stats results for 15 consecutive days for network lines and the outcome for a line could be: 1 No problem 2 Problem of type A 3 Problem of type B What is the best attack for this problem? Bear in mind that we have to reevaluate the probabilities for every line every day. A solution in terms of proba...
I really confuse about hazard function. Initially, I was thinking hazard function should be a proportion, which indicate if we know some one still alive at time t, so he/she got h(t) (eg. h(t)=20%) chance to die at time t. But through reading, I've been told hazard function is not a proportion, it is a hazard indicator...
I have a hierarchical multi-class classification system, that classifies records into about 500 different categories. I want to summarise the performance of the classifier in a simple way. A measure of accuracy on validation data is easy to implement: correctly coded/all coded. For each class, we can look at binary mea...
Via trial and error where I guess the number of statistical degrees of freedom, I have determined that the single variable linear regression "automatically" performed by Excel provides a p-value for the Y-axis-intercept that is identical to the one that can be calculated by "explicit" Excel functions as follows: 2*T.D...
I have a weekly data at Brand Level, Sub Segment level and Segment level (the other two are derived from rolling up the Brand level data). The data includes product characteristics, sales, marketing and external factors like weather. I want to model with "Market Share" as my dependent variable, and I've been asked to ...
I have a stats question, and not enough experience to even begin to know how to find the answer. It's a time series question relating two time series: A = anomolous conditions (-,0,+) --- continuous variable B = # of events --- discrete variable If I wanted to find out, quantitatively, a threshold of duration under wh...
I am trying to predict Solar Energy value at particular date.So,for this I am applying Artificial Neural Networks model.I am having problem in deciding activation function. Since sigmoid function gives me output 0-1 but I want output something like 256.33. So I thought to apply sigmoid for hidden layer and ReLu for out...
The pymc3 documentation says that the support of the mixture model $f(x|w, \theta) = \Sigma_{i=1}^{n}w_if_i(x|\theta_i)$ is $\cap_{i=1}support(f_i)$. I was thinking that it should be the union of all the mixture models' functions support, i.e. $\cup_{i=1}support(f_i)$, rather than the intersection? Am I right or have ...
I have ratings data. My ratings data contains some technical features like the Originator (Channel), the exact day & hour of the broadcast, duration of the program etc. and, obviously, the label, which is the rating. So the data looks like that: +---------+------------+-----------------+----------------+------------...
This basic formula of finding the Standard Error (Or Standard Deviation) of a Sampling Distribution, S.E= s/sqrt(n) Where s= std deviation of sample n=sample size Is this only for the Sampling Distributions of "Means" alone and of those that are Normally Distributed? Or does it apply to other point estimates, or othe...
There is a well-known modification of the initializing step of K-means, named K-means++. It chooses cluster centers with probability proportional to its squared distance from the point's closest existing cluster center. If the data are coming from a mixture distribution of normals, what is the distribution of the clust...
My data are 500 children learning a skill. About half of the children are male, and about half are female. These children are in one of 20 classrooms, each classroom has a different teacher. 12 of these 20 classrooms are at a private, the other 8 at a public institution. About half of these classrooms are for children ...
I want to find the optimal number of clusters (k) for some clustering algorithm (agglomerative hierarchical, if that matters). I want to evaluate the quality of clustering based on some metric for each possible cluster (k=1, 2, 3, ...). Since the number of possible k's can be as large as the number of data points, it i...
This happened to me in poker the other week. 2 players going head to head getting the same 2 non-pair cards (of different suits). E.g. a 4 and a 6 of any suit, where the other player gets a 4 and a 6 of any suit. I wish to calculate the probability of this occurring, but I'm failing. Using 'combination' and 'counting ...
What are methods that combines/regress on frequent low quality estimates (laden with bias+noise) with infrequent high quality estimates to yield estimates that have lower uncertainty?
I am looking at a Monte-Carlo engine with N simulations. This Monte-Carlo engine builds a distribution from which I would like to read the 99%-tile (called the VaR). The problem can be interpreted as Monte-Carlo VaR (value at risk). I use a confidence interval on this quantile obtained with 2 different methods: Asym...
I have a single-channel image and want to make it multichannel by corrupting it with various sources of noise. Let's say the end dimension is [height , width , number_of_corrupted_copies]. How can I apply a 2D convolution to this and get a single image, with 1 channel? What I want is to convolve in depth and take avera...
I wonder what is theoretically easier for Faster Rcnn to learn (by fine tuning after initialization on imageNet). If I have a dataset of 2000 bottles pictures 500 water bottles 500 soda bottles 500 wine bottles 500 beer bottles I have the choice to tag my bounding boxes as I prefer. Either tag all as "bottles", and hav...
Ok, so this may be a silly question, I know the literature recommends at length the simplex or interior point method to optimize a quantile regression problem. However I cannot figure out why a simple (stochastic or not) gradient descent isn't able to minimize the quantile loss which as a reminder looks like this. Of...
I am new in statistical studies and on this site and I came across the "zero-sum property" in my book regarding the mean. It seems to be straight forward but I still can't understand the notion of it. The only information it gives with the formula is the sum of the difference between each value of a variable $Y$, note...
I am interested whether there is a name for the below process / models, so I can read up on more of the statistical literature on this. Consider the following situation where I want to estimate the effect of X(t) on Y(t): Y(t)=b1*X(t)+error1(t) However, I am interested in the case where X(t)=b2*Y(t-1)+error2(t) such ...
I am not sure how to formulate the following model in mgcv: FactorA*s( Smooth ) + FactorB*s( Smooth ) This is FactorA + FactorB + FactorA:s( Smooth ) + FactorB:s( Smooth ) (i.e. this is not a three-way interaction, because FactorA:FactorB:Smooth is not present). My best guess is s( Smooth, by = FactorA ) + FactorA + ...
I am learning about the likelihood ratio test. Is the LRT applicable for non-Gaussian distributions too? Up to now I have only been able to find examples of the LRT for Gaussian and Gaussian mixture models.
A definition of orthogonality in the context of statistics is An experimental design is orthogonal if the effects of any factor balance out (sum to zero) across the effects of the other factors. Being a non-native speaker, I am not sure I understand that. With my favourite example of a latin square, how can I see t...
Dear forecast scientists, I'm using the R 'Forecast' package to generate batch forecasts. I have a question regarding some of the great auto-fit techniques offered by this package (E.g., auto.arima,ar,tbats,ets). The proposed workflow is as follows: Step 1: Define hold-out period (test data, basically) and then push t...
I have three independent variables (A, B, C) with two levels each (low, high) as well as a metric dependent variable X. I now want to test whether respondents that reported to be high on each of the three independent variables have -- on average -- higher values on X. In order to do so I created a new grouping variable...
Let $Z_1, Z_2,... Z_n \sim Ber(\theta)$ Let $X$ be the number of trials before the 1st success. So $X \sim NB(1,\theta)$ First, I was asked to find an MLE of $\theta$ based on $X$. I did this by going through the MLE procedure for a single rv $X$ which yielded my estimator $\frac{1}{x}$. Next, I was asked to find the M...
I have a data set which contains closing prices of a stock every day (total 1 year). Can i forecast that set like 1 or 2 year with using Markov methods? If yes, then how?
In this topic, you explain how you get to to point estimate of the last class. How to fit a glm with sum to zero constraints in R (no reference level) I wonder, how do you calculate the st error, because I have this problem and want to know something about the significance of the last level of my category. Thank you ...
I searched through questions on parametric and non-parametric test distinctions and it seems that the questions are all focused on a very specific test, data problem, or some technical distinction. I'm not interested in the issue of testing assumptions (don't; examine instead), or the issues of power or error rates. My...
In a previous question (Equivalent to Welch's t-test in GLS framework) it was asked whether nlme can reproduce Welch's t-test. Below is an abridged version of this older question: A standard independent samples t-test (where it is assumed that the samples being compared are drawn from populations with equal varianc...
I am planning on doing a Cox model analysis to study risk factors for a disease, retrospectively via medical record review. Will the model allow for mixing of binary , continuous, and/or ordinal variables in one equation? I am using Redcap, which allows you to create a data-form with a graphical user interface with mul...
I am trying to understand the following: do more customers purchase an item because it is discounted 'now' because they engaged with the product before (viewed it, added to a wishlist etc) vs just brought it because its on discount 'now'. Different products are discounted at different times, so I'm assuming a date rang...
I have spatial data set for 35 studies. In each study, there are variables y, x1, x2, latitude, and longitude. I want to know whether adding x2 to model y~x1 will improve the simple regression model y~x1. I use m_study1 = gls(y ~ x1 + x2, data=study1, correlation=corExp(form=~Lat+Long)) for each study. I also use m_stu...
I am fitting models to stock price time series. The interval of each series is 40-minutes (relatively small time frames, in the context of stocks). I will use ARIMA or GARCH in R. Purpose of project is detecting a structural change point in the data (no forecasting). Is is defensible to claim that as the time interv...
My question is similar to this other one, but I would like to know if it is possible to correct the p-values for multiple testing (and how). I have a large 42 gene expression values which are correlated with 25 clinical variables. So I end with a matrix of 42x25 correlations coefficients and p-values. It is possible ...
May I proceed with a repeated measure one way ANOVA if my subjects (individuals) doesn´t have the same number of measures? Imagine a clinical trial with 30 individuals, with n periods of sampling, but some individuals missed some of the sampling periods. Several packages in R are showing errors based on the NA values.
I would like to fit a lasso model with hierarchical interactions, but only on a subset of all possible interactions. The hierNet package in R allows the user to provide a custom interaction matrix via the zz parameter, but when I create the interaction matrix with a subset of all interactions (e.g., only X1:X2 and X3:X...
Consider an MA(1) process: $$ Y_t = a + a_1u_t + a_2u_{t-1} $$ where $a$ is some constant, and $u_t$ is an error term. How do we know know the error terms? They must come from some previous regression, right? P.S. I've read What can be an intuitive understanding of the error term of a moving average time series? but I...
Does this lead to overfitting? Can a really good neural network be created for classification with like a hundred hidden layers?
In the recent WaveNet paper, the authors refer to their model as having stacked layers of dilated convolutions. They also produce the following charts, explaining the difference between 'regular' convolutions and dilated convolutions. The regular convolutions looks like This is a convolution with a filter size of 2 an...
I have 7 DVs that I want to conduct the same multiple regression analysis on so I thought multivariate multiple regression (MMR) would be the way to go. However, one of the DVs is so skewed and kurtotic that no transformation I have tried can make it both normal and non-kurtotic and when I include it in the analysis, ...
as I've been learning about tree-based classification algorithms, I've learned the single tree algorithms are 'greedy', meaning that they'll minimize entropy at every stage. This means that sometimes these algorithms will fail to minimize total entropy because they are only looking one step ahead. Here's an example: I...
I have a network of the following form: $$ [B:{\rm Binary}]\rightarrow [C:{\rm Binary}]\rightarrow [G:{\rm Gaussian}] $$ $[]$ is a node and the arrows show dependency. In this situation, the Gaussian node is a mixture of two Gaussian's since it has a binary parent. I have some training data and use it to learn the para...
Randomization inference failure? If we want to test the sharp null hypothesis rather than the weak null hypothesis we can use randomization inference (RI). Definition $H_{0,sharp}$: Sharp null hypothesis of no effect The treatment effect is zero for all subjects. Formally, $Y_i(1) = Y_i(0)$ for all $i$. Definition $H_...
I'm after a bit of advice. I've fitted some multi-level models with income as the outcome variable and a range of covariates. I'm interested in the coefficients of the main independent variable/covariate (ethnic group) when I enter various other covariates into the model (so how does income change for each ethnic group...
I am reading about decision errors in hypothesis testing. My question is why is a "Type-II error" considered to be an error at all? From what I understand, it arises when we fail to reject a false null hypothesis. When we fail to reject null hypothesis, it simply means that we do not have strong evidence to reject it. ...
I searched the internet to find out about the effects of outliers on k-means clustering, but could not find any useful source. Does it cause bad clusters to be formed? If so, how? (Please also provide a simple example with data such as a list of integers so that my doubt can be clarified.)
A general nonlinear mixed effect model for the $j$th observation on the $i$th individual is $y_{ij} = f(\phi_i, x_{ij}) + e_{ij}$ $\phi_i = A_i\beta + B_ib_i$, where $b_i \sim N(0, \sigma^2D) $ I know that the random effects $b_i$ are normal with mean 0. Here, $\beta$ is a p-vector of fixed population parameters. What...
I have the following problem. I want to find the expression for the autocorrelation of the following random variable or MA(1) process. $X_n = \epsilon_n - \epsilon_{n-1}$ Where $\epsilon$ is a stationary correlated noise with finite mean $\mu_\epsilon$ and standard deviation $\sigma_\epsilon$. So the mean and variance ...
I am working on a problem where customers make choices. A traditional setting for problem for example would be: Model the Travel by air, bus, car. Each choice is made based on several variables like cost, wait time, travel duration etc. In this case, the data may look like: Discrete choice models; estimating probabil...
I'm using repeated measures ANOVA with one independent within-subject variable and six dependent variables. I want to control the order of the intervention (categorical variable with two levels: 1,2). In order to do that, do I just need to put the order variable in the "covariate" box? Do I need to transform the variab...
I'm performing latent class modelling using poLCA package in R. Below is an example from the documentation. How to interpret G^2? And how to assess whether the assumption of conditional independence holds between each two of the manifest variables A, B, C and D? > library(poLCA) > data(values) > f <- cbind(A,B,C,D)~1...
Assume you’re dealing with an imbalanced dataset. I know I can do things like upsampling, downsampling, and synthetic sampling to build out my train and test split. My question is: if I’m using a random forest classifier, are there any implementations in R or Python that would force each of the randomly generated trees...
I have a dataset with 3726 observations. The values of '1' in the response variable is extremely rare: I have five 1's and 3721 0's. I used Firth's logistic regression to address this rarity (using logistf() and brglm() in R). I used 11 explanatory variables (mostly categorical). The results of Wald test show many of t...
I've been using linear models (lm function in R) to determine if the the expression of certain proteins is associated with disease severity. Sometimes the expression of proteins can also correlate with age, so I've been including that in the models as so: lm(ProteinA ~ DiseaseSeverity + Age, data = mydata) But where ...
I have series of pictures of the same places, taken with the same cameras and I need to classify changes on pictures, like leaves fell, snow appeard, object appears disappears etc. Which topology to choose for this? First I though that I can just concatenate pairs of images side by side and pass it to DNN, like here B...
Data and Objective The data are about lane change maneuvers. I want to predict the lane change duration of a driver of certain age and gender. Following is a very small subset of observations and variables in original data: Dependent variable: duration of lane change (1 observation per driver). Independent variable...
I have 6 class labels, say: a, b, c, d, e, and f. I am using 3 classification models: decision tree, random forest, and naive Bayes. Can majority voting be applied this ensemble, say more than 50% votes for a decision?
I have measured spore production by a parasite after feeding the host on 4 diets of varying nutritional content. I have primarily analyzed the data by treating the diets as categorical variables, even though nutrient content is continuous. Most of the response variables are not normally distributed, so I have primarily...
I am working on differentially expressed gene analysis using TCGA RNA-seq data. The data is from over 500 brain cancer patients, and I hope to see if there is any DE detected genes between those with and without seizure history. In my metadata, I have so many other variables that potentially influence the RNA-seq count...
I have seen many examples where even if the goal is to find outliers, the first step is to go through linear (or any other) regression and then move on to outlier identification. Why? If one wishes to find outliers only, can't regression analysis be skipped by using methods like 68–95–99.7 rule?
I have a random number generator as part of a system that - putatively - randomly selects one of 10,000 drive locations to store an incoming file fragment. Multiple file fragments can fill a drive location. For simplicity, let's say it's a short time window and thus there is no ceiling on number of fragments stored p...
How can I check the orthogonality of one variable to any single and any combination of other variables? Suppose you have 10 variables (called A to J) and you want to prove that variable A is not correlated with any single and any combination of variables B to J. One option would be to measure the "direct" correlation ...
In a comment to Jaap's answer to this question about reporting tiny p-values, amoeba says "Once the $p$-value is below 0.0001 or something ... it's probably more meaningful to look at $z$-value than at $p$-value," for example the 5$\sigma$ convention in particle physics. There was agreement that this was right. Why is ...
Linear regression of 1 independent variable produces the best fit line given the samples available. In Excel, the automatic linear regression of 1 independent variable yields some values such as these below. (Sorry that the image is not cropped.) Given that there is only one such line possible for any optimizing algori...
I've constructed a mixed effect model in R to test for a fixed effect of condition and fit random slopes to each subject, using the unique task solution for each subject. It looks like this: mdl <- lmer(dv ~ condition + (solution|subject), data = E1_data, REML = FALSE) I know that to test whether the fixed effect is...
Hastie \& Tibshirani's original approach to fitting generalized additive models was the backfitting algorithm. For a model of the form $$ y = \alpha + \displaystyle\sum_k f_k(x_k) + \epsilon $$ Initilize the $\alpha$ and $f_k$ at reasonable values Loop through terms, subtracting off the current estimate of all others...
hopefully this isn't too dumb of a question. I've been thinking about it for a while now and don't have a clear answer. I saw this question, where the answer mentions the Poisson Distribution, but it doesn't seem like the Poisson applies here because of the time aspect of the Poisson (please feel free to correct if wro...
I'm trying to simulate the delivery times for a fast food restaurant (i.e. the time it takes the delivery guy to reach the client from the restaurant). The locations of all clients are put in clusters called "sectors". These sectors are like neighborhoods, so all orders that fall in the same sector are assumed to have...
Let's say I have a set of $n$ objects, and I select an object from the set with uniform probability. I do this many times, and record how many times I select each object. These counts will tend toward a uniform distribution, but an exact uniform distribution is obviously unlikely. What's the chance that the difference...
Say one has the following data generating process (DGP) (known as the SAR ou spatial lag model in the literature): $\boldsymbol{y} = \rho \boldsymbol{W}y + \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{u}$ where $\boldsymbol{y}$ is a $n \times 1$ endogenous vector, $\boldsymbol{X}$ an exogenous $n \times k$ matrix, $\...
Let $X1,X2... Xn$ be a random sample from X and let X have the following pdf: $g(\theta)xe^{\theta \frac {x^{2}}{2}}$ , $x$ from 0 to 1 and $g(\theta)$ is a normalized constant of the parameter $\theta > 0$. The objective is to find the MP test for the problem: $H0: \theta=0$ $H1: \theta=2$ I started by trying to find ...
I have a time series {y_t, t=1,2,3,...,N} and y_t is missing in the period[t=s, t=s+1, ... t=s+M]. I want to backfill y_t using regression based on other time series {x_t} in a rolling-manner. Specifically, I use the sample before t=s to run a regression of y_t on x_t, and predict y_s based on the regression estimation...
Set up: We are testing widgets. If a widget passed testing it moves out of the factory. If it failed we will test it up to 3 times. There are some number of widgets that will never pass even if we tried forever. How can we construct a model to infer the number of samples that will never pass no matter how many time we ...
I have a small, but untidy, dataset. I think I should to use non-parametric tests, but I want to check my understanding since I have not often used non-parametric tests. My dataset is from a small chain of health clubs (10 clubs) that created a program to encourage members to use their benefits more frequently. The...
The data I am working with can be modelled using a negative binomial regression model. My response variable is discrete count values (including zero). All my predictor variables are categorical data. I am now at the stage where I am looking at model diagnostics. When I look at the fitted values obtained using final.mod...
I have this data plotted on a graph in which all points have the same value on the y-axis, e.g a constant integer "c", while the x-axis is the time in seconds. So, for a c = 25 on the y-axis, there are points on the graph corresponding to values on the x-axis equals to, let's say, 32, 59, 78, 142, 249, 286, 301, 310, ...
The goal is to construct an upper bound for parameter $\theta$ given $X1,X2.. X10 \sim exponential (\theta)$ using some form of $y=Min(Xi's)$ as pivot. I used $\frac{y}{\theta}$ as my pivot. This follows the distribution of the minimum of $\frac{Xi's}{\theta}$ which in turn are $\sim exponential(1)$, correct?
I'm currently reading "Computer Age Statistical Inference" by Efron and Hastie. In section 2.1, they talk about some of the mechanisms that frequentist inference uses to circumvent the defect of having to calculate properties of estimators $\hat{\Theta} = t(\mathbf{X})$ of an unknown distribution $F$. One of these mech...
Before reading the Wikipedia article, my idea to calculate the probability was as follows: $1-\left(\frac{364}{365}\right)^{_nC_{2}}$ Basically, I thought to compare all combinations of pairs ($_nC_{2}$) and require them to have different birthday ($\frac{364}{365}$). It gave a very similar result to the wiki method, b...
Suppose the following simple/basic investment scenario: I have $100$USD in my bank account as a starting point (will increase/decrease as I invest). There are $1,000$ different investments that I'm planning to invest my money in. The investments are buy-sell fashioned. So I buy something low, and sell it higher. All m...
I'm really new - curious about this. Say I have a bunch of objects with a short list of tags, ie ["book", "read", "write"] and ["run", "marathon", "jump"]. I already know that objects in the same "category" will have similar tags. So I'd like to determine how many categories there are and which objects are in them. Any...
Say i am training a neural network and have 10 samples with 4 variables each and 1 label assigned to each observation. What does it mean to say that the samples are independent and identically distributed? I know what IID variables are. And i have read statements such as "Because we usually assume that our samples are ...
I'm looking at data from an experiment that examines how three different types of cognitive load (two levels each: present or not present) affects self-reports of thought category. Every subject performs a task eight times, each time under a different configuration of the three types of load until all possible configur...
Is there a formular to calculate or approximate the observation contribution to AUC? Example based on the interpretation from wikipedia: When using normalized units, the area under the curve (often referred to as simply the AUC) is equal to the probability that a classifier will rank a randomly chosen positive instanc...
Can we "trust" about this method when we have small data set ? Is there a minimum size required to partition the data ? e.g. N=200 ?
In the week 3 lecture notes of Andrew Ng's Coursera Machine Learning class, a term is added to the cost function to implement regularisation: $$J^+(\theta) = J(\theta) + \frac{\lambda}{2m} \sum_{j=1}^n \theta_j^2$$ The lecture notes say: We could also regularize all of our theta parameters in a single summation: $$min...
I am developing a feature selection method based on a LASSO regression model. The coefficient are as follow: 1.23,-4.6,0,10.9 I want to know how to select the best features in my model. Should it based on highest values or the highest of absolute (abs) values?
I am trying to establish a polynomial regression model to the following small dataset (csv). y x .99601797 .99981704 .99683697 .941906 .9999658 .99266339 .99877053 .99606185 .99900637 .99474346 .99871661 .96773153 .98961073 .99935843 .99997705 .99489796 .9999985 ...
I understand that classical dimensionality reduction methods are generally speaking could contribute to (vanilla) neural network. But I'm unsure about the dimred application for the input images for convolutional NNs, because I interpret the convolutional layers themselves before the flattening and dense layers as a ki...
I have a small dataset of 25 observations with a classification variable (factor 0,1) and 82 features scaled to have values between 0 and 1. I used the rfe() function of the caret package to identify the best subset of features (2:30) in terms of metric="ROC" (which I think is really AUC). The best subset (14 feature...
Wikipedia article (https://en.wikipedia.org/wiki/Fisher_information#Definition) states that "the information in a random sample of n independent and identically distributed observations is n times the information in a sample of size 1". I know that formally it's proven via linearity of expectation but I am looking for ...
In Andrew Ng's Coursera Machine Learning class, the cost function for logistic regression is defined as: $$\begin{align*} J(\theta) &= \dfrac{1}{m} \sum_{i=1}^m \mathrm{Cost}(h_\theta(x^{(i)}),y^{(i)}) \\[2ex] \mathrm{Cost}(h_\theta(x),y) &= \begin{cases} -\log(1-h_\theta(x)) \; & \text{if y = 0} \\ -\log(h_\...
I come from physics and would like to derive the chi-square function given by the Particle Data Group: \begin{equation} \chi^2 (\boldsymbol\theta) = (\boldsymbol y-\boldsymbol\mu(\boldsymbol \theta))^T V^{-1}(\boldsymbol y - \boldsymbol\mu(\boldsymbol \theta)), \end{equation} with $V_{ij} = cov[y_i, y_j]$ being th...