# Questions tagged [matlab]

A programming language/environment. Use this tag for any on-topic question that (a) involves MATLAB either as a critical part of the question or expected answer, & (b) is not just about how to use MATLAB .

1,187 questions
Filter by
Sorted by
Tagged with
10 views

### Does anyone know how to perform close returns plot?

How to do Close returns plot in time series? I have to plot time series problems using close returns plot but i cannot find some books to help me find the basic how-tos. a material i have found is ...
14 views

### Correlated Random variables

On Matlab I would like to simulate a wireless mobile phone cell, in particular I want to reproduce the effect of shadow fading on the link between two users. So if I consider a certain 2D map, with ...
16 views

### Bizarre simulation results with ADF test

I simulated the following processes \begin{align} y_{1,t} = \beta y_{2,t} + \epsilon_{1,t} \\ y_{2,t} = y_{2,t-1} + \epsilon_{2,t}, \; \; \; \epsilon_{2,t} \sim N(0,1) \\ \epsilon_{1,t-1} = \...
9 views

### Using time-delay network to classify the actual output

Is it possible to use a time-delay net to classify a set of features based on their actual and past values? To be specific i am thinking to use a tapped delay line of [0:N] and modify the default time-...
14 views

### mafdr returns very small q-values

I am using matlab function for FDR procedure. The function is mafdr(). ...
26 views

### Issue about confidence interval on OLS intercept

Let us assume this simple linear model: $Y|X=\beta_0+\beta_1X+\epsilon$ where $X \sim N(\mu,\sigma^2)$ and $\epsilon \sim N(0,\sigma_{\epsilon}^2)$ Suppose also that $X$ and $\epsilon$ have all ...
34 views

### Why do MATLAB and R give different results for Wilcoxon signed rank test?

I have tried to calculate Wilcoxon signed rank test p-values using MATLAB and R. Strangely, they give different results. Concretely, my code for MATLAB is ...
13 views

### What is the difference between Chan & Vese and total variation segmentation methods?

What is the difference between Chan & Vese and total variation segmentation methods, which is better between the two and how to explain that?
5 views

### Performing an “online” linear interpolation [migrated]

I have a problem where I need to do a linear interpolation on some data as it is acquired from a sensor (it's technically position data, but the nature of the data doesn't really matter). I'm doing ...
30 views

### How to predict new data in Matlab neural network regression when output vs. target is not diagonal

