Answered

Differences between functions ezfit and Matlab's gamfit in fitting data to the gamma distribution?

There are two somewhat different parameterizations of the gamma distribution. In one (which I think is used by gamfit), the mean...

Differences between functions ezfit and Matlab's gamfit in fitting data to the gamma distribution?

There are two somewhat different parameterizations of the gamma distribution. In one (which I think is used by gamfit), the mean...

4 months ago | 0

Answered

How do I calculate the R^2?

Either of these: Rsqr = corr(x(:,2),y)^2; RsqrAlso = 1-(std(resids)/std(y))^2;

How do I calculate the R^2?

Either of these: Rsqr = corr(x(:,2),y)^2; RsqrAlso = 1-(std(resids)/std(y))^2;

4 months ago | 1

Answered

I would like to find elements of a matrix that fulfill a condition but after every loop the condition is changing.

I think this will almost do what you want. edges = 0:0.05:30; [~,~,bin_numbers] = histcounts(diameters,edges); The output bin...

I would like to find elements of a matrix that fulfill a condition but after every loop the condition is changing.

I think this will almost do what you want. edges = 0:0.05:30; [~,~,bin_numbers] = histcounts(diameters,edges); The output bin...

5 months ago | 0

| accepted

Answered

Generating a categorical array with group names

