Answered

Calculate Exponetial Moving Covariance

Not really a hand, but maybe some hints...Let's say you have variables x and y, and you want the exponentially weighted rolling ...

Calculate Exponetial Moving Covariance

Not really a hand, but maybe some hints...Let's say you have variables x and y, and you want the exponentially weighted rolling ...

2 månader ago | 0

| accepted

Answered

Select sample from an array

Maybe this: ints = [2:7:259 3:7:259 4:7:259 5:7:259]; srtints = sort(ints); X1 = x(:,srtints);

Select sample from an array

Maybe this: ints = [2:7:259 3:7:259 4:7:259 5:7:259]; srtints = sort(ints); X1 = x(:,srtints);

2 månader ago | 0

| accepted

Answered

Kruskal-Wallis test with very small p-values

p values can be anywhere between 0 and 1, depending on your data. a tiny p value like that is telling you that you would very r...

Kruskal-Wallis test with very small p-values

p values can be anywhere between 0 and 1, depending on your data. a tiny p value like that is telling you that you would very r...

2 månader ago | 0

Answered

Fitting a multivariate Gaussian distribution on a histogram

There isn't really a universal answer to "which distribution fits best", because there are an infinite number of different distr...

Fitting a multivariate Gaussian distribution on a histogram

There isn't really a universal answer to "which distribution fits best", because there are an infinite number of different distr...

2 månader ago | 0

| accepted

Answered

How to index through variable list in a table after doing calculation with each variable

myVars = {'Var1name' 'Var2name' 'Var3name'}; % list the names of the variables you want for iVar=1:numel(myVars) thisColu...

How to index through variable list in a table after doing calculation with each variable

myVars = {'Var1name' 'Var2name' 'Var3name'}; % list the names of the variables you want for iVar=1:numel(myVars) thisColu...

2 månader ago | 1

Answered

How to obtain the standard error for each of the fitted parameters

The notion of a standard error assumes some kind of random sampling. For example, the standard error of your 'b' parameter refl...

How to obtain the standard error for each of the fitted parameters

The notion of a standard error assumes some kind of random sampling. For example, the standard error of your 'b' parameter refl...

2 månader ago | 0

Answered

sqlite foreign key constraint not enforced

In case anyone else is interested, here is the answer from MATLAB technical support: This [is] a bug in executing PRAGMA querie...

sqlite foreign key constraint not enforced

In case anyone else is interested, here is the answer from MATLAB technical support: This [is] a bug in executing PRAGMA querie...

2 månader ago | 0

Answered

Weird fitting result from using 'ksdensity'

Try histogram(x,'Normalization','pdf')

Weird fitting result from using 'ksdensity'

Try histogram(x,'Normalization','pdf')

2 månader ago | 0

| accepted

Answered

How to plot a spatial correlation with a p-value threshold?

After you get X (bottom of your first code segment): rCrit = 0.312; % Based on N=40 and alpha = 0.05, 2-tailed, from a table of...

How to plot a spatial correlation with a p-value threshold?

After you get X (bottom of your first code segment): rCrit = 0.312; % Based on N=40 and alpha = 0.05, 2-tailed, from a table of...

2 månader ago | 0

| accepted

Answered

double truncated data sample

This is pretty ugly, but I think will do what you asked for: function [x]=generate_sample(n,eta,beta,theta,t1,t2) % ...

double truncated data sample

This is pretty ugly, but I think will do what you asked for: function [x]=generate_sample(n,eta,beta,theta,t1,t2) % ...

3 månader ago | 0

Question

sqlite foreign key constraint not enforced

My question is how to get MATLAB's sqlite databases to enforce foreign key constraints. Here is a minimal working example illus...

3 månader ago | 1 answer | 0

Answered

How to use least square fit in MATLAB to find coefficients of my polynomial?

% It sounds like you have data arrays like these: nPoints = 100; H = rand(nPoints,1); C = rand(nPoints,5); % If so, comput...

How to use least square fit in MATLAB to find coefficients of my polynomial?

% It sounds like you have data arrays like these: nPoints = 100; H = rand(nPoints,1); C = rand(nPoints,5); % If so, comput...

3 månader ago | 1

| accepted

Answered

How to remove effect of "in" predictors on "out" predictors in stepwiseregression?

One way to think of it is that the "out" predictors will only improve the fit of the regression model if they bring in some new ...

How to remove effect of "in" predictors on "out" predictors in stepwiseregression?

One way to think of it is that the "out" predictors will only improve the fit of the regression model if they bring in some new ...

3 månader ago | 1

Answered

How to fit data in exponential fit (R = exp(-q*D)) and find coefficient "q" using Maximum Likelihood Estimate (MLE)?

As I read this question, it is about fitting a model rather than a distribution, so I don't think mle is appropriate. Instead, ...

How to fit data in exponential fit (R = exp(-q*D)) and find coefficient "q" using Maximum Likelihood Estimate (MLE)?

As I read this question, it is about fitting a model rather than a distribution, so I don't think mle is appropriate. Instead, ...

3 månader ago | 0

Answered

Multivariate analysis of variance in Matlab

You need to arrange your data in a table with one row per individual group member. For example, your first group seems to have ...

Multivariate analysis of variance in Matlab

You need to arrange your data in a table with one row per individual group member. For example, your first group seems to have ...