In the ideal case, we expect the output vs. target plot to be diagonal. In Matlab, using the neural network regression app, the plot comes with the non-diagonal best fit (i.e., output=m x target+...
31 views

### One hot encoding for (40x10) images [duplicate]

I have 40 different images (1, ..40),( each one has 10 repetition " 40x10"),i should use one hot encoding for each image (the 40), for example image (1) the one hote encoding will be encoding will be: ...
32 views

### One hot encoding for images ( 40x10 images)

I have 40 different images (1, ..40),( each one has 10 repetition " 40x10"),i should use one hot encoding for each image (the 40), for example image (1) the one hote encoding will be encoding will be:...
6 views

### How can I improve my non linear multi dimensional regression? 8 parameters and 8 sets of data, 4 variables

I have this system of equations that I need to fit 8 parameters with 8/maybe 9 sets of experimental data: My response variable is [DCF], I have three independent variables: [O_3], [FeOOH] and time. ...
14 views

### How to perform the Kolmogorov-Smirnov test on the truncated power-law distributed data?

Recently, I read papers that perform power-law fitting on their empirical data (estimate the alpha), some of them report corresponding p-value for the Kolmogorov-Smirnov test, but many of them do not. ...
128 views

### What distribution should I fit to this data

I am trying to find a distribution that fits my data (3500+ data points) with satisfying goodness of fit (gof), I use the Kolmogorov-Smirnov test and its p-value as a gof measurement (p-value > 0.1). ...
32 views

### Tensorflow - keras: bad performance for simple curve fitting task [duplicate]

I'm trying to implement a very simple one layered MLP for a toy regression problem with one variable (dimension = 1) and one target (dimension = 1). It's a simple curve fitting problem with zero noise....
8 views

### GPU Parallelization: Kernel for Value Function Iteration on Matlab

(I crossposted on stackoverflow, I'm not sure where this question best fits.) I'd like to write a matlab function that does Value Function Iteration on GPU. What I have in mind is very similar to ...
43 views

### Why does gradient descent fail training a network for predicting times table?

I am training a feedforwardnet with gradient descent traingd as backpropagation algorithm to predict times table. ...
57 views

### Generating skew-normal distribution in Matlab

My apologies if this is a trivial question, but I am having trouble with this for a while now. I need to use a skew-normal distribution in research in MATLAB and the only way I found after googling ...
32 views

### Dimension reduction (matrix) using eigenvalues and eigenvectors. PCA?

I am stuck with one task where I need to reduce dimensions of the matrix 20000 by 10, compute eigenvectors and eigenvalues and determine how much the dimension can be reduced and transform the data. ...
825 views

### How do I test if regression slopes are statistically different?

I have a set of data that is composed of a measured parameter (dependent variable) as a function of time (independent variable), before and after an intervention event. I have calculated slope and ...
40 views

### Evaluating Likelihood in Bootstrap Particle Filter

I am currently struggling with an attempt to apply a bootstrap particle filter to a linear, Gaussian state-space model $$s_t=A\,s_{t-1}+B\,\nu_t\qquad\text{( transition equation )}$$ \qquad z_t=C\,...
50 views

### emmeans/multcomp in R vs multcompare in Matlab

I am analyzing a dataset with one within variable (Xw1) and one between variable Xb1. The within variable (...
32 views

### Signal Decomposition

I have two time dependent signal sources X & Y. Both can be modeled as having a linear combination of time dependent individual components and common components; so X(t)=a(t)+C(t)+noise, Y(t)=b(t)+...
57 views

### Bootstrap Particle Filter (Gordon, Salmond, Smith, 2003) - Importance Weights

So, my endeavor to apply the is just for my own edificationI am currently struggling with an attempt to apply a bootstrap particle filter (Gordon, Salmond, Smith, 2003) to a linear, Gaussian state-...
20 views

### What model should I use for seeing the effects between time series?

I am new to statistics, but I have good knowledge in Matlab and I want to use it to model 3 time series. I have 3 time series with quarterly data from year 2006 to year 2018 of GDP, Capital ...
16 views

### How to Improve the accuracy of my Cancer Prediction Model? [duplicate]

I'm building a logistic regression model to predict if a patient has cancer based on 9 features. Having built learning curves and increasing my regularization parameter to reduce over fitting, which ...
29 views

### nonparametric normalization

I would like to normalize some of my data based on images to compare the relative brightness of some pixels compared to another image, (with different scalings) say I have an image in Matlab (in ...
71 views

### Difference in R-squared values for MATLAB and Python

I've fitted a data with following sigmoidal function with MATLAB using Curve Fitting Tool and with Python with scipy.curve_fit() ...
28 views

### Using Recurrent Neural networks for Real-Time Pattern Recognition

I would like to implement a neural network model for pattern recognition in MATLAB. I have to identify 4 phases of a movement (which are sequential i.e. A -> B -> C -> D) from accelerometric data ...
37 views

### What does add Gauss Random Noise mean?

I'm reading a article about LSSVM and in numerical part they created an artificial example and it says: The two features of samples are uniformly distrubuted in $[0,1)$ and $(1,2]$ with 50% of Gauss ...
69 views

### Are Epochs, Learning rate and Hidden units related to each other?

I'm working on an LSTM NN, I wanted to know if there is any relationship between the learning rate, epochs and the hidden units that will/might affect my classification output? The MATLAB version I'...
30 views

### How can I determine differences between two circular distributions?

I have circular datasets. I am using this MATLAB package to perform tests on my data. https://au.mathworks.com/matlabcentral/fileexchange/10676-circular-statistics-toolbox-directional-statistics . I ...
73 views

### How to apply Principal components (Eigenvectors) in PCA?

I struggle to understand how to get further in my PCA analysis after computing the eigenvectors of the covariance matrix. I choose the number of principal components which contain 95% of the ...
66 views

### PCA output different each run

I am trying to analyse my data that contains many NaNs values by learning a PCA from Matlab: https://au.mathworks.com/help/stats/pca.html There is an example of using ALS Algorithm input argument for ...
57 views

### Generating synthetic data based on mean, skewness, standard deviation and autocorrelation

Given that I have the mean, standard deviation, skewness and autocorrelation, How do I generate 1000 years of random data based on the above parameters in python or Matlab? I know for example I can ...
31 views

### Logistic Regression in MATLAB glmnet always returns 0 vector as coefficients [closed]

I am using glmnet in MATLAB 2019a on my Macbook to do logistic regression. Algorithm: $log(\frac{\pi_i}{1-\pi_i})=\beta_0+X_i^T\beta$ $\pi_i=P(Y=2|X_i)=1-P(Y=1|X_i)$ Code: ...
48 views

### Matlab hardlim (step) function does not have exact step

Hardlim matlab function should look like a step: But the code provided at the documentation page ...
42 views

### Interpreting Normalized Cross Correlation

I'm having difficult understanding how to interpret a normalized cross correlation after using the function in Matlab for my research project. I've read through the Matlab help page and several other ...
37 views

### How to plot results from Kalman filter

I am interested in representing the performance/consistency of my Kalman filter in a single plot. I would like to compare the norm of the estimate error against 3$\sigma$ error. I would also like the ...
77 views

### How to estimate a SVAR model with contemporaneous restrictions that are different to the lagged restrictions

I am trying to do an SVAR model from the paper "What drives natural gas prices - an SVAR approach" (link below) which has different constraints for the lagged variables (The $A^{*}_{i}$ matrices) than ...
19 views

### Differences between matlab's PCA and theoretical Karhunen-Loève expansion

Matlab's pca offers coeff and score as results. Coeff represent the eigenvectors of the covariance matrix of the process in question, while score is the representation of the data in the components ...
10 views

### Test Error on various types of Regression

I'm testing a dataset for various types of regression, comparing test error for each one to the Mean Prediction Error, that I found at the beginning. Unfortunately I don't have any experience in this ...
18 views

### Estimating the noise to estimate profile likelihood

I am trying to obtain profile likelihoods around parameters obtained by fitting an ODE model to some data. I am using the method discussed in the study Data is assumed to have normal errors ~\$N(0,\...
47 views

### Artificial Neural Network in MATLAB

I am training an ANN on MATLAB. I am keeping the training set same. Everytime I train the network from scratch, I am receiving different output (or Performance). Is it something expected?
32 views

### How do you “correct” for another predictor when investigating correlations?

I have a large data set of survey responses in which test takers, after taking a test, reported on resources they used, hours spent studying each month, etc. I also have access to the test taker's ...
21 views

### How can I estimate bivariate probability density for support restricted data?

I have a bivariate sample with the following kernel density estimation The issue is that there is actually a cutoff for log(Age) at about 2.5, so value greater than 2.5 has probability 0. The fitted ...
59 views

### QML vs MLE for GJR-GARCH models

I am writing my master's thesis and using a AR(1) GJR-GARCH(1,1)-EVT-Copula model on my data. One of the main papers I use is McNeil & Frey (2000), in which they only do AR-GARCH-EVT. In this ...