Is this what you are after? part1 = repmat({'Name1'},1055,1); part2 = repmat({'Name2'},1641,1); part3 = repmat({'Name3'},2055...

Generating a categorical array with group names

Is this what you are after? part1 = repmat({'Name1'},1055,1); part2 = repmat({'Name2'},1641,1); part3 = repmat({'Name3'},2055...

5 months ago | 0

| accepted

Answered

Forming a CDF by adding different types of PDF and generating random number

It seems like there are several different questions here. If you want to generate random numbers from a custom CDF, one simple ...

Forming a CDF by adding different types of PDF and generating random number

It seems like there are several different questions here. If you want to generate random numbers from a custom CDF, one simple ...

5 months ago | 2

| accepted

Answered

Calculating pdf and cdf for data extracted as a table

This command pdfwindspeed = pdf('Normal',A) returns the pdf of the A values within the standard normal with mu=0 and sigma=1. ...

Calculating pdf and cdf for data extracted as a table

This command pdfwindspeed = pdf('Normal',A) returns the pdf of the A values within the standard normal with mu=0 and sigma=1. ...

5 months ago | 0

Answered

How to use one data set to find the mean of another?

NON1 = NON == 1; % this makes a boolean vector that is true for the positions where NON==1 mean(PLCm(NON1)); % this computes ...

How to use one data set to find the mean of another?

NON1 = NON == 1; % this makes a boolean vector that is true for the positions where NON==1 mean(PLCm(NON1)); % this computes ...

5 months ago | 1

Question

Request for help computing convolution of random variables via fft

Inspired by the answers of @David Goodmanson to this earlier question, I have been trying to understand exactly how in general t...

5 months ago | 2 answers | 0

Answered

run glmfit , why get Warning: X is ill conditioned, or the model is overparameterized

The problem is that the x1-x5 values sum to 24 in every row. This means that any one of the x's can be predicted from the rest ...

run glmfit , why get Warning: X is ill conditioned, or the model is overparameterized

The problem is that the x1-x5 values sum to 24 in every row. This means that any one of the x's can be predicted from the rest ...

5 months ago | 0

| accepted

Answered

CDF of VOn Mises distribution

The Von Mises distribution is included in Cupid. You could use it like this to calculate CDF values: >> location = 10; >> conc...

CDF of VOn Mises distribution

The Von Mises distribution is included in Cupid. You could use it like this to calculate CDF values: >> location = 10; >> conc...

5 months ago | 0

Answered

How do I get four different answers guaranteed generated randomly from several arrays?

One way is to put the two random selections inside a while loop, check whether any meals are repeated, and then only exit the lo...

How do I get four different answers guaranteed generated randomly from several arrays?

One way is to put the two random selections inside a while loop, check whether any meals are repeated, and then only exit the lo...

5 months ago | 0

| accepted

Answered

How to load .mat data from another folder?

You need the folder name at the beginning of the string you pass to load, maybe something like this: for iFile = 1:numel(N1) ...

How to load .mat data from another folder?

You need the folder name at the beginning of the string you pass to load, maybe something like this: for iFile = 1:numel(N1) ...

5 months ago | 1

Answered

Probplot for Generalized Extreme Value distribution

Cupid includes the Frechet distribution. It doesn't have probplot function, but you can easily produce something similar: % as...

Probplot for Generalized Extreme Value distribution

Cupid includes the Frechet distribution. It doesn't have probplot function, but you can easily produce something similar: % as...

5 months ago | 0

| accepted

Answered

How to NOT share variable with nested function?

It sounds like your "big code" is a script rather than a function, but now you want to make a function out of it. I suggest you...

How to NOT share variable with nested function?

It sounds like your "big code" is a script rather than a function, but now you want to make a function out of it. I suggest you...

5 months ago | 0

Answered

How to plot confidence bounds for a theoretical cumulative distribution function?

For a given X value, the theoretical cumulative probability is p = F(X). Suppose you have a sample of N observations and you le...

How to plot confidence bounds for a theoretical cumulative distribution function?

For a given X value, the theoretical cumulative probability is p = F(X). Suppose you have a sample of N observations and you le...

6 months ago | 0

Answered

How to loop through variable names and to save them on one file?

You can use strings for variable names like this: a = 'WD__Avr'; for.... [...] x = mean(data_measured.(a)(ind_time)); % no...

How to loop through variable names and to save them on one file?

You can use strings for variable names like this: a = 'WD__Avr'; for.... [...] x = mean(data_measured.(a)(ind_time)); % no...

6 months ago | 0

| accepted

Answered

I need a quantitative method of identification of which distribution best represents my data set

One approach is to: get the maximum likelihood parameter estimates for fitting each candidate distribution to your actual data....

I need a quantitative method of identification of which distribution best represents my data set

One approach is to: get the maximum likelihood parameter estimates for fitting each candidate distribution to your actual data....

6 months ago | 0

Answered

How can I test for significance between expected and observed outcomes?

Another alternative: You might consider that you have three classes of items: those for which the predicted correlation was posi...

How can I test for significance between expected and observed outcomes?

Another alternative: You might consider that you have three classes of items: those for which the predicted correlation was posi...

6 months ago | 0

Answered

Can one get fitted value without going to predict?

From your reference to 'predict', I'm guessing you have a vector of observed x values and you want to compute the predicted y fo...

Can one get fitted value without going to predict?

From your reference to 'predict', I'm guessing you have a vector of observed x values and you want to compute the predicted y fo...

6 months ago | 0

| accepted

Answered

Optimization of multiple variables without any toolbox

If I understand the question, your basic approach seems OK but your code isn't structured quite right. I think this is closer t...

Optimization of multiple variables without any toolbox

If I understand the question, your basic approach seems OK but your code isn't structured quite right. I think this is closer t...

6 months ago | 1

| accepted

Answered

correlation of nonlinear variables

It isn't really clear what you mean by "correlation coefficients for nonlinear variables", because an infinite number of nonline...

correlation of nonlinear variables

It isn't really clear what you mean by "correlation coefficients for nonlinear variables", because an infinite number of nonline...

6 months ago | 0

Answered

Generating and storing lists of variable lengths?

There isn't really a good solution to this type of problem with "flat file" databases, but relational databases handle it very g...

Generating and storing lists of variable lengths?

There isn't really a good solution to this type of problem with "flat file" databases, but relational databases handle it very g...

6 months ago | 1

| accepted

Answered

How to linearize the nested parfor loop?

One approach is to set out all the desired pairs in advance. A crude way to do that is pairs = zeros(0,2); n = 3; for i = 1:...

How to linearize the nested parfor loop?

One approach is to set out all the desired pairs in advance. A crude way to do that is pairs = zeros(0,2); n = 3; for i = 1:...

6 months ago | 0

| accepted

Answered

Subsets of uncorrelated features

N = 5; R = rand(N); % We will ignore the lower triangular part of this array rCutoff = 0.4; % Make a cell array that holds...

Subsets of uncorrelated features

N = 5; R = rand(N); % We will ignore the lower triangular part of this array rCutoff = 0.4; % Make a cell array that holds...

6 months ago | 1

| accepted

Answered

chi2gof reports different observed values than reported

The O values printed by chi2gof are counts of the number of observations in each bin, defined by the bin edges. In this case ch...

chi2gof reports different observed values than reported

The O values printed by chi2gof are counts of the number of observations in each bin, defined by the bin edges. In this case ch...

7 months ago | 0

Answered

How to save multiple .mat files as one .mat file?

You can load all 24 .mat files for a single day and then save all of the collected variables together as one .mat file. For exa...

How to save multiple .mat files as one .mat file?

You can load all 24 .mat files for a single day and then save all of the collected variables together as one .mat file. For exa...

7 months ago | 0

| accepted

Answered

Make name in for loop and read table

I guess you have tables called ScanRec1, ScanRec2, ...? If so, you can do almost what you want by making each table a field wit...

Make name in for loop and read table

I guess you have tables called ScanRec1, ScanRec2, ...? If so, you can do almost what you want by making each table a field wit...

7 months ago | 0

Answered

How to reference a variable in a promt to the user, where the variable will change based on the input csv file

how about: fprintf('Would you like to plot %s ? (y/n)', vnames{d-1})

How to reference a variable in a promt to the user, where the variable will change based on the input csv file

how about: fprintf('Would you like to plot %s ? (y/n)', vnames{d-1})

7 months ago | 0

Answered

Problems using `fitdist` to Rician distribution

I'm not sure why you are getting that error message, but Rician(6.5538e-05,0.11714) looks quite good: In case you are curious...

Problems using `fitdist` to Rician distribution

I'm not sure why you are getting that error message, but Rician(6.5538e-05,0.11714) looks quite good: In case you are curious...

8 months ago | 0

Answered

OOP: Reference (subclass) enumeration names from static superclass method. Possible?

If doWork really just needs the names, maybe pass allnames as an argument of doWork, something like this: function resu...

OOP: Reference (subclass) enumeration names from static superclass method. Possible?

If doWork really just needs the names, maybe pass allnames as an argument of doWork, something like this: function resu...

8 months ago | 2