3 månader ago | 1

| accepted

Answered

Selecting a "random" element from an array with each element having it's own weighting

% Wts is your vector of weights. Wts = Wts / sum(Wts); % make sure they sum to 1 cumPrs = cumsum(Wts); % cumPr is the cumula...

Selecting a "random" element from an array with each element having it's own weighting

% Wts is your vector of weights. Wts = Wts / sum(Wts); % make sure they sum to 1 cumPrs = cumsum(Wts); % cumPr is the cumula...

3 månader ago | 0

Answered

Help fitting data to an implicit equation

I would suggest using fminsearch. The error function to be minimized would be something like: function thiserr = err(x,y,t) ...

Help fitting data to an implicit equation

I would suggest using fminsearch. The error function to be minimized would be something like: function thiserr = err(x,y,t) ...

3 månader ago | 0

| accepted

Answered

Chi-squared for multiple groups

The crosstab function will do this--it is not limited to 2x2 tables. Example: % Make up example data for 200 participants, codi...

Chi-squared for multiple groups

The crosstab function will do this--it is not limited to 2x2 tables. Example: % Make up example data for 200 participants, codi...

3 månader ago | 0

Answered

using mle in matlab

One problem is that mle's search function (fminsearch) may try negative parameter values, in which case your pdf function return...

using mle in matlab

One problem is that mle's search function (fminsearch) may try negative parameter values, in which case your pdf function return...

3 månader ago | 0

Answered

ttest2 with a group describing independent values (statistics)

No, it is not possible to use ttest2 as you suggest. Your design has 2 factors: gender and time (day/night) with repeated measu...

ttest2 with a group describing independent values (statistics)

No, it is not possible to use ttest2 as you suggest. Your design has 2 factors: gender and time (day/night) with repeated measu...

4 månader ago | 1

| accepted

Answered

Generation of Conditional Random Variables

It sounds like the only "free" aspect of your new samples is the new total (say, 241 instead of 240). Once you have that new to...

Generation of Conditional Random Variables

It sounds like the only "free" aspect of your new samples is the new total (say, 241 instead of 240). Once you have that new to...

4 månader ago | 1

Answered

Calculate Nakagami m parameter using the mle function

I think the minimum change you need is fast_fading=fast_fading(filtersize:end); fast_fading = fast_fading - min(fast_fading); ...

Calculate Nakagami m parameter using the mle function

I think the minimum change you need is fast_fading=fast_fading(filtersize:end); fast_fading = fast_fading - min(fast_fading); ...

4 månader ago | 0

Answered

Mixed anova design function (unbalanced design)

If the goal of the analysis is to see if the two groups differ significantly in sleep pre-expt, then actually the simplest appro...

Mixed anova design function (unbalanced design)

If the goal of the analysis is to see if the two groups differ significantly in sleep pre-expt, then actually the simplest appro...

4 månader ago | 0

Answered

model parameter estimation from RMSE between modeled outputs and observations

Something like this. If it is too slow, note that you can use 'optimset' to pass fminsearch options that make it finish faster ...

model parameter estimation from RMSE between modeled outputs and observations

Something like this. If it is too slow, note that you can use 'optimset' to pass fminsearch options that make it finish faster ...

4 månader ago | 0

Answered

model parameter estimation from RMSE between modeled outputs and observations

I assume the model is too complex for regression, etc. In that case, you might be able to do this with fminsearch, if there are...

model parameter estimation from RMSE between modeled outputs and observations

I assume the model is too complex for regression, etc. In that case, you might be able to do this with fminsearch, if there are...

4 månader ago | 0

Answered

Linear model fit error

Use the transpose operator on x1, x2, x3 and y so that these are column variables, like this for x1: x1 = [7 8 7 8 7 8 7 8 7 8 ...

Linear model fit error

Use the transpose operator on x1, x2, x3 and y so that these are column variables, like this for x1: x1 = [7 8 7 8 7 8 7 8 7 8 ...

4 månader ago | 0

Answered

Randi Error- Array exceeds max array size preference

This looks wrong: OOK=randi(1,sig_length); The first parameter (here, 1) is the maximum random integer (the minimum is 1). Si...

Randi Error- Array exceeds max array size preference

This looks wrong: OOK=randi(1,sig_length); The first parameter (here, 1) is the maximum random integer (the minimum is 1). Si...

4 månader ago | 0

| accepted

Answered

repeated measure anova two options

Not sure but I think you need T = table([1 2]','VariableNames',{'Time'}); T.Time = categorical(T.Time); % add this line Mayb...

repeated measure anova two options

Not sure but I think you need T = table([1 2]','VariableNames',{'Time'}); T.Time = categorical(T.Time); % add this line Mayb...

4 månader ago | 0

Answered

What kind of join will work to merge these two tables

Try T3 = join(T1,T2,'Keys','City')

What kind of join will work to merge these two tables

Try T3 = join(T1,T2,'Keys','City')

4 månader ago | 0

| accepted

Answered

derive new variable with random float values using for loop

Despite your comments, I guess you want 0-1 for the second option, not 0-2. I guess you want all numbers in the range to be equ...

derive new variable with random float values using for loop

Despite your comments, I guess you want 0-1 for the second option, not 0-2. I guess you want all numbers in the range to be equ...

4 månader ago | 0

| accepted