Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

swh:1:snp:7bb11892490e1dc1b1ff3be1d93f489dadb3e857
  • Code
  • Branches (1)
  • Releases (0)
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • 8306d99
  • /
  • test
  • /
  • initialvalue.m
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
content badge Iframe embedding
swh:1:cnt:c2333242189b5827815654767009ffa9e44e24f8
directory badge Iframe embedding
swh:1:dir:892f10df507d1f9e5b4f08f94035d8aa1fa69841
revision badge
swh:1:rev:c5b693d0a66e83c9387433b33c0eab481bd4a763
snapshot badge
swh:1:snp:7bb11892490e1dc1b1ff3be1d93f489dadb3e857
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: c5b693d0a66e83c9387433b33c0eab481bd4a763 authored by Wesley Tansey on 08 May 2020, 15:42:20 UTC
Fixed bug in easy that created too large a support for the alternative distribution
Tip revision: c5b693d
initialvalue.m
function initials=initialvalue(signalfile,zvaluefile,reglocafile,L)
%%L is number of the components in the normal mixture



signal=load(signalfile);%%%% signals, of the brain region of interest (ROI), gotten by BH procedure 
zvalue=load(zvaluefile);%%%% observed data on the whole image grid including the brain part and the non-brain part
regloca=load(reglocafile);%%%%% location of the ROI on the LX*LY*LZ image grid
 


n_reg=length(regloca);% the number of voxels in the ROI
zvalue_1=zeros(n_reg,1);% to store the z-value of the signals by BH procedure
num=0;
for i=1:n_reg
   pi=regloca(i);
   if signal(i)==1
     num=num+1;
     zvalue_1(num)=zvalue(pi);
     
   end
end
prop=1-num/n_reg;

%%%%%%%%%%%always use set the initial values for beta and h to be zeros
beta=0;
h=0;

initials=[beta,h];


temp=0;



try
  obj=gmdistribution.fit(zvalue_1(1:num,1),L);%% gmdistribution.fit is a Matlab built-in function, see http://www.mathworks.com/help/stats/gmdistribution.fit.html
  for j=1:L
      initials=[initials,obj.mu(j),obj.Sigma(j),obj.PComponents(j)];
  end
  
  
catch err %%%%%%% if gmdistribution.fit is divergent 
  mu=zeros(L,1);

  if L==1
     mu(1)=1;

  elseif mod(L,2)==0 %%%%%%if L is divisible by 2, then let mu_i be [-L,-L/2,-L/4,...,L/4,L/2,L] and thus symmetric around 0.
    temp=L/2;
    for mu_i=1:temp
      mu(mu_i)=mu_i*2;
      mu(L-mu_i+1)=-mu(mu_i);
    end
  else  %%%%%%%if L is not divisible by 2, then let mu_i be [-floor(L/2),-floor(L/2)+1,...,0,floor(L/2)-1,floor(L/2)] and thus symmetric around 0.
    temp=ceil(L/2);
      for mu_i=1:L
        mu(mu_i)=mu_i-temp;
      end

  end



  Sigma=ones(L,1);
  PComponents=(1/L)*ones(L,1);
  
  for j=1:L
      initials=[initials,mu(j),Sigma(j),PComponents(j)];
  end

end

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top