Questions tagged [function]

A mapping between a set of inputs and a set of outputs.

Filter by
Sorted by
Tagged with
15
votes
3answers
50k views

How to find the mode of a probability density function?

Inspired by my other question, I would like to ask how does one find the mode of a probability density function (PDF) of a function $f(x)$? Is there any "cook-book" procedure for this? Apparently, ...
15
votes
2answers
3k views

How can Logistic Regression produce curves that aren't traditional functions?

I think I have some fundamental confusion about how the functions in Logistic regression work (or maybe just functions as a whole). How is it that the function h(x) produces the curve seen in the ...
12
votes
1answer
5k views

Proof that if higher moment exists then lower moment also exists

The $r$-th moment of a random variable $X$ is finite if $$ \mathbb E(|X^r|)< \infty $$ I am trying to show that for any positive integer $s<r$, then the $s$-th moment $\mathbb E[|X^s|]$ is ...
12
votes
3answers
3k views

Can a neural network learn a functional, and its functional derivative?

I understand that neural networks (NNs) can be considered universal approximators to both functions and their derivatives, under certain assumptions (on both the network and the function to ...
11
votes
2answers
1k views

How to estimate the accuracy of an integral?

An extremely common situation in computer graphics is that the colour of some pixel is equal to the integral of some real-valued function. Often the function is too complicated to solve analytically, ...
10
votes
1answer
411 views

Proving a sequence decreases (supported by plotting a large number of pts)

Many of the questions I've posted on SE in the last month have been in the goal of helping me solve this particular problem. The questions have all been answered, but I still can't come up with a ...
10
votes
3answers
209 views

Is there a way to recover a temporal dependence structure in a time series from a regression against time?

Consider a time series: $X_1,X_2,...X_{n-1},X_n$ This series can also be written as a function of time $X(t)$, so that: $X_1,X_2,...X_{n-1},X_n = X(t_1),X(t_2),...X(t_{n-1}),X(t_n)$ Most ...
9
votes
2answers
502 views

Advantages of approaching a problem by formulating a cost function that is globally optimizable

This is a rather general question (i.e. not necessarily specific to statistics), but I have noticed a trend in the machine learning and statistical literature where authors prefer to follow the ...
8
votes
2answers
397 views

Function of random variables

I am not sure what the right keywords would be for this but I would like to know if it is possible to apply functions to random variables. I think it may make sense in terms of expected value but I ...
8
votes
2answers
294 views

How to properly handle Infs in a statistical function?

Suppose I have a function such like: f <- function(x){ exp(x) / (1 + exp(x)) } it's supposed to work for any real value of x, but actually it returns NaN ...
8
votes
1answer
2k views

How to understand the geometric intuition of the inner workings of neural networks?

I've been studying the theory behind ANNs lately and I wanted to understand the 'magic' behind their capability of non-linear multi-class classification. This led me to this website which does a good ...
7
votes
1answer
2k views

In spatial regression, what is a spherical autocorrelation structure?

I have a large gridded dataset for the globe (i.e a spherical, wraparound surface) that I'm applying spatial regression to (using a CAR model). I've been using the default autocorrelation function, ...
6
votes
2answers
7k views

How to measure the shift between two cumulative distribution functions (CDFs)?

How to measure the shift between two cumulative distribution functions (CDFs)? Specifically, in the image below, how meaningful is the shaded area? It is supposed to measure the shift between the ...
6
votes
1answer
1k views

What is an induced probability function?

My textbook defined the probability function of a random variable as: the function $P_X$ is an induced probability function on $X(\Omega)$, defined in terms of the original function P. In other ...
6
votes
3answers
119 views

Are dependent variables necessarily functions of one another?

The problem Suppose you have two variables $X_1,X_2$ so that $X_1\not\perp\!\!\!\!\! \perp X_2$. Do we necessarily have that a functional relationship exists between them? I am assuming random ...
5
votes
2answers
105 views

Generating uniform points inside an $m$-dimensional ball [duplicate]

The present question follows on from some other questions on this site asking how to generate uniform points inside a disc (see e.g., here, here and here). The natural extension of that problem is to ...
5
votes
3answers
153 views

Does $\mathbb{P}(X < a) = \mathbb{P}(f(X) < f(a))$?

If $f(x)$ is a monotonic increasing function, then does $\mathbb{P}(X < a) = \mathbb{P}(f(X) < f(a))$? My intuition says it's true but I cannot prove the case nor find the name of the theorem.
5
votes
1answer
147 views

Limit of Bernoulli R.V.s is a singular distribution

Working through an exercise in Probability (the question can be found in Lamperti). Let $X_1,\dots$ be independent Bernoulli random variables with $\mathbb{P}(X_i=1) = p$ and $\mathbb{P}(X_i=0)=1-p$. ...
5
votes
1answer
115 views

Optimization: Convex function

Problem statement Use the definition of convexity of a function, i.e., that for any $\boldsymbol{x}$, $\boldsymbol{y} \in \mathbb{R}^{d}$ and $\lambda \in \left [0,1 \right ]$ we have \begin{align*} ...
5
votes
1answer
4k views

Neural network failing because of Infinity

I have different activation functions in my network. I have noticed my networks failing (producing NaN). The reasoning behind this is: I have a large layers with ...
4
votes
1answer
472 views

Arbitrary function approximation in one dimension

Suppose we have some arbitrary function $f: X \mapsto Y, X \in \mathbb{R}, Y \in [0, 1]$. It may be smooth but it may not. I am looking for some way to approximate this function given samples drawn ...
4
votes
1answer
2k views

Showing Bayesian updating in R

I'm very new to Bayesian and am very interested in understanding the concept that each posterior from a previous test, can be used as a prior for a current test or in Lindley's (2000) words 'Yesterday'...
4
votes
1answer
832 views

Linear decision function (classification)

Although I know some basics of linear classification, I do have some questions about the formalism. In our script, a binary linear classifier $F$ is defined as follows: $$ F(x) = \textrm{sign}\left(\...
4
votes
1answer
45 views

Why is optimisation of submodular functions particularly interesting?

Google Scholar suggests there were around 6000 articles on 'submodular' functions and optimisation 2000-2010, and 12,000 since 2010. So my question, having bumped into a few of these articles, is, ...
4
votes
1answer
1k views

Converting log hazard function to survival probability

I am currently working through a survival problem and I wanted to get some advice with how to proceed. I wanted to estimate survival probabilities over time based on knowing only the $\log({\rm ...
4
votes
1answer
296 views

Objective function in linked prediction models

I would like to use R “optimize” function to estimate the model: $\hat{Y_{t}}=a\cdot \hat{Y}_{t-1}+b\cdot X_{t}+c\cdot X_{t-1}$ Important thing is that the predition $\hat{Y_{t}}$ (let’s say ...
4
votes
0answers
115 views

Confidence interval for GLM or the maximum of a function?

Imagine I have a set of (xi,yi) measures. I can show it on a scatter plot I want to choose the value of x that maximizes y, or I could fit a function and find the values of the parameters that ...
3
votes
1answer
602 views

Let $X$ be a random variable and $f$ an invertible function. Then the CDF of a random variable $Y=f(X)$ always exists?

Let $X$ be a random variable and $f$ and invertible function. The cumulative distribution (CDF) of $X$ is defined as $$F_{X}(x) = \mathrm{P}(X\leq x).$$ The CDF of $Y=f(X)$ is then $$F_{Y}(y) = \...
3
votes
1answer
1k views

R: Defining a new continuous distribution function to use with Kolmogorov-Smirnov Test

I wish to run the Kolmogorov-Smirnov test on my data to determine how well it conforms to a specific continuous distribution function I have in mind. If my understanding is correct, the Kolmogorov-...
3
votes
1answer
426 views

How to write diff() mathematically?

I am using R/Python diff() operation. e.g., https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.diff.html I would like to know if there is a ...
3
votes
1answer
155 views

Do optimization problems written in argmax form represent a function?

If I write $$\hat{x} = \underset{x}{\text{argmax}}\ f(x,y)$$ can I assume that what is to the right hand side (RHS) of the equal sign is a function in the rigorous sense of the word? Under what ...
3
votes
2answers
286 views

What is this formula?

i have been asked to plot a graph of the residuals from the following formula: |y(hat)/y|-1 they said that it was MAPE but i have the formula for MAPE as: ...
3
votes
1answer
99 views

How do you find the asymptotic distribution of a function of the sample mean?

There are a number of questions on this site that ask for the asymptotic distribution or moments of some function of the sample mean for IID data (see e.g., here, here, here, here and here). All ...
3
votes
1answer
40 views

Random variable independence

Let's say I have two independent random variables $X$ and $Y$. Because of this independence, I can evaluate (for example) the following functions: $$f(X,Y)=X+Y$$ $$g(X,Y)=|X-Y|$$ But I can't ...
3
votes
1answer
2k views

How to calculate the probability of an event occuring within n days, if we know the probability of it occuring per day

If an event can occur at most once per day, and the probability of it occurring is 10%. What is the upper-bound on the probability that the event occurs in an interval of L days of a month (assuming ...
3
votes
2answers
872 views

Given the distribution of a variable X, what is the distribution of f(X)?

Suppose I know the mean and standard deviation of a (roughly) normally distributed variable x. Is there any way for me to calculate the mean and standard deviation of f(x)? The particular problem I ...
3
votes
1answer
40 views

What is f in this Neural Gas neighborhood width formula?

I'm implementing the Online Visualization Neural Gas algorithm, as described in the Estévez, Figueroa 2006 paper. I am having trouble interpreting the formula below (Eq. (4) in the paper): $$\lambda(...
3
votes
1answer
229 views

Time Series Function - Constant vs Piecewise

I have daily data for online marketing $ spend and the number of clicks to the website gained. I want to determine a function that 'maps' the two together. I cannot use normal linear regression ...
3
votes
1answer
111 views

Testing if a pattern is 'skewed'

I am running individual-based simulation and I record a statistic over space. This statistic is always zero at the two extremes of the space but display a bump somewhere in the middle. Here is an ...
3
votes
0answers
61 views

Expected entropy on output of a random function, and of $F(x)=P(x)\oplus x$ with $P$ a random permutation

Let $F$ be a function on the set $\{0,1\}^n$ of $n$-bit vectors. Let $H_F$ be the entropy (in bits) of the source $F(x)$ where $x$ is uniformly random. That is $$\begin{align*} H_F&=\sum_{y\in F(\{...
3
votes
0answers
629 views

Expected value of bounded function? [closed]

The expected value of a function is $$E[g(x)] = \int_{-\infty}^{\infty}g(x)f(x)dx.$$ What happens if $g$ is a function such as $g:\mathbb{R}\rightarrow]a,b[$? Does the expected value exist? Should ...
2
votes
1answer
49 views

Is there a name for $\sum P(x) \frac{P(x)}{Q(x)}$ ? (P and Q are pmf)

I know that $\sum P(x) log \left( \frac{P(x)}{Q(x)} \right)$ is the kl-divergence. I'd like to know if there is a name for $\sum P(x) \left( \frac{P(x)}{Q(x)} \right)$ (no log), but couldn't find one. ...
2
votes
1answer
613 views

Difference between function and distribution?

I have constant function as $$y = exp(-x^2)$$ This also represent gaussian distribution with mean zero and variance of 0.5 Now if we take sample from this function, which will always be from this ...
2
votes
2answers
4k views

Check if pmf/pdf is valid

According to this and this, we can say that a function f is pmf/pdf iff f is non-negative and the sum/integral over... is 1. But for example, for pmf, there is also a property called "countable ...
2
votes
1answer
1k views

R - Calculate trendline and extend it for 365 days automatically

I have daily data with logarithmic decreasing trend (around 30-days-data). In excel I'm calculating these data's trendline and with that trendline equation, I'm projecting these values to 365-days ...
2
votes
2answers
77 views

How to make the best final prediction of the optimum value in a Bayesian optimization process?

I'm trying to understand the process of Bayesian optimization of a black box function and the bit I'm confused about is how to make the very last prediction of the true maximum after you have made all ...
2
votes
1answer
54 views

A function of random variables $X_1, …, X_k$ that goes from $\mathcal{R}^k$ to the reals is measurable with respect to $\sigma(X_1, …, X_k)$

I'm reading Resnick's "A probability Path" and doing exercise 3 on page 85. The statement is: Suppose $f : \mathcal{R}^k \rightarrow \mathcal{R}$ and $f \in \mathcal{B}(\mathcal{R}^k) / \...
2
votes
1answer
2k views

Calculating power function for ANOVA

There are several functions in R to calculate the power of a test, for example, the pwr-functions of the pwr package. My question is how we get this function for ...
2
votes
1answer
29 views

replacement error when feeding data from function into matrix in R [closed]

I am trying to write a function that creates simulated datasets. The function takes the argument size, being the size of a group, and it is meant to produce a matrix with 100 columns with values 0 or ...
2
votes
2answers
632 views

Function to Produce Periodic Spike and Decay

I am seeking a function (or short algorithm, ideally implemented in R) that produces something similar to the following: See, I would like to be able to generate a vector of $n$ items that follows ...